Interface IServerBridge

Namespace
Game.Session
Assembly
Game.dll

Handles communication between the server's world and the client's snapshot of the same.

public interface IServerBridge

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.

AssetRegistry AssetRegistry { get; }

Property Value

AssetRegistry

ConnectionState

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

GameSessionState ConnectionState { get; }

Property Value

GameSessionState

Methods

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

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

Parameters

missingAssetIds Span<int>
assetHashes Span<int>

SendAuthResponse(string?)

Maps to AuthResponse.

void SendAuthResponse(string? password)

Parameters

password string

SendEventPayload(int, int, object[]?)

Not implemented.

Maps to EventPayload.

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.

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.

void SendJoinRequest(IPAddress address)

Parameters

address IPAddress

SendSpawnComplete()

Maps to SpawnComplete.

void SendSpawnComplete()

SendSpawnRequest()

Maps to SpawnRequest.

void SendSpawnRequest()

Update(float)

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

void Update(float delta)

Parameters

delta float