jcsq
Class CSServer

java.lang.Object
jcsq.CSServer
- All Implemented Interfaces:
- java.lang.Cloneable
- public class CSServer
- extends java.lang.Object
- implements java.lang.Cloneable
This represent the CS-Server. It will return objects that contains data regarding, server, players and rules.
ip
private java.lang.String ip
port
private int port
host
private java.net.InetAddress host
sendPacket
private java.net.DatagramPacket sendPacket
receivePacket
private java.net.DatagramPacket receivePacket
socket
private java.net.DatagramSocket socket
timeout
private int timeout
buffer
private byte[] buffer
playerList
private java.util.Vector playerList
playerCount
private byte playerCount
INFO_STRING
private static final java.lang.String INFO_STRING
- See Also:
- Constant Field Values
INFO_STRING_LENGTH
private static final int INFO_STRING_LENGTH
PLAYERS_STRING
private static final java.lang.String PLAYERS_STRING
- See Also:
- Constant Field Values
PLAYERS_STRING_LENGTH
private static final int PLAYERS_STRING_LENGTH
RULES_STRING
private static final java.lang.String RULES_STRING
- See Also:
- Constant Field Values
RULES_STRING_LENGTH
private static final int RULES_STRING_LENGTH
PING_STRING
private static final java.lang.String PING_STRING
- See Also:
- Constant Field Values
PING_STRING_LENGTH
private static final int PING_STRING_LENGTH
CSServer
public CSServer(java.lang.String host)
throws java.net.SocketException,
CSPortException,
java.net.UnknownHostException
- Creates a CS-Server with specified host.
host should be formatted: :
CSServer
public CSServer(java.lang.String host,
java.net.DatagramSocket socket)
throws java.net.SocketException,
CSPortException,
java.net.UnknownHostException
- Creates a CS-Server with specified host and socket.
Host should be formatted: :
CSServer
public CSServer(java.lang.String host,
int port)
throws java.net.SocketException,
CSPortException,
java.net.UnknownHostException
- Creates a CS-Server with specified host and port (OBS! This port is not port on the server you are connecting to, itīs the port from it will
open it from.).
Host should be formatted: :
closeServer
public void closeServer()
- Closes the server, after this you will not be able to call the getPlayers, getRules methods-
clone
public java.lang.Object clone()
- Clones (makes an exact copy) of the object
getInfo
private jcsq.serverinfo.InfoPacketStripper getInfo()
getServerInfo
public jcsq.serverinfo.ServerInfo getServerInfo()
throws java.lang.Exception
- Returns a ServerInfo object
getPlayerList
public java.util.Vector getPlayerList()
getServerRules
public jcsq.rules.Rules getServerRules()
ping
public long ping()
splitHost
private void splitHost(java.lang.String ip_port)
throws CSPortException
setTimeout
public void setTimeout(int timeout)
getTimeout
public int getTimeout()
getPlayerCount
public byte getPlayerCount()
getIp
public java.lang.String getIp()