|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--nl.bluering.ppracing.NetReceive
This class implements the procedures for receiving data from the server or a client
| Constructor Summary | |
NetReceive(java.net.Socket s,
int i,
NetClient n)
Creates a new platform for the client to receive messages from the specified server |
|
NetReceive(java.net.Socket s,
int i,
NetSClient n)
Creates a new platform for the server to receive messages from the specified client |
|
| Method Summary | |
void |
acknowledge(int id)
The client receives it's ID from the server |
void |
carmove(int id,
java.lang.String s)
Is called when a player has moved it's car |
void |
circuit(java.lang.String s)
Is called when a client receives the circuit from the server |
void |
decode(java.lang.String s)
This functions decodes the specified message string, and calls the appropriate function |
void |
disconnect(int id)
Either a client disconnects from the server or the server disconnects this client |
void |
endgame()
Is called when the server ends the game |
void |
message(int id,
java.lang.String s)
Is called when a message from the server or a client is received |
void |
newgame()
Is called when the server sends a newgame-request |
void |
players(java.lang.String s)
Is called when a list of players is received, the list needs decoding. |
void |
run()
Is called when the thread is started This function keeps checking for new messages, until stopped |
void |
setid(int id)
Sets the ID of the client, only needed for feedback when debugging |
void |
setname(int id,
java.lang.String s)
Is called when a client sends it's name to the server |
void |
start()
Starts this class in a new thread |
void |
stop()
Stops this Thread |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public NetReceive(java.net.Socket s,
int i,
NetClient n)
public NetReceive(java.net.Socket s,
int i,
NetSClient n)
| Method Detail |
public void setid(int id)
public void start()
public void stop()
public void run()
run in interface java.lang.Runnablepublic void decode(java.lang.String s)
public void acknowledge(int id)
public void disconnect(int id)
public void players(java.lang.String s)
public void message(int id,
java.lang.String s)
public void newgame()
public void carmove(int id,
java.lang.String s)
public void endgame()
public void setname(int id,
java.lang.String s)
public void circuit(java.lang.String s)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||