Interface IServerBridge
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
ConnectionState
In singleplayer, returns either Disconnected or Connected. In multiplayer, it may be any of the GameSessionState values.
GameSessionState ConnectionState { get; }
Property Value
Methods
SendAssetInfoResponse(Span<int>, Span<int>)
Maps to AssetInfoResponse.
void SendAssetInfoResponse(Span<int> missingAssetIds, Span<int> assetHashes)
Parameters
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
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