Package net.sf.colossus.server
Class NotifyWebServerViaFile
- java.lang.Object
-
- net.sf.colossus.server.NotifyWebServerViaFile
-
- All Implemented Interfaces:
INotifyWebServer
public class NotifyWebServerViaFile extends java.lang.Object implements INotifyWebServer
For communication between Game/Server and WebServer. Perhaps later replaced with a two-way socket connection? Class is always created, no matter whether we have a web server ( => active == true) or not ( => active == false); but this way, we can have all the "if (we have a web server) { } " checking done inside this class and do not clutter the main server code.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanactiveprivate java.io.FileflagFileprivate java.lang.StringflagFilenameprivate static java.util.logging.LoggerLOGGERprivate java.io.PrintWriterout-
Fields inherited from interface net.sf.colossus.server.INotifyWebServer
ALL_CLIENTS_CONNECTED, GAME_STARTUP_COMPLETED, GAME_STARTUP_FAILED
-
-
Constructor Summary
Constructors Constructor Description NotifyWebServerViaFile(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallClientsConnected()private voidcreateFlagfile()voidgameStartupCompleted()voidgameStartupFailed(java.lang.String reason)voidgotClient(java.lang.String playerName, boolean remote)booleanisActive()voidreadyToAcceptClients()private voidremoveFlagfile()voidserverStoppedRunning()
-
-
-
Method Detail
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceINotifyWebServer
-
readyToAcceptClients
public void readyToAcceptClients()
- Specified by:
readyToAcceptClientsin interfaceINotifyWebServer
-
gotClient
public void gotClient(java.lang.String playerName, boolean remote)- Specified by:
gotClientin interfaceINotifyWebServer
-
allClientsConnected
public void allClientsConnected()
- Specified by:
allClientsConnectedin interfaceINotifyWebServer
-
gameStartupCompleted
public void gameStartupCompleted()
- Specified by:
gameStartupCompletedin interfaceINotifyWebServer
-
gameStartupFailed
public void gameStartupFailed(java.lang.String reason)
- Specified by:
gameStartupFailedin interfaceINotifyWebServer
-
serverStoppedRunning
public void serverStoppedRunning()
- Specified by:
serverStoppedRunningin interfaceINotifyWebServer
-
createFlagfile
private void createFlagfile()
-
removeFlagfile
private void removeFlagfile()
-
-