net.sourceforge.rconed
Class Rcon

java.lang.Object
  extended bynet.sourceforge.rconed.Rcon

public abstract class Rcon
extends java.lang.Object

Rcon is a simple Java library for issuing RCON commands to game servers.

This has currently only been used with HalfLife based servers.

Example:

    response = Rcon.send(27778, "127.0.0.1", 27015, rconPassword, "log on");

Author:
DeadEd

Constructor Summary
Rcon()
           
 
Method Summary
static java.lang.String send(int localPort, java.lang.String ipStr, int port, java.lang.String password, java.lang.String command)
          Send the RCON request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rcon

public Rcon()
Method Detail

send

public static java.lang.String send(int localPort,
                                    java.lang.String ipStr,
                                    int port,
                                    java.lang.String password,
                                    java.lang.String command)
                             throws java.net.SocketTimeoutException
Send the RCON request. Sends the command to the game server. A port (localPort must be opened to send the command through.

Parameters:
localPort - The port on the local machine where the RCON request can be made from.
ipStr - The IP (as a String) of the machine where the RCON command will go.
port - The port of the machine where the RCON command will go.
password - The RCON password.
command - The RCON command (without the rcon prefix).
Returns:
The reponse text from the server after trying the RCON command.
Throws:
java.net.SocketTimeoutException - when there is any problem communicating with the server.