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 boolean
active
private java.io.File
flagFile
private java.lang.String
flagFilename
private static java.util.logging.Logger
LOGGER
private java.io.PrintWriter
out
-
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 void
allClientsConnected()
private void
createFlagfile()
void
gameStartupCompleted()
void
gameStartupFailed(java.lang.String reason)
void
gotClient(java.lang.String playerName, boolean remote)
boolean
isActive()
void
readyToAcceptClients()
private void
removeFlagfile()
void
serverStoppedRunning()
-
-
-
Method Detail
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceINotifyWebServer
-
readyToAcceptClients
public void readyToAcceptClients()
- Specified by:
readyToAcceptClients
in interfaceINotifyWebServer
-
gotClient
public void gotClient(java.lang.String playerName, boolean remote)
- Specified by:
gotClient
in interfaceINotifyWebServer
-
allClientsConnected
public void allClientsConnected()
- Specified by:
allClientsConnected
in interfaceINotifyWebServer
-
gameStartupCompleted
public void gameStartupCompleted()
- Specified by:
gameStartupCompleted
in interfaceINotifyWebServer
-
gameStartupFailed
public void gameStartupFailed(java.lang.String reason)
- Specified by:
gameStartupFailed
in interfaceINotifyWebServer
-
serverStoppedRunning
public void serverStoppedRunning()
- Specified by:
serverStoppedRunning
in interfaceINotifyWebServer
-
createFlagfile
private void createFlagfile()
-
removeFlagfile
private void removeFlagfile()
-
-