Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jcsq
Class CSServer  view CSServer download CSServer.java

java.lang.Object
  extended byjcsq.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.


Field Summary
private  byte[] buffer
           
private  java.net.InetAddress host
           
private static java.lang.String INFO_STRING
           
private static int INFO_STRING_LENGTH
           
private  java.lang.String ip
           
private static java.lang.String PING_STRING
           
private static int PING_STRING_LENGTH
           
private  byte playerCount
           
private  java.util.Vector playerList
           
private static java.lang.String PLAYERS_STRING
           
private static int PLAYERS_STRING_LENGTH
           
private  int port
           
private  java.net.DatagramPacket receivePacket
           
private static java.lang.String RULES_STRING
           
private static int RULES_STRING_LENGTH
           
private  java.net.DatagramPacket sendPacket
           
private  java.net.DatagramSocket socket
           
private  int timeout
           
 
Constructor Summary
CSServer(java.lang.String host)
          Creates a CS-Server with specified host.
CSServer(java.lang.String host, java.net.DatagramSocket socket)
          Creates a CS-Server with specified host and socket.
CSServer(java.lang.String host, int port)
          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.).
 
Method Summary
 java.lang.Object clone()
          Clones (makes an exact copy) of the object
 void closeServer()
          Closes the server, after this you will not be able to call the getPlayers, getRules methods-
private  jcsq.serverinfo.InfoPacketStripper getInfo()
           
 java.lang.String getIp()
           
 byte getPlayerCount()
           
 java.util.Vector getPlayerList()
           
 jcsq.serverinfo.ServerInfo getServerInfo()
          Returns a ServerInfo object
 jcsq.rules.Rules getServerRules()
           
 int getTimeout()
           
 long ping()
           
 void setTimeout(int timeout)
           
private  void splitHost(java.lang.String ip_port)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

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: :

Method Detail

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()