|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfeud.testgame.BlueThunderServer
This is this test game's server component. It's usually started from within a running client but can run as a stand-alone server as well.
Constructor Summary | |
BlueThunderServer()
Starts a new server using the default tcp-port. |
|
BlueThunderServer(int port)
Starts a new server using a specified tcp-port. |
Method Summary | |
void |
addScores(InfoDataContainer idc)
Adds the scores to a highscore table (a GUI-element). |
void |
broadcast(DataContainer dc)
Broadcasts data to all clients. |
DataContainer[] |
dataReceived(DataContainer c,
int type)
Data has been received by the server/client to which this listener has been added. |
void |
dataReceivedEnd()
The server/client has finished receiving in this transfer. |
PlayerInfo |
getPlayerInfo(int clientID)
Gets the player info a client's ID. |
DataContainer |
loggedIn(ClientInfo ci,
DataContainer dc)
A client has been logged in. |
DataContainer |
loggedOut(ClientInfo ci)
A client has been logged out. |
static void |
main(java.lang.String[] args)
Run the server as stand-alone. |
void |
remove(int loID,
int clientID,
ClientInfo ci)
Removes an object from the server |
void |
run()
|
void |
stop()
Stops the server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BlueThunderServer()
public BlueThunderServer(int port)
port
- int the portMethod Detail |
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- String[]
java.lang.Exception
public DataContainer loggedOut(ClientInfo ci)
ClientLogoutListener
loggedOut
in interface ClientLogoutListener
ci
- the ClientInfo of the logged out client
public DataContainer loggedIn(ClientInfo ci, DataContainer dc)
ClientLoginListener
loggedIn
in interface ClientLoginListener
ci
- the ClientInfo of the logged in client
public void run()
run
in interface java.lang.Runnable
public void stop()
public void dataReceivedEnd()
DataTransferListener
dataReceivedEnd
in interface DataTransferListener
public PlayerInfo getPlayerInfo(int clientID)
clientID
- int the ID
public void broadcast(DataContainer dc)
dc
- DataContainer the container with the data to broadcastpublic void remove(int loID, int clientID, ClientInfo ci)
loID
- intclientID
- intci
- ClientInfopublic DataContainer[] dataReceived(DataContainer c, int type)
DataTransferListener
dataReceived
in interface DataTransferListener
c
- the DataContainer that has been received.type
- the type of the message like MessageType defines it
public void addScores(InfoDataContainer idc)
idc
- InfoDataContainer the info container containing the scores
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |