Class RollbackNetcode
- Namespace
- Backdash
- Assembly
- Backdash.dll
The session factory used to create new netcode sessions.
public static class RollbackNetcode
- Inheritance
-
RollbackNetcode
- Inherited Members
Methods
CreateReplaySession<TInput, TGameState>(int, IReadOnlyList<ConfirmedInputs<TInput>>, SessionServices<TInput, TGameState>?, SessionReplayControl?, bool)
Initializes new replay session.
public static IRollbackSession<TInput, TGameState> CreateReplaySession<TInput, TGameState>(int numberOfPlayers, IReadOnlyList<ConfirmedInputs<TInput>> inputs, SessionServices<TInput, TGameState>? services = null, SessionReplayControl? controls = null, bool useInputSeedForRandom = true) where TInput : unmanaged where TGameState : notnull, new()
Parameters
numberOfPlayers
intSession player count
inputs
IReadOnlyList<ConfirmedInputs<TInput>>Inputs to be replayed
services
SessionServices<TInput, TGameState>Session customizable dependencies
controls
SessionReplayControlreplay control
useInputSeedForRandom
bool
Returns
- IRollbackSession<TInput, TGameState>
Type Parameters
TInput
Game input type
TGameState
Game state type
CreateSession<TInput, TGameState>(int, RollbackOptions?, SessionServices<TInput, TGameState>?)
Initializes new multiplayer session.
public static IRollbackSession<TInput, TGameState> CreateSession<TInput, TGameState>(int port, RollbackOptions? options = null, SessionServices<TInput, TGameState>? services = null) where TInput : unmanaged where TGameState : notnull, new()
Parameters
port
intThe UdpSocket port
options
RollbackOptionsSession configuration
services
SessionServices<TInput, TGameState>Session customizable dependencies
Returns
- IRollbackSession<TInput, TGameState>
Type Parameters
TInput
Game input type
TGameState
Game state type
CreateSpectatorSession<TInput, TGameState>(int, IPEndPoint, int, RollbackOptions?, SessionServices<TInput, TGameState>?)
Initializes new spectator session.
public static IRollbackSession<TInput, TGameState> CreateSpectatorSession<TInput, TGameState>(int port, IPEndPoint host, int numberOfPlayers, RollbackOptions? options = null, SessionServices<TInput, TGameState>? services = null) where TInput : unmanaged where TGameState : notnull, new()
Parameters
port
intThe UdpSocket port
host
IPEndPointThe host IPEndPoint to be watched.
numberOfPlayers
intSession player count
options
RollbackOptionsSession configuration
services
SessionServices<TInput, TGameState>Session customizable dependencies
Returns
- IRollbackSession<TInput, TGameState>
Type Parameters
TInput
Game input type
TGameState
Game state type
CreateSyncTestSession<TInput, TGameState>(FrameSpan?, RollbackOptions?, SessionServices<TInput, TGameState>?, bool)
Initializes new sync test session.
public static IRollbackSession<TInput, TGameState> CreateSyncTestSession<TInput, TGameState>(FrameSpan? checkDistance = null, RollbackOptions? options = null, SessionServices<TInput, TGameState>? services = null, bool throwException = true) where TInput : unmanaged where TGameState : notnull, new()
Parameters
checkDistance
FrameSpan?Total forced rollback frames.
options
RollbackOptionsSession configuration
services
SessionServices<TInput, TGameState>Session customizable dependencies
throwException
boolIf true, throws on state de-synchronization.
Returns
- IRollbackSession<TInput, TGameState>
Type Parameters
TInput
Game input type
TGameState
Game state type
See Also
IRollbackSession<TInput>
IRollbackSession<TInput, TState>