|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--nl.bluering.ppracing.NetSClient
This class provides the functionality for playing a network game as server. It takes care of the communication with the clients
| Field Summary | |
boolean[] |
enabled
|
| Constructor Summary | |
NetSClient(Ppracing p,
java.lang.String n,
newnetwindow nw)
Creates a new server-client and starts the server |
|
| Method Summary | |
void |
addplayer(java.net.Socket s)
Adds a player and creates in/outcoming connections |
void |
doremove()
This method removes all marked players. |
void |
endgame(java.lang.String s)
The server ends the game |
int |
getid()
|
java.lang.String[] |
getplayerlist()
|
int[] |
getplayertype()
|
void |
indisconnect(int id)
A client disconnects from the server |
void |
inmessage(int id,
java.lang.String s)
The server gets a message from a player The message goes to all other players |
void |
inmove(int id,
java.lang.String s)
A player sends a move to the server |
void |
inname(int i,
java.lang.String s)
This function is called by NetReceive, to set the name of the connected player. |
void |
outcircuit()
The server sends the circuit to all players |
void |
outdisconnect(int id)
The server disconnects a client |
void |
outmessage(java.lang.String s)
The server sends a message to the players The message goes to all other players |
void |
outmove(int m)
The server does a move |
void |
outname()
Sends the player-list to all connected players |
void |
removeplayer(int id)
This method disables the player on the given ID. |
void |
showmessage(java.lang.String s)
Shows a message on the chatbox in the newnetwin |
void |
startgame()
The server starts the game |
void |
stop()
Stops the server and terminates all connections |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public boolean[] enabled
| Constructor Detail |
public NetSClient(Ppracing p,
java.lang.String n,
newnetwindow nw)
throws java.io.IOException
| Method Detail |
public void addplayer(java.net.Socket s)
public void removeplayer(int id)
public void doremove()
public void inname(int i,
java.lang.String s)
public void outname()
public int getid()
public void outmessage(java.lang.String s)
public void inmessage(int id,
java.lang.String s)
public void outmove(int m)
public void inmove(int id,
java.lang.String s)
public void startgame()
public void endgame(java.lang.String s)
public void indisconnect(int id)
public void outdisconnect(int id)
public void outcircuit()
public void stop()
public java.lang.String[] getplayerlist()
public int[] getplayertype()
public void showmessage(java.lang.String s)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||