Class games.Battle.server.EuropaCore.PlayerFile
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class games.Battle.server.EuropaCore.PlayerFile

java.lang.Object
   |
   +----games.Battle.server.EuropaCore.PlayerFile

public class PlayerFile
extends Object
implements Runnable
PlayerFile is a thread that manages reading the player file, authorizing players, modifying players, and periodically saving the player file.

Variable Index

 o checkpointInterval
checkpointInterval is the delay between writes of the player file.

Constructor Index

 o PlayerFile(Logger, String)
construct and start the player file thread.

Method Index

 o authorizePlayer(PlayerInfo)
validate a particular login attempt
 o getPlayerInfo(PlayerInfo)
get the player info matching a given id
 o newPlayer(PlayerInfo)
create a new player based on id.
 o run()
Loop forever, sleeping and checkpointing periodically
 o start()
start the checkpointing thread
 o stop()
stop the checkpoint thread

Variables

 o checkpointInterval
  public int checkpointInterval
checkpointInterval is the delay between writes of the player file.

Constructors

 o PlayerFile
  public PlayerFile(Logger l,
                    String filename) throws IOException
construct and start the player file thread.
Parameters:
l - the log file
filename - the path to the player file

Methods

 o run
  public void run()
Loop forever, sleeping and checkpointing periodically
 o start
  public void start()
start the checkpointing thread
 o stop
  public void stop()
stop the checkpoint thread
 o authorizePlayer
  public boolean authorizePlayer(PlayerInfo id)
validate a particular login attempt
 o getPlayerInfo
  public PlayerInfo getPlayerInfo(PlayerInfo id)
get the player info matching a given id
 o newPlayer
  public boolean newPlayer(PlayerInfo id)
create a new player based on id.
Parameters:
id - the id to create

All Packages  Class Hierarchy  This Package  Previous  Next  Index