|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gecco.communication.client.DataOutputExchangeHandler
A class that sends messages to the server
| Field Summary | |
private ServerConnection |
connection
Description of the Field |
private boolean |
die
Description of the Field |
private ServerAmbassador |
i_am_working_for
Description of the Field |
private MessageQueue |
messages_to_send
Description of the Field |
| Constructor Summary | |
DataOutputExchangeHandler(MessageQueue q,
ServerConnection sc,
ServerAmbassador sa)
|
|
| Method Summary | |
void |
addMessageToQueue(Object message)
Used by the ServerAmbassador to add messages to send |
void |
kill()
called whenever someone wants this thread to die |
void |
run()
Main processing method for the DataOutputExchangeHandler object |
private void |
sendAbortActionMessage(AbortActionMessage m)
Sends a message that tells the server that a unit wants to abort an action |
private void |
sendAbortGameMessage()
Sends a message that tells the server that this client wants to abort the game (disconnect) |
private void |
sendActionOnPositionMessage(ActionOnPositionMessage m)
Sends a message that tells the server that a unit wants to perform an action with a position as target |
private void |
sendActionOnUnitMessage(ActionOnUnitMessage m)
Sends a message that tells the server that a unit wants to perform an action with a unit as target |
private void |
sendActionOnVoidMessage(ActionMessage m)
Sends a message that tells the server that a unit wants to perform an action with no target |
private void |
sendMessage(Object o)
Called when there are messages to send in the queue. |
private void |
sendPingReplyMessage(PingReplyMessage m)
Sends a reply to a received ping message from the server |
private void |
sendStartGameMessage()
Sends a message that tells the server that this client (role) is ready to receive messages, and wants all its visible information |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private MessageQueue messages_to_send
private ServerConnection connection
private ServerAmbassador i_am_working_for
private boolean die
| Constructor Detail |
public DataOutputExchangeHandler(MessageQueue q,
ServerConnection sc,
ServerAmbassador sa)
q - the queue that will contain the messages to sendsc - the connection to send messages tosa - the serverambassador who created this object| Method Detail |
public void addMessageToQueue(Object message)
message - The feature to be added to the MessageToQueue attributepublic void run()
run in interface Runnablepublic void kill()
private void sendMessage(Object o)
throws Exception
o - Description of ParameterException - Description of Exceptionprivate void sendPingReplyMessage(PingReplyMessage m)
m - Description of Parameterprivate void sendActionOnVoidMessage(ActionMessage m)
m - Description of Parameterprivate void sendActionOnUnitMessage(ActionOnUnitMessage m)
m - Description of Parameterprivate void sendActionOnPositionMessage(ActionOnPositionMessage m)
m - Description of Parameterprivate void sendAbortActionMessage(AbortActionMessage m)
m - Description of Parameter
private void sendAbortGameMessage()
throws Exception
Exception - Description of Exception
private void sendStartGameMessage()
throws Exception
Exception - Description of Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||