Class games.Battle.client.EuropaClient.EuropaClient
All Packages Class Hierarchy This Package Previous Next Index
Class games.Battle.client.EuropaClient.EuropaClient
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----games.Battle.client.EuropaClient.EuropaClient
- public class EuropaClient
- extends Applet
- implements Runnable
EuropaClient is the main applet for the "lobby" of the Europa
game. Sets up the game queue graphics, the who-list and the
chat window. This applet also initiates conversations with
the game server, logs users in, and spawns game board
clients when the server instructs it that a game is about to
begin.
-
gameId
- The game id, if a game is executing (-1 otherwise).
-
EuropaClient(Frame)
- Construct an EuropaClient window, and set an internal reference
to an encapsulating frame.
-
EuropaClient()
- Construct a EuropaClient instance free from the bonds of a
frame window.
-
changeInfo()
- Creates a dialog box allowing the user to change his or her
user information.
-
getGameId()
- Return the currently executing game Id, -1 if there is no
game in progress.
-
init()
- Performs a list of inititialization routines, including contacting
the game server, and building all of the components which are
inside the EuropaClient (including the various game queues and
the who list)
-
join(int)
- Sends a request to the server to join the given game.
-
main(String[])
- The main routine for an applet-less execution.
-
quit()
- Quits this applet, cleaning up any lingering windows and
informing the server that we are quitting.
-
readChat(int)
- Read numlines of chat window messages from the server and
display them in the chat window (if the chat window exists).
-
readGames(int)
- Read all of the game information from the server, and use
the information to properly update the contents of the game
queue window.
-
readWho(int)
- Read numplayers WhoInfo packets from the server and
display them in the who list.
-
resume()
- Resumes this applet's main thread.
-
run()
- The main execution loop for this applet's thread.
-
sendChat(String)
- Sends the given chat message to the server.
-
setPlayerInfo(PlayerInfo)
- Sends PlayerInfo information to the server so the server
can save the info for future reference.
-
shutdownServer()
- Sends a message to the server to shut itself down.
-
start()
- Starts up the applet thread of execution.
-
stop()
- Overloaded stop method to do nothing.
-
suspend()
- Suspends this applet's main thread.
-
toggleChatWindow()
- Turns the chat window on if it is off, and off if
it is on.
gameId
public int gameId
- The game id, if a game is executing (-1 otherwise).
EuropaClient
public EuropaClient(Frame f)
- Construct an EuropaClient window, and set an internal reference
to an encapsulating frame.
- Parameters:
- f - the frame window
EuropaClient
public EuropaClient()
- Construct a EuropaClient instance free from the bonds of a
frame window.
init
public void init()
- Performs a list of inititialization routines, including contacting
the game server, and building all of the components which are
inside the EuropaClient (including the various game queues and
the who list)
- Overrides:
- init in class Applet
setPlayerInfo
public void setPlayerInfo(PlayerInfo r)
- Sends PlayerInfo information to the server so the server
can save the info for future reference.
- Parameters:
- r - the PlayerInfo instance
- See Also:
- PlayerInfo
start
public void start()
- Starts up the applet thread of execution. This includes:
a) trying to log into the game, b) registering this
player (based on their login id) with the server. If all is
successful, then the run() method is called to start the
game, otherwise the applet execution ends.
- Overrides:
- start in class Applet
stop
public void stop()
- Overloaded stop method to do nothing.
- Overrides:
- stop in class Applet
readGames
public void readGames(int numGames) throws IOException
- Read all of the game information from the server, and use
the information to properly update the contents of the game
queue window. This method is also responsible for
recognizing when a game queue has been successfull filled
and starting the game clients.
- Parameters:
- numGames - the number of games to read from the server
readWho
public void readWho(int numplayers) throws IOException
- Read numplayers WhoInfo packets from the server and
display them in the who list.
- Parameters:
- numplayers - the number of players to read
readChat
public void readChat(int numlines) throws IOException
- Read numlines of chat window messages from the server and
display them in the chat window (if the chat window exists).
- Parameters:
- numlines - the number of lines to read
run
public void run()
- The main execution loop for this applet's thread. The thread
basically waits for input from the server and updates the
contents of all of the info window when information is
received.
join
public void join(int game) throws IOException
- Sends a request to the server to join the given game.
- Parameters:
- game - the game to join
getGameId
public int getGameId()
- Return the currently executing game Id, -1 if there is no
game in progress.
suspend
public void suspend()
- Suspends this applet's main thread.
resume
public void resume()
- Resumes this applet's main thread.
quit
public void quit()
- Quits this applet, cleaning up any lingering windows and
informing the server that we are quitting.
shutdownServer
public void shutdownServer()
- Sends a message to the server to shut itself down. This method
is really only accessible by wizards from their display consoles.
changeInfo
public void changeInfo()
- Creates a dialog box allowing the user to change his or her
user information.
toggleChatWindow
public void toggleChatWindow()
- Turns the chat window on if it is off, and off if
it is on.
sendChat
public void sendChat(String msg)
- Sends the given chat message to the server.
- Parameters:
- msg - the message to send to the server
main
public static void main(String argv[])
- The main routine for an applet-less execution.
All Packages Class Hierarchy This Package Previous Next Index