|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.freecol.metaserver.MetaRegister
public final class MetaRegister
The MetaRegister
stores information about running servers.
Each server has it's own MetaItem
object.
Constructor Summary | |
---|---|
MetaRegister()
|
Method Summary | |
---|---|
void |
addServer(java.lang.String name,
java.lang.String address,
int port,
int slotsAvailable,
int currentlyPlaying,
boolean isGameStarted,
java.lang.String version,
int gameState)
Adds a new server with the given attributes. |
org.w3c.dom.Element |
createServerList()
Creates a server list. |
void |
removeDeadServers()
Removes servers that have not sent an update for some time. |
void |
removeServer(java.lang.String address,
int port)
Removes a server from the register. |
void |
updateServer(java.lang.String name,
java.lang.String address,
int port,
int slotsAvailable,
int currentlyPlaying,
boolean isGameStarted,
java.lang.String version,
int gameState)
Updates a server with the given attributes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetaRegister()
Method Detail |
---|
public void removeDeadServers()
public void addServer(java.lang.String name, java.lang.String address, int port, int slotsAvailable, int currentlyPlaying, boolean isGameStarted, java.lang.String version, int gameState) throws java.io.IOException
name
- The name of the server.address
- The IP-address of the server.port
- The port number in which clients may connect.slotsAvailable
- Number of players that may conncet.currentlyPlaying
- Number of players that are currently connected.isGameStarted
- true if the game has started.version
- The version of the server.gameState
- The current state of the game.
java.io.IOException
public void updateServer(java.lang.String name, java.lang.String address, int port, int slotsAvailable, int currentlyPlaying, boolean isGameStarted, java.lang.String version, int gameState) throws java.io.IOException
name
- The name of the server.address
- The IP-address of the server.port
- The port number in which clients may connect.slotsAvailable
- Number of players that may conncet.currentlyPlaying
- Number of players that are currently connected.isGameStarted
- true if the game has started.version
- The version of the server.gameState
- The current state of the game.
java.io.IOException
public void removeServer(java.lang.String address, int port)
address
- The IP-address of the server to remove.port
- The port number of the server to remove.public org.w3c.dom.Element createServerList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |