|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.limdul.cassiopeia.control.metaserver.MetaModus
public abstract class MetaModus
Abstrakte Basisklasse für alle Modi des Metaservers.
| Field Summary | |
|---|---|
static int |
CLIENT_CONNECTING
|
static int |
META_LOBBY
|
static int |
OPEN_GAME
|
| Constructor Summary | |
|---|---|
MetaModus(EventHandler handler,
MetaServer server)
Erzeugt einen Servermodus. |
|
| Method Summary | |
|---|---|
void |
addClient(String client)
Fügt einen Client zur Liste der betroffenen Clients hinzu. |
protected void |
addExpectedTCP(int command)
Fügt einen BEfehl zur Liste der erwarteten TCP Befehle hinzu. |
protected void |
clearExpectedTCP()
Löscht die Liste der erwarten TCP Befehle. |
protected void |
createModus(int newModus)
Erzeugt einen neuen Servermodus. |
protected EventHandler |
getEventHandler()
Liefert den Eventhandler. |
protected MetaServer |
getServer()
Liefert den zugehörigen Server. |
abstract int |
getType()
Liefert den Typ des Modus. |
abstract void |
init()
Initialisiert den Modus. |
protected boolean |
isClient(String identifier)
Testet, ob der Client von dem Modus betroffen ist. |
void |
parseGameCommand(GameCommand command)
Verarbeitet ein GameCommand. |
protected void |
removeClient(String identifier)
Entfernt einen Client von der Liste der betroffenen Clients. |
protected void |
sendCommand(TCPCommand command)
Sendet den Befehl nur an die Clients, die von diesem Modus betroffen sind. |
protected void |
sendOptions(GameOptions options)
Sendet die Spieloptionen an alle Clients, die von diesem Modus betroffen sind. |
void |
setConnection(ConnectionWaiting conWait)
Setzt das ConnectioNWaiting Objekt. |
void |
setEventHandler(EventHandler handler)
Setzt den Ereignisshandler, der für die Verteilung von Ereignissen zuständig ist. |
void |
shutdown()
Beendet den Server. |
protected boolean |
testTCPCommand(TCPCommand command)
Testet, ob das TCPCommand verarbeitet werden soll. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.limdul.cassiopeia.control.TCPCommandListener |
|---|
parseTCPCommand |
| Field Detail |
|---|
public static final int CLIENT_CONNECTING
MetaClientConnect,
Constant Field Valuespublic static final int META_LOBBY
MetaLobby,
Constant Field Valuespublic static final int OPEN_GAME
OpenGame,
Constant Field Values| Constructor Detail |
|---|
public MetaModus(EventHandler handler,
MetaServer server)
handler - Der Ereignisshandler.server - Der Metaserver| Method Detail |
|---|
public abstract int getType()
public void addClient(String client)
client - Die Nummer des hinzufügenden Clients.public void setConnection(ConnectionWaiting conWait)
conWait - Das ConnectionWaiting Objekt.public void parseGameCommand(GameCommand command)
GameCommandListenerGameCommand.
parseGameCommand in interface GameCommandListenercommand - Das GameCommandGameCommandListener.parseGameCommand(de.limdul.cassiopeia.control.gamecommands.GameCommand)public void shutdown()
protected final void createModus(int newModus)
newModus - Der gewünschte Modus.protected final boolean testTCPCommand(TCPCommand command)
Normal,
da der Client auch veraltete Befehle schicken kann.
command - Der Befehl
true wenn es nicht verarbeitet werden soll, false sonst.protected final void sendCommand(TCPCommand command)
command - Der zu sendende Befehl.protected final void sendOptions(GameOptions options)
options - Die zu sendenden Optionenpublic final void setEventHandler(EventHandler handler)
CassiopeiaListener
setEventHandler in interface CassiopeiaListenerhandler - Der EreignisshandlerCassiopeiaListener.setEventHandler(de.limdul.cassiopeia.control.EventHandler)protected final void clearExpectedTCP()
protected final void addExpectedTCP(int command)
command - Der hinzuzufügenden Befehl.protected final EventHandler getEventHandler()
protected MetaServer getServer()
public abstract void init()
protected final boolean isClient(String identifier)
identifier - Der Identifier des Clients.
true, wenn der Client betroffen ist, false sonst.protected final void removeClient(String identifier)
identifier - Der Identifier des Clients.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||