Viewing the craftbukkit output in C#

Discussion in 'Bukkit Tools' started by boardinggamer, Nov 22, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    boardinggamer

    I want to make a server tool in C# but I need a way to view the server output in C# and be able to send commands to it. does anyone know how to do that or a website/video that shows how to do that.
     
  2. Offline

    Skyost

    Wrong section.
     
  3. Offline

    Maximvdw

    You can hook into the process (after creating it)

    Code:
            Process p = new Process();
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.CreateNoWindow = true;
            p.StartInfo.FileName = @".... path to java....";
            p.StartInfo.Arguments = ".... java arguments (RAm,... etc)";
     
            p.OutputDataReceived += new DataReceivedEventHandler(
                (s, e) =>
                {
                    Console.WriteLine(e.Data);
                }
            );
            p.ErrorDataReceived += new DataReceivedEventHandler((s, e) => { Console.WriteLine(e.Data); });
     
            p.Start();
            p.BeginOutputReadLine();
    I suggest trying it with "cmd" first

    PATH: Path to java
    ARGUMENTS: Java arguments (craftbukkit path, ram usage, ...)

    gr,
    Maxim
     
    Quantum64 likes this.
  4. Offline

    Quantum64

    C# was my very first programming language :D
     
    Blocky4Programs likes this.
Thread Status:
Not open for further replies.

Share This Page