Class Server
java.lang.Object
java.lang.Thread
net.sf.colossus.server.Server
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SelectionKeyprivate final List<SocketChannel> List of SocketChannels that are currently activeprivate final ByteBufferprivate Stringprivate final List<ClientHandlerStub> private ClientHandlerStubprivate booleanprivate final Objectprivate static Threadprivate final Map<String, Server.WithdrawInfo> ClientHandlers to be withdrawn, together with some related (timing) data; selector thread will do it then when it's the right time for itprivate booleanprivate GameServerSideprivate intTimeout how long server waits for clients before giving up; in normal/local games 0, meaning forever; in public server usage set to WEBGAMES_STARTUP_TIMEOUT_SECSprivate final Objectprivate Stringprivate booleanRecipients for everything send to "each client" - including the stubprivate booleanprivate booleanprivate longHow many ms ago last ping round was done.private static final Loggerprivate boolean(package private) ClientHandlerprivate final intMap of players to their clients.private final intServer socket port.(package private) ClientHandlerprivate final List<ClientHandler> Only real ClientHandlers (excluding the stub)private final MessageRecorderprivate final List<RemoteLogHandler> private Selectorprivate booleanWill be set to true after all clients are properly connectedprivate booleanprivate ServerSocketprivate booleanprivate intprivate longWhen server started to listed for clientsprivate static StartupProgressprivate booleanprivate intprivate CreatureServerSideprivate CreatureServerSideprivate final intprivate final intprivate final intprivate intNumber of player clients we're waiting for to *connect*private intNumber of player clients we're waiting for to *join* - when last one has joined, then kick of newGame2() or loadGame2()private final Objectprivate static final intHow long in public server games socket shall wait for Clients.private final ObjectSemaphor for synchronized access to waitingForPlayersToJoinprivate final WhatNextManagerFields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYFields inherited from interface IServer
CLIENT_VERSION, CLIENT_VERSION_CAN_HANDLE_NAK, CLIENT_VERSION_CAN_RECONNECT, CLIENT_VERSION_UNDERSTANDS_PING, CLIENT_VERSION_VARIANT_XML_OK, MINIMUM_CLIENT_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacquireAngel(Legion legion, CreatureType angelType) private void(package private) StringaddClient(ClientHandler client, String playerName, boolean remote, int clientVersion, String buildInfo, boolean spectator) Add a Client.private voidaddRemoteClient(IClient client, Player player) (package private) void(package private) void(package private) void(package private) voidallInitBattle(MasterHex masterHex) (package private) void(package private) voidDO NOT USE: package so that it can be called from Log4J Appender.(package private) voidallPlaceNewChit(CreatureServerSide critter) (package private) void(package private) voidallRemoveLegion(Legion legion) (package private) voidallRequestConfirmCatchup(String action, boolean skipInTrouble) (package private) voidIF last ping round is at least PING_REQUEST_INTERVAL_SEC seconds ago, then send a ping request to all clients (except those which are in trouble anyway).(package private) voidallRevealCreatures(Legion legion, List<CreatureType> creatureNames, String reason) (package private) voidallRevealEngagedLegion(Legion legion, boolean isAttacker, String reason) pass to all clients the 'revealEngagedCreatures' message, then fire an 'revealEvent' to the history.(package private) voidallRevealLegion(Legion legion, String reason) (package private) voidallRevealLegion(Legion legion, List<CreatureType> creatures, String reason) Call from History during load game only(package private) voidHack to set color on load game.(package private) void(package private) void(package private) void(package private) void(package private) void(package private) void(package private) void(package private) void(package private) voidNeeded if loading game outside the split phase.(package private) voidallSyncOption(String optname, boolean value) (package private) voidallSyncOption(String optname, int value) (package private) voidallSyncOption(String optname, String value) (package private) voidallTellAddCreature(AddCreatureAction event, boolean updateHistory, String reason) (package private) void(package private) voidallTellBattleMove(int tag, BattleHex startingHex, BattleHex endingHex, boolean undo) (package private) voidallTellCarryResults(CreatureServerSide carryTarget, int carryDamageDone, int carryDamageLeft, Set<String> carryTargetDescriptions) (package private) voidallTellDidMove(Legion legion, MasterHex startingHex, MasterHex hex, EntrySide entrySide, boolean teleport, CreatureType teleportingLord) (package private) voidallTellDidSplit(Legion parent, Legion child, int turn, boolean history) Called from game after this legion was split off, or by history(package private) voidallTellDidSummon(Legion receivingLegion, Legion donorLegion, CreatureType summon) (package private) voidallTellEngagement(MasterHex hex, Legion attacker, Legion defender) (package private) voidallTellEngagementResults(Legion winner, String method, int points, int turns) (package private) voidallTellGameOver(String message, boolean disposeFollows) (package private) voidallTellHexDamageResults(CreatureServerSide target, int damage) (package private) voidallTellHexSlowResults(CreatureServerSide target, int slowValue) (package private) voidallTellLegionLocation(Legion legion) (package private) voidallTellMovementRoll(int roll) (package private) voidallTellPlayerElim(Player eliminatedPlayer, Player slayer, boolean updateHistory) (package private) voidallTellRedo(boolean val) (package private) voidallTellRemoveCreature(Legion legion, CreatureType creature, boolean updateHistory, String reason) (package private) voidallTellReplay(boolean val, int maxTurn) (package private) voidallTellStrikeResults(CreatureServerSide striker, CreatureServerSide target, int strikeNumber, List<String> rolls, int damage, int carryDamageLeft, Set<String> carryTargetDescriptions) voidallTellUndidMove(Legion legion, MasterHex formerHex, MasterHex currentHex, boolean splitLegionHasForcedMove) (package private) voidallUpdateCreatureCount(CreatureType type, int count, int deadCount) (package private) voidallUpdatePlayerInfo(boolean treatDeadAsAlive, String reason) (package private) voidallUpdatePlayerInfo(String reason) private boolean(package private) voidappendToConnLogs(ClientHandler chInTrouble, String message) voidapplyCarries(BattleHex hex) (package private) voidaskAcquireAngel(PlayerServerSide player, Legion legion, List<CreatureType> recruits) Find out if the player wants to acquire an angel or archangel.(package private) voidaskChooseStrikePenalty(SortedSet<PenaltyOption> penaltyOptions) Takes a Set of PenaltyOptions.(package private) voidaskConcede(Legion ally, Legion enemy) Ask ally's player whether he wants to concede with ally.(package private) voidAsk ally's player whether he wants to flee with ally.(package private) voidaskPickColor(Player player, List<PlayerColor> colorsLeft) (package private) voidaskPickFirstMarker(Player player) voidassignColor(PlayerColor color) voidassignFirstMarker(String markerId) voidassignStrikePenalty(String prompt) voidvoidvoidvoidclientWontConfirmCatchup(ClientHandler ch, String reason) Check whether client is currently expected to send a caught-Up confirmation.private voidClose serverSocket and selector, if neededvoidvoid(package private) voidcreateSummonAngel(Legion legion) (package private) voiddidRecruit(AddCreatureAction event, CreatureType recruiter) private voidprivate voiddisconnectChannel(SocketChannel sc, SelectionKey key) Close the SocketChannel, cancel the selection key and unregister the SocketChannel from list of active SocketChannels.(package private) voidvoiddoBattleMove(int tag, BattleHex hex) voidvoiddoMove(Legion legion, MasterHex hex, EntrySide entrySide, boolean teleport, CreatureType teleportingLord) voidvoidvoidvoidvoidvoidvoiddoNotConcede(Legion legion) voidvoiddoRecruit(Recruitment event) Handle mustering for legion.voiddoSetWhatToDoNext(WhatNextManager.WhatToDoNext whatToDoNext, boolean triggerQuitTimer) voiddoSplit(Legion parent, String childId, List<CreatureType> creaturesToSplit) Executes a split of certain creatures from a legion.voidHandles a summon eventvoidvoidvoidShutdown initiated by outside, i.e.voidvoidprivate PlayerServerSideprivate IClientgetClientHandlerByName(String name) Might be a player or a spectator (but not a stub)getGame()(package private) intgetIntOption(String optname) private PlayerThe player, for which data from socket is currently processed.getPlayerInfo(boolean treatDeadAsAlive) (package private) StringName of the player, for which data from socket is currently processed.private voidprivate voidbooleanHandle GUI-initiated requests: Save and Pauseprivate voidhandleOutsideChanges(boolean wasTimeout, boolean stillWaitingForClients) private intprivate void(package private) voidvoidinitiateSaveGame(String filename) (package private) voidprivate voidinitWaitingForPlayersToJoin(int count) Initialize the number of players we wait for to join (thread-safe)private booleanreturns true if the active player is the player owning the connection from which data is currently processedprivate booleanbooleanisClientGone(Player player) private StringValidates that it it OK to be "done with strikes" now for executing playerbooleanisKnownClient(InetAddress requester) booleanbooleanvoid(package private) voidvoidvoidvoid(package private) voidlogToStartLog(String message) voidmakeProposal(String proposalString) playerName makes a proposal.voidmulligan()voidnewGame()(package private) voidvoid(package private) voidoneRevealLegion(Legion legion, Player player, String reason) (package private) voidoneRevealLegion(Player player, Legion legion, List<CreatureType> creatureNames, String reason) Call from History during load game only(package private) voidoneSetOption(Player player, String optname, boolean value) (package private) voidoneSetOption(Player player, String optname, String value) (package private) voidothersTellOneHasNetworkTrouble(ClientHandler chInTrouble) (package private) voidothersTellOnesTroubleIsOver(ClientHandler chInTrouble) (package private) voidothersTellReconnectCompleted(ClientHandler chInTrouble) (package private) voidothersTellReconnectOngoing(ClientHandler chInTrouble) (package private) voidothersTellRemainingTime(ClientHandler chInTrouble, int secondsLeft) voidoverrideProcessingCH(Player player) private void(package private) voidPut the ClientHandler into the queue to be removed from selector on next possible opportunity(package private) void(package private) voidvoidvoidrequestSyncDelta(int lastReceivedMessageNr, int syncRequestNumber) voidvoidrun()voidvoidvoidvoidsetBoardVisibility(Player player, boolean val) voidvoidsetPauseState(boolean newState) (package private) voidsetPlayerName(Player player, String newName) Used to change a player name after color is assigned.(package private) voidvoidWhen the last player has *joined* (not just connected), he calls this here, and this will proceed with either loadGame2() or newGame2().voidvoidprivate voidvoidvoidstopGame()voidvoid(package private) voidtellProposal(Player player, Proposal proposal) Tell playerName about proposal.(package private) voidprivate voidtriggerWithdrawIfDoesNotReconnect(long intervalLen, int intervals) (package private) voidtwoNegotiate(Legion attacker, Legion defender) (package private) voidundidRecruit(Legion legion, CreatureType recruit, boolean reinforced) (package private) voidundidSplit(Legion splitoff, Legion survivor, boolean updateHistory, int turn) voidundoBattleMove(BattleHex hex) voidvoidundoRecruit(Legion legion) voidvoidunregisterSocketChannel(SocketChannel socketChannel) (package private) booleanvoidwaitOnSelector(int timeout, boolean stillWaitingForClients) voidvoidvoidWithdraw the player for which data was currently processed on socket (if it is a real one, and withdrawal still makes sense).voidwithdrawFromGame(String playerName) Withdraw a specific player of which we know only the name; e.g.private voidwithdrawFromGameIfRelevant(Exception gotException, boolean didDisconnect) Something with the connection of "processingCH" which makes perhaps Withdraw necessary.Methods inherited from class Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, threadId, toString, yield
-
Field Details
-
LOGGER
-
startLog
-
game
-
whatNextManager
-
recorder
-
clientStub
-
iClients
-
realClients
Only real ClientHandlers (excluding the stub) -
remoteClients
-
remoteLogHandlers
-
playerToClientMap
-
activeSocketChannelList
List of SocketChannels that are currently active -
forcedWithdraws
ClientHandlers to be withdrawn, together with some related (timing) data; selector thread will do it then when it's the right time for it -
waitingForClients
private int waitingForClientsNumber of player clients we're waiting for to *connect* -
waitingForPlayersToJoin
private int waitingForPlayersToJoinNumber of player clients we're waiting for to *join* - when last one has joined, then kick of newGame2() or loadGame2() -
wfptjSemaphor
Semaphor for synchronized access to waitingForPlayersToJoin -
sendPingRequests
private boolean sendPingRequestsWill be set to true after all clients are properly connected -
spectators
private int spectators -
port
private final int portServer socket port. -
striker
-
target
-
strikeNumber
private int strikeNumber -
rolls
-
serverSocket
-
selector
-
acceptKey
-
stopAcceptingFlag
private boolean stopAcceptingFlag -
guiRequestMutex
-
guiRequestSaveFlag
private boolean guiRequestSaveFlag -
guiRequestSaveFilename
-
inPauseState
private boolean inPauseState -
fileServerThread
-
serverRunning
private boolean serverRunning -
obsolete
private boolean obsolete -
shuttingDown
private boolean shuttingDown -
forceShutDown
private boolean forceShutDown -
initiateDisposal
private boolean initiateDisposal -
caughtUpAction
-
timeoutDuringStart
private final int timeoutDuringStart- See Also:
-
timeoutDuringGame
private final int timeoutDuringGame- See Also:
-
timeoutDuringShutdown
private final int timeoutDuringShutdown- See Also:
-
WEBGAMES_STARTUP_TIMEOUT_SECS
private static final int WEBGAMES_STARTUP_TIMEOUT_SECSHow long in public server games socket shall wait for Clients.- See Also:
-
PING_REQUEST_INTERVAL_SEC
private final int PING_REQUEST_INTERVAL_SEC- See Also:
-
lastPingRound
private long lastPingRoundHow many ms ago last ping round was done. -
startInititatedTime
private long startInititatedTimeWhen server started to listed for clients -
gameStartupTimeoutSecs
private int gameStartupTimeoutSecsTimeout how long server waits for clients before giving up; in normal/local games 0, meaning forever; in public server usage set to WEBGAMES_STARTUP_TIMEOUT_SECS -
disposeAllClientsDoneMutex
-
disposeAllClientsDone
private boolean disposeAllClientsDone -
byteBuffer
-
processingCH
ClientHandler processingCH -
overriddenCH
ClientHandler overriddenCH -
channelChanges
-
waitUntilOverMutex
-
waitingToCatchup
-
-
Constructor Details
-
Server
Server(GameServerSide game, WhatNextManager whatNextMgr, int port)
-
-
Method Details
-
run
-
initFileServer
void initFileServer() -
startFileServerIfNotRunning
void startFileServerIfNotRunning() -
isKnownClient
-
initSocketServer
void initSocketServer() -
waitForClients
boolean waitForClients() -
createClientHandlerStub
public void createClientHandlerStub() -
overrideProcessingCH
-
restoreProcessingCH
public void restoreProcessingCH() -
waitOnSelector
public void waitOnSelector(int timeout, boolean stillWaitingForClients) -
handleForcedWithdraws
private void handleForcedWithdraws() -
handleOutsideChanges
private void handleOutsideChanges(boolean wasTimeout, boolean stillWaitingForClients) -
handleSelectedKeys
- Throws:
IOExceptionClosedChannelException
-
handleChannelChanges
- Throws:
IOException
-
externShutdown
public void externShutdown()Shutdown initiated by outside, i.e. NOT by the Server thread itself. Right now, this is used by StartupProgressDialog's abort button. -
stopAccepting
- Throws:
IOException
-
closeSocketAndSelector
private void closeSocketAndSelector()Close serverSocket and selector, if needed -
handleReadFromChannel
- Throws:
IOException
-
processByteBuffer
private void processByteBuffer() -
withdrawFromGameIfRelevant
Something with the connection of "processingCH" which makes perhaps Withdraw necessary. If client seems to support reconnect, mark CH to be temp. disconnected, otherwise take care of the proper withdrawal.- Parameters:
gotException- An exception, if calling this was caused by an (IO)Exception, otherwise null, i.e. it was triggered by EOF.didDisconnect- whether an explicit dicsonnect request message had been received already from that client ( = no point to wait for reconnect attempt).
-
triggerWithdrawIfDoesNotReconnect
private void triggerWithdrawIfDoesNotReconnect(long intervalLen, int intervals) -
queueClientHandlerForChannelChanges
Put the ClientHandler into the queue to be removed from selector on next possible opportunity -
notifyThatGameFinished
public void notifyThatGameFinished() -
waitUntilGameFinishes
public void waitUntilGameFinishes() -
stopServerRunning
public void stopServerRunning() -
isServerRunning
public boolean isServerRunning() -
stopFileServer
public void stopFileServer() -
disconnectChannel
Close the SocketChannel, cancel the selection key and unregister the SocketChannel from list of active SocketChannels.- Parameters:
sc- SocketChannel of the clientkey- Key for that SocketChannel- Throws:
IOException
-
unregisterSocketChannel
-
setBoardVisibility
-
isClientGone
-
anyNonAiSocketsLeft
private boolean anyNonAiSocketsLeft() -
setObsolete
public void setObsolete() -
getPlayerName
String getPlayerName()Name of the player, for which data from socket is currently processed. -
getPlayer
The player, for which data from socket is currently processed. -
getClientHandlerByName
Might be a player or a spectator (but not a stub)- Parameters:
name- Name of the player/client/spectator for which ClientHandler is needed
-
isActivePlayer
private boolean isActivePlayer()returns true if the active player is the player owning the connection from which data is currently processed -
getActivePlayerSS
-
isBattleActivePlayer
private boolean isBattleActivePlayer() -
addClient
String addClient(ClientHandler client, String playerName, boolean remote, int clientVersion, String buildInfo, boolean spectator) Add a Client.- Parameters:
client-playerName-remote-clientVersion-spectator-- Returns:
- Reason why adding Client was refused, null if all is fine.
-
startGame
public void startGame()When the last player has *joined* (not just connected), he calls this here, and this will proceed with either loadGame2() or newGame2(). -
initWaitingForPlayersToJoin
private void initWaitingForPlayersToJoin(int count) Initialize the number of players we wait for to join (thread-safe)- Parameters:
count- the number of players that are expected to join
-
addRemoteClient
-
disposeAllClients
void disposeAllClients() -
loadFailed
public void loadFailed() -
cleanupStartlog
public void cleanupStartlog() -
doCleanup
public void doCleanup() -
allUpdatePlayerInfo
-
allUpdatePlayerInfo
-
allUpdateCreatureCount
-
allTellMovementRoll
void allTellMovementRoll(int roll) -
leaveCarryMode
public void leaveCarryMode()- Specified by:
leaveCarryModein interfaceIServer
-
doneWithBattleMoves
public void doneWithBattleMoves()- Specified by:
doneWithBattleMovesin interfaceIServer
-
doneWithStrikes
public void doneWithStrikes()- Specified by:
doneWithStrikesin interfaceIServer
-
isDoneWithStrikesOk
Validates that it it OK to be "done with strikes" now for executing player- Returns:
- reason why it's not OK; null if all is ok
-
getClient
-
allInitBoard
void allInitBoard() -
allTellReplay
void allTellReplay(boolean val, int maxTurn) -
allTellRedo
void allTellRedo(boolean val) -
allRequestConfirmCatchup
-
allTellAllLegionLocations
void allTellAllLegionLocations() -
allTellLegionLocation
-
allRemoveLegion
-
allTellPlayerElim
-
repeatTellOneHasNetworkTrouble
void repeatTellOneHasNetworkTrouble() -
othersTellOneHasNetworkTrouble
-
othersTellOnesTroubleIsOver
-
othersTellReconnectOngoing
-
othersTellRemainingTime
-
othersTellReconnectCompleted
-
appendToConnLogs
-
allRequestPingIfNeeded
void allRequestPingIfNeeded()IF last ping round is at least PING_REQUEST_INTERVAL_SEC seconds ago, then send a ping request to all clients (except those which are in trouble anyway). -
allTellGameOver
-
allSetupTurnState
void allSetupTurnState()Needed if loading game outside the split phase. -
allSetupSplit
void allSetupSplit() -
allSetupMove
void allSetupMove() -
allSetupFight
void allSetupFight() -
allSetupMuster
void allSetupMuster() -
kickPhase
void kickPhase() -
allSetupBattleSummon
void allSetupBattleSummon() -
allSetupBattleRecruit
void allSetupBattleRecruit() -
allSetupBattleMove
void allSetupBattleMove() -
allSetupBattleFight
void allSetupBattleFight() -
allPlaceNewChit
-
allRemoveDeadBattleChits
void allRemoveDeadBattleChits() -
allTellEngagementResults
-
nextEngagement
void nextEngagement() -
askAcquireAngel
Find out if the player wants to acquire an angel or archangel. -
acquireAngel
- Specified by:
acquireAngelin interfaceIServer
-
createSummonAngel
-
reinforce
-
doSummon
-
doRecruit
Handle mustering for legion. if recruiting with nothing, recruiterName is a non-null String that contains "null". -
didRecruit
-
undidRecruit
-
engage
-
allTellEngagement
-
askConcede
-
concede
-
doNotConcede
- Specified by:
doNotConcedein interfaceIServer
-
askFlee
-
flee
-
doNotFlee
-
twoNegotiate
-
makeProposal
playerName makes a proposal.- Specified by:
makeProposalin interfaceIServer
-
tellProposal
-
fight
-
doBattleMove
- Specified by:
doBattleMovein interfaceIServer
-
allTellBattleMove
-
strike
-
applyCarries
- Specified by:
applyCarriesin interfaceIServer
-
undoBattleMove
- Specified by:
undoBattleMovein interfaceIServer
-
allTellStrikeResults
void allTellStrikeResults(CreatureServerSide striker, CreatureServerSide target, int strikeNumber, List<String> rolls, int damage, int carryDamageLeft, Set<String> carryTargetDescriptions) -
allTellCarryResults
void allTellCarryResults(CreatureServerSide carryTarget, int carryDamageDone, int carryDamageLeft, Set<String> carryTargetDescriptions) -
allTellHexSlowResults
-
allTellHexDamageResults
-
askChooseStrikePenalty
Takes a Set of PenaltyOptions. -
assignStrikePenalty
- Specified by:
assignStrikePenaltyin interfaceIServer
-
allInitBattle
-
allCleanupBattle
void allCleanupBattle() -
mulligan
-
undoSplit
-
undidSplit
-
undoMove
-
allTellUndidMove
-
undoRecruit
- Specified by:
undoRecruitin interfaceIServer
-
doneWithSplits
public void doneWithSplits()- Specified by:
doneWithSplitsin interfaceIServer
-
doneWithMoves
public void doneWithMoves()- Specified by:
doneWithMovesin interfaceIServer
-
doneWithEngagements
public void doneWithEngagements()- Specified by:
doneWithEngagementsin interfaceIServer
-
doneWithRecruits
public void doneWithRecruits()- Specified by:
doneWithRecruitsin interfaceIServer
-
isWithdrawalIrrelevant
public boolean isWithdrawalIrrelevant() -
withdrawFromGame
public void withdrawFromGame()Withdraw the player for which data was currently processed on socket (if it is a real one, and withdrawal still makes sense).- Specified by:
withdrawFromGamein interfaceIServer
-
withdrawFromGame
Withdraw a specific player of which we know only the name; e.g. when one clientHandler when trying to write to another clientHandler encountered closed socket.- Parameters:
playerName- Name of the player to withdraw
-
sendDisconnect
public void sendDisconnect()- Specified by:
sendDisconnectin interfaceIServer
-
stopGame
-
triggerDispose
void triggerDispose() -
getPlayerInfo
-
doSplit
Description copied from interface:IServerExecutes a split of certain creatures from a legion. -
allTellDidSplit
-
doMove
-
allTellDidMove
void allTellDidMove(Legion legion, MasterHex startingHex, MasterHex hex, EntrySide entrySide, boolean teleport, CreatureType teleportingLord) -
allTellDidSummon
-
allTellAddCreature
-
allTellRemoveCreature
void allTellRemoveCreature(Legion legion, CreatureType creature, boolean updateHistory, String reason) -
allRevealLegion
-
allRevealEngagedLegion
pass to all clients the 'revealEngagedCreatures' message, then fire an 'revealEvent' to the history.- Parameters:
legion- the legion marker to reveal which is in a battleisAttacker- true if the 'legion' is the atackker in the battle, false for the defender.
-
allRevealLegion
Call from History during load game only -
oneRevealLegion
-
oneRevealLegion
Call from History during load game only -
allFullyUpdateLegionStatus
void allFullyUpdateLegionStatus() -
allFullyUpdateAllLegionContents
-
allRevealCreatures
-
newGame
-
loadGame
-
saveGame
-
saveGame
-
initiateSaveGame
-
setPauseState
public void setPauseState(boolean newState) -
handleGuiRequests
public boolean handleGuiRequests()Handle GUI-initiated requests: Save and Pause- Returns:
- true if it did something (saving the game)
-
checkServerConnection
public void checkServerConnection()- Specified by:
checkServerConnectionin interfaceIServer
-
clientWontConfirmCatchup
Check whether client is currently expected to send a caught-Up confirmation. If yes: it won't happen, so act accordingly. If no : even better so, so just do nothing.- Parameters:
reason- Reason why client won't send the confirmation (typically disconnected or something).
-
clientConfirmedCatchup
public void clientConfirmedCatchup()- Specified by:
clientConfirmedCatchupin interfaceIServer
-
actOnAllCaughtUp
private void actOnAllCaughtUp() -
setPlayerName
-
askPickColor
-
assignColor
- Specified by:
assignColorin interfaceIServer
-
askPickFirstMarker
-
assignFirstMarker
- Specified by:
assignFirstMarkerin interfaceIServer
-
allSetColor
void allSetColor()Hack to set color on load game. -
getIntOption
-
oneSetOption
-
oneSetOption
-
allSyncOption
-
allSyncOption
-
allSyncOption
-
allLog
DO NOT USE: package so that it can be called from Log4J Appender. -
logToStartLog
-
disableAutoCloseStartupLog
private void disableAutoCloseStartupLog() -
doSetWhatToDoNext
-
startupProgressAbort
public void startupProgressAbort() -
startupProgressQuit
public void startupProgressQuit() -
getGame
-
getRecorder
-
replyToRequestGameInfo
public void replyToRequestGameInfo() -
requestSyncDelta
public void requestSyncDelta(int lastReceivedMessageNr, int syncRequestNumber) -
joinGame
-
watchGame
-
enforcedDisconnectClient
-