Class games.Battle.server.EuropaCore.EuropaCore
All Packages Class Hierarchy This Package Previous Next Index
Class games.Battle.server.EuropaCore.EuropaCore
java.lang.Object
|
+----games.Battle.server.EuropaCore.EuropaCore
- public class EuropaCore
- extends Object
- implements Runnable
EuropaCore is the main shell of the server. It manages mutiple connections
coming in from the outside, co-ordinates the player file process, and
spawns player threads to allow the players to do things in the game.
-
MAX_GAMES
- the most games we'll allow to ever run simulteneously.
-
gameProc
- an array of actual game threads for each game in the server.
-
games
- an array of Game Information for each game in the server
-
who
- a vector of who is currently logged onto the game
-
EuropaCore(String[])
- construct the EuropaCore server.
-
authorizePlayer(PlayerInfo)
- return the player file's official record on this player, or null if
the player info passed in does not match any existing player
-
chatMessage(PlayerInfo, String)
- register a chat message from user "id"
-
getChatMessage(int)
- retrieve a message from the chat history
-
getPlayer(ServerSocket)
- block waiting for a player to connect to the given server socket
-
joinGame(int, PlayerInfo)
- allow a player to join a game identified by its unique id
-
lastChatUpdate()
- report the last chat update id
-
lastGameUpdate()
- report the last game update id
-
lastWhoUpdate()
- report the last who update id
-
main(String[])
- start the client
-
newPlayer(PlayerInfo)
- create a new player based on the passed in id.
-
quitGame(int, PlayerInfo)
- allow a player to decline to be in a game before it has actually
begun.
-
registerGameEnd(int)
- Notice that a game is over
-
registerGameStart(int, BattleGame)
- Notice that a game has actually begun.
-
resetGame(int)
- clear all the players out of a game that is over or failed to start.
-
run()
- loop forever getting connections and spawning player threads
-
start()
- actually initiate the thread that runs the server
-
stop()
- shutdown the server
who
public Vector who
- a vector of who is currently logged onto the game
MAX_GAMES
public final static int MAX_GAMES
- the most games we'll allow to ever run simulteneously.
games
public GameInfo games[]
- an array of Game Information for each game in the server
gameProc
public BattleGame gameProc[]
- an array of actual game threads for each game in the server.
EuropaCore
public EuropaCore(String argv[])
- construct the EuropaCore server. command line arguments are passed in
to allow the user to configure some of the basic parameters like what
port to run on nad how many players may connect at once.
- Parameters:
- argv - command line arguments
lastGameUpdate
public int lastGameUpdate()
- report the last game update id
lastWhoUpdate
public int lastWhoUpdate()
- report the last who update id
lastChatUpdate
public int lastChatUpdate()
- report the last chat update id
joinGame
public void joinGame(int gameId,
PlayerInfo id)
- allow a player to join a game identified by its unique id
- Parameters:
- gameId - the game to join
- id - the id of the player who wants to join the game
resetGame
public void resetGame(int gameId)
- clear all the players out of a game that is over or failed to start.
- Parameters:
- gameId - the game to reset
quitGame
public void quitGame(int gameId,
PlayerInfo id)
- allow a player to decline to be in a game before it has actually
begun. If the game is in progress the player must forfeit from the
game window rather than the moons window.
- Parameters:
- gameId - the game to quit
- id - the player who wants to bail out
registerGameStart
public void registerGameStart(int gameId,
BattleGame game)
- Notice that a game has actually begun.
registerGameEnd
public void registerGameEnd(int gameId)
- Notice that a game is over
chatMessage
public void chatMessage(PlayerInfo id,
String msg)
- register a chat message from user "id"
- Parameters:
- id - the player sending the message
- msg - the message to be sent
getChatMessage
public String getChatMessage(int messageId)
- retrieve a message from the chat history
- Parameters:
- messageId - the message to fetch
getPlayer
public Socket getPlayer(ServerSocket ss)
- block waiting for a player to connect to the given server socket
- Parameters:
- ss - the socket that the server is listening on
main
public static void main(String argv[])
- start the client
- Parameters:
- argv - command line arguments
start
public void start()
- actually initiate the thread that runs the server
stop
public void stop()
- shutdown the server
run
public void run()
- loop forever getting connections and spawning player threads
authorizePlayer
public PlayerInfo authorizePlayer(PlayerInfo id)
- return the player file's official record on this player, or null if
the player info passed in does not match any existing player
- Parameters:
- id - the player trying to log in
newPlayer
public boolean newPlayer(PlayerInfo id)
- create a new player based on the passed in id.
- Parameters:
- id - the registration packet of hte new player
All Packages Class Hierarchy This Package Previous Next Index