TabletopNetworkSession
An object that coordinates network-related tasks in multiplayer games.
Declaration
class TabletopNetworkSession<Coordinator> where Coordinator : TabletopNetworkSessionCoordinatorOverview
To start a multiplayer game for a local player, use the start() method. TabletopKit syncs the current table state between all peers in the session, so update the table state before invoking this method.
After invoking the start() method, the local player becomes the arbiter who ensures that TabletopKit applies actions in order for all players. To switch the arbiter role between players, use the becomeArbiter() and followArbiter(_:) methods.
To join an existing game, use the join() method, and to pass incoming messages to the game, use the processIncomingMessage(_:from:) method.
To get all the people who join the session, not just the players, use the peers property.