GameServer class

Constructors

GameServer(Server _io, IOServer mainServer, Reader _read, GameCode _gameId, void _onGameOver(GameCode), {Duration timeout = const Duration(hours: 2), bool debug = true})

Properties

debug bool
flag for printing out debug info
final
gameConfig GameConfig
Gets GameConfig of this game
no setter
gameID GameCode
The game's id
no setter
gameType GameType
Gets the game's type from the config
no setter
hashCode int
The hash code for this object.
no setterinherited
mainServer IOServer
Main Server
final
playerNames IList<PlayerID>
Returns the list of players involved in the game
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration
When to stop a game after timeout long of inactivity
final

Methods

clientID(Socket client) PlayerID
gameInfo(PlayerID? id) GameInfo
getClientName(PlayerID id) String?
Gets the client's name corresponding to id
isClientAdmin(PlayerID? id) bool
Returns whether the client by id is the admin
killGame() → void
Dispose of all resources, and then notify the creator of the Game
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyKilled(Socket client) → void
Note: only notify users that the game was killed if the killing was manually done so that it doesn't kick clients out of the game at the end of the game
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited