Class LocalSessionBridge

Namespace
Game.Session.Bridges
Assembly
Game.dll
public class LocalSessionBridge : IServerBridge
Inheritance
LocalSessionBridge
Implements
Inherited Members

Constructors

LocalSessionBridge(GameServer, GameSession)

public LocalSessionBridge(GameServer server, GameSession session)

Parameters

server GameServer
session GameSession

Properties

AssetRegistry

Returns an asset registry for asset string bookkeeping. In singleplayer, it returns the server's own copy directly. In multiplayer, it constructs itself from the server's packets.

public AssetRegistry AssetRegistry { get; }

Property Value

AssetRegistry

ConnectionState

In singleplayer, returns either Disconnected or Connected. In multiplayer, it may be any of the GameSessionState values.

public GameSessionState ConnectionState { get; }

Property Value

GameSessionState

Methods

SendAssetInfoResponse(Span<int>, Span<int>)

public void SendAssetInfoResponse(Span<int> missingAssetIds, Span<int> assetHashes)

Parameters

missingAssetIds Span<int>
assetHashes Span<int>

SendAuthResponse(string?)

Maps to AuthResponse.

public void SendAuthResponse(string? password)

Parameters

password string

SendEventPayload(int, int, object[]?)

Not implemented.

Maps to EventPayload.

public void SendEventPayload(int entityId, int eventId, object[]? args)

Parameters

entityId int
eventId int
args object[]

SendInputPayload(in ClientCommands)

Sends a ClientCommands snapshot to the server. This is performed by clients multiple times per second.

In singleplayer, this directly copies snapshot into the server's client snapshot buffer. In multiplayer, it emits it as a packet.

public void SendInputPayload(in ClientCommands snapshot)

Parameters

snapshot ClientCommands

SendJoinRequest(IPAddress)

In singleplayer, immediately hooks onto the server. In multiplayer, sends packets in an attempt to connect.

Maps to JoinRequest.

public void SendJoinRequest(IPAddress address)

Parameters

address IPAddress

SendSpawnComplete()

Maps to SpawnComplete.

public void SendSpawnComplete()

SendSpawnRequest()

Maps to SpawnRequest.

public void SendSpawnRequest()

Update(float)

In singleplayer: does nothing really. In multiplayer: receives gamestate packets from the server.

public void Update(float delta)

Parameters

delta float