GameServer class Null safety

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
read-only
gameID GameCode
The game's id
read-only
gameType GameType
Gets the game's type from the config
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
mainServer IOServer
Main Server
final
playerNames IList<PlayerID>
Returns the list of players involved in the game
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
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 non-existent 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