Class ClientHandlerStub
java.lang.Object
net.sf.colossus.server.ClientHandlerStub
- All Implemented Interfaces:
IClient
- Direct Known Subclasses:
ClientHandler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCreature(Legion legion, CreatureType creature, String reason) voidappendToConnectionLog(String message) voidaskAcquireAngel(Legion legion, List<CreatureType> recruits) voidaskChooseStrikePenalty(List<String> choices) voidaskConcede(Legion ally, Legion enemy) voidvoidaskNegotiate(Legion attacker, Legion defender) voidaskPickColor(List<PlayerColor> colorsLeft) voidbooleanprotected booleanvoidprotected voidvoidvoidcreateSummonAngel(Legion legion) voiddidMove(Legion legion, MasterHex startingHex, MasterHex currentHex, EntrySide entrySide, boolean teleport, CreatureType teleportingLord, boolean splitLegionHasForcedMove) voiddidRecruit(Legion legion, CreatureType recruit, CreatureType recruiter, int numRecruiters) voiddidSplit(MasterHex hex, Legion parent, Legion child, int childHeight, List<CreatureType> splitoffs, int turn) voiddidSummon(Legion summoner, Legion donor, CreatureType summon) voidServer side disposes a client (and informs it about it first) To be used only for "disposeAllClients()", otherwise setIsGone reason is misleading.voiddoReinforce(Legion legion) protected voidenqueueToRedoQueue(int messageNr, String message) protected voidSelector reported that client became writable again (after a prior write attempt had not written all bytes).voidinitBattle(MasterHex hex, int battleTurnNumber, Player battleActivePlayer, BattlePhase battlePhase, Legion attacker, Legion defender) voidprotected booleanisStub()voidvoidvoidmessageFromServer(String message) voidvoidvoidvoidplaceNewChit(String imageName, boolean inverted, int tag, BattleHex hex) voidremoveCreature(Legion legion, CreatureType creature, String reason) voidvoidremoveLegion(Legion legion) voidrevealCreatures(Legion legion, List<CreatureType> creatures, String reason) voidrevealEngagedCreatures(Legion legion, List<CreatureType> creatures, boolean isAttacker, String reason) print the 'revealEngagagedCreature'-message, args: markerId, isAttacker, list of creature namesprotected voidsendToClient(String message) voidvoidsetBoardActive(boolean val) voidsetColor(PlayerColor color) voidvoidsetLegionStatus(Legion legion, boolean moved, boolean teleported, EntrySide entrySide, CreatureType lastRecruit) voidsetPlayerName(String playerName) voidsetupBattleFight(BattlePhase battlePhase, Player battleActivePlayer) voidsetupBattleMove(Player battleActivePlayer, int battleTurnNumber) voidsetupBattleRecruit(Player battleActivePlayer, int battleTurnNumber) voidsetupBattleSummon(Player battleActivePlayer, int battleTurnNumber) voidvoidvoidvoidsetupSplit(Player activePlayer, int turnNumber) voidsetupTurnState(Player activePlayer, int turnNumber) protected booleanvoidsyncOption(String optname, String value) voidtellBattleMove(int tag, BattleHex startingHex, BattleHex endingHex, boolean undo) voidtellEngagement(MasterHex hex, Legion attacker, Legion defender) voidtellEngagementResults(Legion winner, String method, int points, int turns) voidtellGameOver(String message, boolean disposeFollows) voidtellInitialGameInfo(String variantName, Collection<String> playerNames) voidtellLegionLocation(Legion legion, MasterHex hex) voidtellMovementRoll(int roll) voidtellPlayerElim(Player player, Player slayer) voidtellProposal(String proposalString) voidtellRedo(boolean val) voidtellReplay(boolean val, int maxTurn) voidtellSlowResults(int targetTag, int slowValue) voidtellStrikeResults(int strikerTag, int targetTag, int strikeNumber, List<String> rolls, int damage, boolean killed, boolean wasCarry, int carryDamageLeft, Set<String> carryTargetDescriptions) voidtellSyncCompleted(int syncRequestNumber) voidtellWhatsHappening(String message) voidundidMove(Legion legion, MasterHex formerHex, MasterHex currentHex, boolean splitLegionHasForcedMove) voidundidRecruit(Legion legion, CreatureType recruit) voidundidSplit(Legion splitoff, Legion survivor, int turn) voidupdateCreatureCount(CreatureType type, int count, int deadCount) voidupdateOnePlayersInfo(boolean redundant, String reason, String ShouldBeSeveralSeparateVariablesHerePerhaps) A new way to pass changed player info to clients.voidupdatePlayerInfo(List<String> infoStrings)
-
Field Details
-
LOGGER
-
sep
- See Also:
-
server
-
counter
protected static int counter -
isGone
protected boolean isGone -
playerName
-
signonName
-
messageCounter
protected int messageCounter -
isCommitPoint
protected boolean isCommitPoint -
redoQueue
-
previousInfoStringsString
-
alreadyHandled
private int alreadyHandled
-
-
Constructor Details
-
ClientHandlerStub
-
-
Method Details
-
isStub
protected boolean isStub() -
canHandlePingRequest
protected boolean canHandlePingRequest() -
canHandleAdvancedSync
public boolean canHandleAdvancedSync() -
supportsReconnect
protected boolean supportsReconnect() -
setIsGone
-
sendToClient
-
flushQueuedContent
protected void flushQueuedContent()Selector reported that client became writable again (after a prior write attempt had not written all bytes). Now start/try writing the message(s) which are still in the queue. -
enqueueToRedoQueue
-
commitPoint
protected void commitPoint() -
disposeClient
public void disposeClient()Server side disposes a client (and informs it about it first) To be used only for "disposeAllClients()", otherwise setIsGone reason is misleading.- Specified by:
disposeClientin interfaceIClient
-
tellEngagement
- Specified by:
tellEngagementin interfaceIClient
-
tellEngagementResults
- Specified by:
tellEngagementResultsin interfaceIClient
-
tellWhatsHappening
- Specified by:
tellWhatsHappeningin interfaceIClient
-
tellMovementRoll
public void tellMovementRoll(int roll) - Specified by:
tellMovementRollin interfaceIClient
-
syncOption
- Specified by:
syncOptionin interfaceIClient
-
updatePlayerInfo
- Specified by:
updatePlayerInfoin interfaceIClient
-
updateOnePlayersInfo
public void updateOnePlayersInfo(boolean redundant, String reason, String ShouldBeSeveralSeparateVariablesHerePerhaps) A new way to pass changed player info to clients. Shortened info (e.g. color, dead state, ...) not sent every time; Includes a reason why sent (mostly used internally on server side for debugging/development purposes), and a flag whether this info should be redundant; idea behind it: on the long run, clients should be able to update game/player info "autonomously" (same logic implemented on client as on server) instead of server doing it and synching to all clients. So this redundant is meant to be used as safety net to detect where that new approach might miss something.- Specified by:
updateOnePlayersInfoin interfaceIClient
-
setColor
-
updateCreatureCount
- Specified by:
updateCreatureCountin interfaceIClient
-
removeLegion
- Specified by:
removeLegionin interfaceIClient
-
setLegionStatus
public void setLegionStatus(Legion legion, boolean moved, boolean teleported, EntrySide entrySide, CreatureType lastRecruit) - Specified by:
setLegionStatusin interfaceIClient
-
addCreature
- Specified by:
addCreaturein interfaceIClient
-
removeCreature
- Specified by:
removeCreaturein interfaceIClient
-
revealCreatures
- Specified by:
revealCreaturesin interfaceIClient
-
revealEngagedCreatures
public void revealEngagedCreatures(Legion legion, List<CreatureType> creatures, boolean isAttacker, String reason) print the 'revealEngagagedCreature'-message, args: markerId, isAttacker, list of creature names- Specified by:
revealEngagedCreaturesin interfaceIClient- Parameters:
creatures- List of creatures in this legionisAttacker- true for attacker, false for defenderreason- why this was revealedmarkerId- legion marker name that is currently in battle
-
removeDeadBattleChits
public void removeDeadBattleChits()- Specified by:
removeDeadBattleChitsin interfaceIClient
-
placeNewChit
- Specified by:
placeNewChitin interfaceIClient
-
tellReplay
public void tellReplay(boolean val, int maxTurn) - Specified by:
tellReplayin interfaceIClient
-
tellRedo
-
initBoard
-
setPlayerName
- Specified by:
setPlayerNamein interfaceIClient
-
getSignonName
-
getClientName
-
getPlayerName
-
createSummonAngel
- Specified by:
createSummonAngelin interfaceIClient
-
askAcquireAngel
- Specified by:
askAcquireAngelin interfaceIClient
-
askChooseStrikePenalty
- Specified by:
askChooseStrikePenaltyin interfaceIClient
-
tellGameOver
- Specified by:
tellGameOverin interfaceIClient
-
tellPlayerElim
- Specified by:
tellPlayerElimin interfaceIClient
-
askConcede
- Specified by:
askConcedein interfaceIClient
-
askFlee
-
askNegotiate
- Specified by:
askNegotiatein interfaceIClient
-
tellProposal
- Specified by:
tellProposalin interfaceIClient
-
tellSlowResults
public void tellSlowResults(int targetTag, int slowValue) - Specified by:
tellSlowResultsin interfaceIClient
-
tellStrikeResults
-
initBattle
public void initBattle(MasterHex hex, int battleTurnNumber, Player battleActivePlayer, BattlePhase battlePhase, Legion attacker, Legion defender) - Specified by:
initBattlein interfaceIClient
-
cleanupBattle
public void cleanupBattle()- Specified by:
cleanupBattlein interfaceIClient
-
nextEngagement
public void nextEngagement()- Specified by:
nextEngagementin interfaceIClient
-
doReinforce
- Specified by:
doReinforcein interfaceIClient
-
didRecruit
public void didRecruit(Legion legion, CreatureType recruit, CreatureType recruiter, int numRecruiters) - Specified by:
didRecruitin interfaceIClient
-
undidRecruit
- Specified by:
undidRecruitin interfaceIClient
-
setupTurnState
- Specified by:
setupTurnStatein interfaceIClient
-
setupSplit
- Specified by:
setupSplitin interfaceIClient
-
setupMove
-
setupFight
public void setupFight()- Specified by:
setupFightin interfaceIClient
-
setupMuster
public void setupMuster()- Specified by:
setupMusterin interfaceIClient
-
kickPhase
-
setupBattleSummon
- Specified by:
setupBattleSummonin interfaceIClient
-
setupBattleRecruit
- Specified by:
setupBattleRecruitin interfaceIClient
-
setupBattleMove
- Specified by:
setupBattleMovein interfaceIClient
-
setupBattleFight
- Specified by:
setupBattleFightin interfaceIClient
-
tellLegionLocation
- Specified by:
tellLegionLocationin interfaceIClient
-
tellBattleMove
- Specified by:
tellBattleMovein interfaceIClient
-
didMove
-
undidMove
-
didSummon
-
undidSplit
- Specified by:
undidSplitin interfaceIClient
-
didSplit
-
askPickColor
- Specified by:
askPickColorin interfaceIClient
-
askPickFirstMarker
public void askPickFirstMarker()- Specified by:
askPickFirstMarkerin interfaceIClient
-
log
-
nak
-
setBoardActive
public void setBoardActive(boolean val) - Specified by:
setBoardActivein interfaceIClient
-
tellInitialGameInfo
-
confirmWhenCaughtUp
public void confirmWhenCaughtUp()- Specified by:
confirmWhenCaughtUpin interfaceIClient
-
serverConfirmsConnection
public void serverConfirmsConnection()- Specified by:
serverConfirmsConnectionin interfaceIClient
-
pingRequest
public void pingRequest()- Specified by:
pingRequestin interfaceIClient
-
messageFromServer
- Specified by:
messageFromServerin interfaceIClient
-
appendToConnectionLog
- Specified by:
appendToConnectionLogin interfaceIClient
-
tellSyncCompleted
public void tellSyncCompleted(int syncRequestNumber) - Specified by:
tellSyncCompletedin interfaceIClient
-