PDA

View Full Version : Making a minecraft server GUI




macguin
Apr 19, 2011, 08:08 PM
I am really tired of looking at the terminal window, trying to decipher through time stamps and iChat formatting what people are asking me. I was thinking I could make GUI application that would be built around the craftbukkit.jar file. The only problem is I do not know how to execute .jars in a program, how to send commands to them, or receive and parse information from them (like logout events or chat). It there any way to do this?



chown33
Apr 19, 2011, 09:06 PM
Have you ever written any kind of program before? If so, in what language?

Do you know what standard-input and standard-output streams are (stdin, stdout)?

macguin
Apr 19, 2011, 09:51 PM
Have you ever written any kind of program before? If so, in what language?

Do you know what standard-input and standard-output streams are (stdin, stdout)?

I have written several iPhone apps, so obviously objective c. Also Java and C++.
Also applescript, but I personally don't consider it a real programming language.

I have no experience with standard-input and standard-output (no idea what it means)

Mac_Max
Apr 20, 2011, 12:36 PM
This might be what you want:

http://cocoadevcentral.com/articles/000025.php
http://cocoadevcentral.com/articles/000031.php

Otherwise you'll have to see if the developer of Minecraft has any sort of IPC support.

chown33
Apr 20, 2011, 01:00 PM
I have no experience with standard-input and standard-output (no idea what it means)

Then you will need to do some research before attempting to write your GUI front-end.

Have you written any Java code that uses Runtime.exec() to run another program? If so, you may have used the Process's inputStream, outputStream, and errorStream to get data from the process, send data to the process, or read the error message from the process. All three streams are the "standard" streams of the child process: stdin, stdout, stderr (their C symbol names when using stdio.h).

In a Java program, the System.in, System.out, and System.err streams are that process's stdin, stdout, and stderr streams.

In a shell command, < redirects stdin to a file, > redirects stdout, and 2> redirects stderr.

In a shell pipeline, such as cat fee fie foo | sort, the stdout of the cat process is connected to the stdin of the sort process by a pipe (see: man 2 pipe). Both processes run concurrently. sort will wait for input, and cat will wait for its stdout pipe buffer to drain, so the processes never outrun one another nor are they starved for data.

macguin
Apr 20, 2011, 03:13 PM
This might be what you want:

http://cocoadevcentral.com/articles/000025.php
http://cocoadevcentral.com/articles/000031.php

Otherwise you'll have to see if the developer of Minecraft has any sort of IPC support.

How do I set the launch path for the NSTask to the minecraft_server.jar?

chown33
Apr 20, 2011, 03:47 PM
How do I set the launch path for the NSTask to the minecraft_server.jar?

You don't. The launch path should be the 'java' command, which is responsible for running the Java classes in the jar.

You'll need to know the full path of the java command, so in a Terminal window, enter this command:
which java

The path it tells you is a standardized location, but I'm telling you how to do this so you know it for other commands.

You'll also need to read the man page for the java command, so you know how to tell it that the minecraft_server.jar is a jar-file and not a class, a defined system property, or some other parameter.