|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectServer
This class creates a server from the Scrabble lobby. A server can only be created from the server lobby. Only one server can be created on any one machine. The server creates new ServerThreads when a client connects. All communications from the client are then handled by the ServerThread, with the Server overseeing game syncrhonization.
Client,
ServerThread| Constructor Summary | |
Server()
|
|
| Method Summary | |
void |
close()
Closes all server sockets, and attempts to close all ServerThreads. |
void |
createServer()
Creates a server. |
Scrabble |
getScrabble()
Gets the instance of the Scrabble class. |
boolean |
isGameInProgress()
Returns true/false depending on whether the game of scrabble is in progress. |
boolean |
isListening()
Returns true/false depending on whether the server is listening for new client connections. |
void |
run()
|
void |
setGameInProgress(boolean gameInProgress)
Sets whether the scrabble game is in progress or not. |
void |
setListening(boolean listening)
Sets whether the server is listening for new client connections |
void |
start(java.lang.String dict,
int players,
int hints)
Called from the lobby when 'create server' is pressed. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Server()
| Method Detail |
public Scrabble getScrabble()
public boolean isGameInProgress()
public boolean isListening()
public void setGameInProgress(boolean gameInProgress)
gameInProgress - A boolean toggle.public void setListening(boolean listening)
listening - A boolean toggle.public void createServer()
public void run()
run in interface java.lang.Runnable
public void start(java.lang.String dict,
int players,
int hints)
dict - The dictionary to use in the remote game.players - The number of players required in the remote game.hints - The number of hints required in the remote game.public void close()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||