|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectserver.Server
public class Server
| Constructor Summary | |
|---|---|
Server()
|
|
| Method Summary | |
|---|---|
static void |
createNewUser(NetworkObject n,
ServerThread s)
Creates a new user account. |
static java.lang.String |
getPlayerRecords(java.lang.String name,
java.lang.String game)
Returns a String representation of the Player and his record associated with this thread. |
static void |
getRankings(ServerThread player)
Sends the overall ranking of players (by most wins) to the player that requested it. |
static void |
getRankings(java.lang.String game,
ServerThread player)
Sends an array of Strings containing a list of the top 10 players and their records for the given game. |
static void |
logoutPlayer(java.lang.String name)
Makes a note in the database that this player is no longer logged in. |
static void |
main(java.lang.String[] args)
The main method of the program. |
static void |
passMessage(NetworkObject n,
int tableNum,
int playerNum)
Passes the message to the Table that the player is sitting at. |
static void |
removeFromIdle(ServerThread player)
Removes the specified player from the idle Vector due to a disconnect. |
static void |
removeFromTable(ServerThread player,
int tableID)
Removes the specified player from the ServerThread representing that player. |
static void |
selectGame(NetworkObject n,
ServerThread s)
Places the ServerThread from the idle Vector to the appropriate Table. |
static void |
updatePlayerRecords(java.lang.String name,
java.lang.String game,
java.lang.String result)
Updates a particular player's record for the specified game with the specified result. |
static void |
validateLogin(NetworkObject n,
ServerThread s)
Validates a user's login info. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Server()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
throws java.io.IOException
args - String[]
java.io.IOException
public static java.lang.String getPlayerRecords(java.lang.String name,
java.lang.String game)
name - String of the player whose records need to be retrieved.game - String found in Game defines the game of which the records need to be retrieved.
public static void updatePlayerRecords(java.lang.String name,
java.lang.String game,
java.lang.String result)
name - String of the player.game - String for which the records need to be udpated.result - String either Wins, Draws, or Losses.
public static void validateLogin(NetworkObject n,
ServerThread s)
n - NetworkObject contains the login info.s - ServerThread that just received the message.public static void logoutPlayer(java.lang.String name)
name - String of the Player that logged out.
public static void createNewUser(NetworkObject n,
ServerThread s)
n - NetworkObject contains the login infos - ServerThread that just received the message.public static void getRankings(ServerThread player)
player - ServerThread that requested the records.
public static void getRankings(java.lang.String game,
ServerThread player)
game - String for which the top 10 players need to be computed.player - ServerThread is the player requesting the records.
for the given game.
public static void selectGame(NetworkObject n,
ServerThread s)
n - NetworkObjects - ServerThread
public static void removeFromTable(ServerThread player,
int tableID)
player - ServerThread representing the player that needs to be removed
from the table.tableID - int that the player is sitting at.public static void removeFromIdle(ServerThread player)
player - ServerThread
public static void passMessage(NetworkObject n,
int tableNum,
int playerNum)
n - NetworkObject that the player sent.tableNum - int the table number that the player is sitting at.playerNum - int the number of the player at the Table.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||