|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfeud.testgame.BlueThunderClient
The client, i.e. the actual game. This client also opens a window with a simple server browser to join an existing server or start a new one.
Constructor Summary | |
BlueThunderClient()
Create a new client. |
Method Summary | |
void |
afterReceiving()
This is called after receiving the response from the server. |
void |
beforeReceiving()
This is called after sending and before receiving the response from the server. |
void |
beforeSending()
This method will be called before sending data. |
void |
connect(ServerEntry server,
java.lang.String name)
Connect the client to a server |
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. |
void |
disconnect()
Disconnect from the current server |
ServerEntry |
getServer()
Returns the server represented by a server entry. |
boolean |
isConnected()
Checks if the client is connected to a server. |
void |
quit()
Shuts down the client and everything... |
boolean |
runsServer()
Returns true, is a local server is running on this client machine. |
void |
shutDownServer()
Shuts down a local server on the client machine if one is running. |
void |
startServer(int port)
Starts a local server on the client machine. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BlueThunderClient() throws java.lang.Exception
java.lang.Exception
Method Detail |
public void connect(ServerEntry server, java.lang.String name) throws java.lang.Exception
GameClient
connect
in interface GameClient
server
- ServerEntry the server entry of the server to connect toname
- String the name of this client
java.lang.Exception
public void disconnect() throws java.lang.Exception
GameClient
disconnect
in interface GameClient
java.lang.Exception
public boolean isConnected()
GameClient
isConnected
in interface GameClient
public ServerEntry getServer()
GameClient
getServer
in interface GameClient
public void startServer(int port) throws java.lang.Exception
GameClient
startServer
in interface GameClient
port
- int the port on which the server should listen
java.lang.Exception
public void shutDownServer() throws java.lang.Exception
GameClient
shutDownServer
in interface GameClient
java.lang.Exception
public boolean runsServer()
GameClient
runsServer
in interface GameClient
public void quit()
GameClient
quit
in interface GameClient
public void beforeSending()
ClientPreProcessor
beforeSending
in interface ClientPreProcessor
public void beforeReceiving()
ClientPreProcessor
beforeReceiving
in interface ClientPreProcessor
public void afterReceiving()
ClientPreProcessor
afterReceiving
in interface ClientPreProcessor
public void dataReceivedEnd()
DataTransferListener
dataReceivedEnd
in interface DataTransferListener
public 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |