Class GameServer

Namespace
Game.Server
Assembly
Game.dll
public class GameServer
Inheritance
GameServer
Inherited Members

Constructors

GameServer(int)

public GameServer(int maxPlayers)

Parameters

maxPlayers int

Properties

Connections

public List<ClientConnection> Connections { get; }

Property Value

List<ClientConnection>

GameSnapshotRate

How often (per second) to send game state packets to clients.

public int GameSnapshotRate { get; set; }

Property Value

int

GameSnapshotTime

public float GameSnapshotTime { get; }

Property Value

float

MaxPlayers

public int MaxPlayers { get; }

Property Value

int

ServerUpdateRate

How often to update serverside entities.

public int ServerUpdateRate { get; set; }

Property Value

int

ServerUpdateTime

public float ServerUpdateTime { get; }

Property Value

float

Methods

ConnectionModify(int, GameSessionState)

public void ConnectionModify(int clientId, GameSessionState newState)

Parameters

clientId int
newState GameSessionState

ConnectionStart(IPAddress, IClientBridge?)

public void ConnectionStart(IPAddress clientAddress, IClientBridge? clientBridge = null)

Parameters

clientAddress IPAddress
clientBridge IClientBridge

ConnectionTerminate(int, string)

public void ConnectionTerminate(int clientId, string reason = "Unknown error")

Parameters

clientId int
reason string

GetClientId(IPAddress)

public int GetClientId(IPAddress clientAddress)

Parameters

clientAddress IPAddress

Returns

int

ReceiveAssetInfoResponse(int, Span<int>, Span<int>)

public void ReceiveAssetInfoResponse(int clientId, Span<int> missingAssetIds, Span<int> assetHashes)

Parameters

clientId int
missingAssetIds Span<int>
assetHashes Span<int>

ReceiveAuthResponse(int, string?)

public void ReceiveAuthResponse(int clientId, string? password)

Parameters

clientId int
password string

ReceiveEventPayload(int, int, int, object[]?)

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

Parameters

clientId int
entityId int
eventId int
args object[]

ReceiveInputPayload(int, in ClientCommands)

public void ReceiveInputPayload(int clientId, in ClientCommands snapshot)

Parameters

clientId int
snapshot ClientCommands

ReceiveInvalidPacket(int)

A bad packet was detected.

public void ReceiveInvalidPacket(int clientId)

Parameters

clientId int

ReceiveJoinRequest(IPAddress)

public void ReceiveJoinRequest(IPAddress address)

Parameters

address IPAddress

ReceiveSpawnComplete(int)

public void ReceiveSpawnComplete(int clientId)

Parameters

clientId int

ReceiveSpawnRequest(int)

public void ReceiveSpawnRequest(int clientId)

Parameters

clientId int

Setup(ElegyMapDocument)

public bool Setup(ElegyMapDocument level)

Parameters

level ElegyMapDocument

Returns

bool

Shutdown()

public void Shutdown()

SpawnClientEntity(int)

public int SpawnClientEntity(int clientId)

Parameters

clientId int

Returns

int

Update(float)

public void Update(float delta)

Parameters

delta float