Class GameServer
public class GameServer
- Inheritance
-
GameServer
- Inherited Members
Constructors
GameServer(int)
public GameServer(int maxPlayers)
Parameters
maxPlayersint
Properties
Connections
public List<ClientConnection> Connections { get; }
Property Value
GameSnapshotRate
How often (per second) to send game state packets to clients.
public int GameSnapshotRate { get; set; }
Property Value
GameSnapshotTime
public float GameSnapshotTime { get; }
Property Value
MaxPlayers
public int MaxPlayers { get; }
Property Value
ServerUpdateRate
How often to update serverside entities.
public int ServerUpdateRate { get; set; }
Property Value
ServerUpdateTime
public float ServerUpdateTime { get; }
Property Value
Methods
ConnectionModify(int, GameSessionState)
public void ConnectionModify(int clientId, GameSessionState newState)
Parameters
clientIdintnewStateGameSessionState
ConnectionStart(IPAddress, IClientBridge?)
public void ConnectionStart(IPAddress clientAddress, IClientBridge? clientBridge = null)
Parameters
clientAddressIPAddressclientBridgeIClientBridge
ConnectionTerminate(int, string)
public void ConnectionTerminate(int clientId, string reason = "Unknown error")
Parameters
GetClientId(IPAddress)
public int GetClientId(IPAddress clientAddress)
Parameters
clientAddressIPAddress
Returns
ReceiveAssetInfoResponse(int, Span<int>, Span<int>)
See AssetInfoResponse.
public void ReceiveAssetInfoResponse(int clientId, Span<int> missingAssetIds, Span<int> assetHashes)
Parameters
ReceiveAuthResponse(int, string?)
See AuthResponse.
public void ReceiveAuthResponse(int clientId, string? password)
Parameters
ReceiveEventPayload(int, int, int, object[]?)
See EventPayload.
public void ReceiveEventPayload(int clientId, int entityId, int eventId, object[]? args)
Parameters
ReceiveInputPayload(int, in ClientCommands)
See InputPayload.
public void ReceiveInputPayload(int clientId, in ClientCommands snapshot)
Parameters
clientIdintsnapshotClientCommands
ReceiveInvalidPacket(int)
A bad packet was detected.
public void ReceiveInvalidPacket(int clientId)
Parameters
clientIdint
ReceiveJoinRequest(IPAddress)
See JoinRequest.
public void ReceiveJoinRequest(IPAddress address)
Parameters
addressIPAddress
ReceiveSpawnComplete(int)
See SpawnComplete.
public void ReceiveSpawnComplete(int clientId)
Parameters
clientIdint
ReceiveSpawnRequest(int)
See SpawnRequest.
public void ReceiveSpawnRequest(int clientId)
Parameters
clientIdint
Setup(ElegyMapDocument)
public bool Setup(ElegyMapDocument level)
Parameters
levelElegyMapDocument
Returns
Shutdown()
public void Shutdown()
SpawnClientEntity(int)
public int SpawnClientEntity(int clientId)
Parameters
clientIdint
Returns
Update(float)
public void Update(float delta)
Parameters
deltafloat