Table of Contents

Interface IRollbackSession<TInput, TState>

Namespace
Backdash
Assembly
Backdash.dll

Context for a multiplayer game session.

public interface IRollbackSession<TInput, TState> : IRollbackSession<TInput>, IRollbackSessionInfo, IDisposable where TInput : unmanaged where TState : notnull

Type Parameters

TInput

Game input type

TState

Game state type

Inherited Members

Methods

AddPlayer(Player)

Add the player into current session. Usually an instance of LocalPlayer, RemotePlayer or Spectator

ResultCode AddPlayer(Player player)

Parameters

player Player

Returns

ResultCode

Ok if success.

AddPlayers(IReadOnlyList<Player>)

Add a list of into current session. Usually instances of LocalPlayer, RemotePlayer or Spectator

IReadOnlyList<ResultCode> AddPlayers(IReadOnlyList<Player> players)

Parameters

players IReadOnlyList<Player>

Returns

IReadOnlyList<ResultCode>

A equivalent ResultCode list.

SetHandler(IRollbackHandler<TState>)

Set the handler for the current session. The client must call this before Start(CancellationToken).

void SetHandler(IRollbackHandler<TState> handler)

Parameters

handler IRollbackHandler<TState>

Start(CancellationToken)

Starts the background work for the session (Socket receiver, input queue, peer synchronization, etc).

void Start(CancellationToken stoppingToken = default)

Parameters

stoppingToken CancellationToken

WaitToStop(CancellationToken)

Waits the session background work to finish.

Task WaitToStop(CancellationToken stoppingToken = default)

Parameters

stoppingToken CancellationToken

Returns

Task