|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gecco.communication.server.DataOutputExchangeHandler
a class that listens for incoming messages from the client, receives them, and tells the server about them
Field Summary | |
private ClientConnection |
connection
Description of the Field |
private boolean |
disconnect
Description of the Field |
private ClientConnectionHandler |
i_am_working_for
Description of the Field |
private MessageQueue |
messages_to_send
Description of the Field |
Boolean |
pingSyncObject
Description of the Field |
private Server |
server
Description of the Field |
Constructor Summary | |
DataOutputExchangeHandler(MessageQueue q,
ClientConnection cc,
Server se,
ClientConnectionHandler cch)
Constructor for the DataOutputExchangeHandler object |
Method Summary | |
void |
abortGame()
called when the client says it wants to abort the game or disconnect |
void |
addMessageToQueue(Object message)
Adds a feature to the MessageToQueue attribute of the DataOutputExchangeHandler object |
void |
kill()
called whenever someone wants this Thread to die |
private void |
ping()
send a 'ping' to see if this client is available |
void |
run()
Main processing method for the DataOutputExchangeHandler object |
private void |
sendActionBlocked(ActionBlockedMessage m)
Description of the Method |
private void |
sendActionCompleted(ActionCompletedMessage m)
Description of the Method |
private void |
sendActionFailed(ActionFailedMessage m)
Description of the Method |
private void |
sendMapPointInvisible(MapPointInvisibleMessage m)
Description of the Method |
private void |
sendMapPointsInvisible(MapPointsInvisibleMessage m)
Description of the Method |
private void |
sendMapUpdate(MapUpdateMessage m)
Description of the Method |
private void |
sendMapUpdates(MapUpdatesMessage m)
Description of the Method |
private void |
sendMessage(Object m)
Called when a message is to be sent Checks the class of the object to send, and calls the appropriate method that sends that kind of object |
private void |
sendUnitDeleted(UnitDeletedMessage m)
Description of the Method |
private void |
sendUnitDestroyed(UnitDestroyedMessage m)
Description of the Method |
private void |
sendUnitMessage(UnitMessageMessage m)
Description of the Method |
private void |
sendUnitPositionUpdate(UnitPositionUpdateMessage m)
Sends a message that tells the client the new position of a unit |
private void |
sendUnitPropertiesUpdate(UnitPropertyChangedMessage m)
sends a message that tells the client the new values of the properties of a unit |
private void |
sendUnitVisible(UnitVisibleMessage m)
sends a message that tells the client that a new unit is visible |
Methods inherited from class java.lang.Object |
|
Field Detail |
public Boolean pingSyncObject
private MessageQueue messages_to_send
private ClientConnection connection
private Server server
private ClientConnectionHandler i_am_working_for
private boolean disconnect
Constructor Detail |
public DataOutputExchangeHandler(MessageQueue q, ClientConnection cc, Server se, ClientConnectionHandler cch)
q
- Description of Parametercc
- Description of Parameterse
- Description of Parametercch
- Description of ParameterMethod Detail |
public void addMessageToQueue(Object message)
message
- The feature to be added to the MessageToQueue attributepublic void run()
run
in interface Runnable
public void abortGame()
public void kill()
private void sendMessage(Object m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendUnitPositionUpdate(UnitPositionUpdateMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendUnitPropertiesUpdate(UnitPropertyChangedMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendUnitVisible(UnitVisibleMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendUnitDeleted(UnitDeletedMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendUnitMessage(UnitMessageMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendUnitDestroyed(UnitDestroyedMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendActionBlocked(ActionBlockedMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendMapUpdate(MapUpdateMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendMapUpdates(MapUpdatesMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendMapPointsInvisible(MapPointsInvisibleMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendMapPointInvisible(MapPointInvisibleMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendActionCompleted(ActionCompletedMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void sendActionFailed(ActionFailedMessage m) throws Exception
m
- Description of ParameterException
- Description of Exceptionprivate void ping() throws Exception
Exception
- Description of Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |