Jump to content

Minecraft Server Wrapper

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Jadon

Jadon

    Newbie

  • Members
  • Pip
  • 6 posts
Minecraft (minecraft.net) is a java game that's in alpha right now, and I host a very popular server on it.

I'm trying to create a "wrapper" in java that launches the minecraft_server.jar process, then captures the STDIN, and feeds a string to it that says "save-all" every 10 minutes. The save-all command simply saves the server's map.

I am not experienced in java, I'm a beginner at python. I understand some basics.

A friend said I needed this to launch the minecraft_server.jar:

Process p = Runtime.getRuntime().exec("java -Xmx" + options.memory + "M -Xms" + 1024 + "M -jar minecraft_server.jar nogui");

Thread t = new Thread(new ErrorStreamRouter(p.getErrorStream()));
Thread t2 = new Thread(new ErrorStreamRouter(p.getInputStream()));
Thread t3 = new Thread(input=new InputStreamRouter(System.in,p.getOutputStream()));

No idea how to turn this into an actually executable program. Also, I don't know how to make the 10 minute loop for save-all.

Any help or guidance is appreciated.
“If a cluttered desk is a sign of a cluttered mind, then what are we to think of an empty desk?” - Albert Einstein

#2
Kinari Takashima

Kinari Takashima

    Newbie

  • Members
  • Pip
  • 1 posts
Hello i dont know if this is true or not BUTTT i think that you need to make this a bat file to make this file executable
its a guess, if u want to know more tell me again :)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users