Class GameServer
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
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
clientId
intnewState
GameSessionState
ConnectionStart(IPAddress, IClientBridge?)
public void ConnectionStart(IPAddress clientAddress, IClientBridge? clientBridge = null)
Parameters
clientAddress
IPAddressclientBridge
IClientBridge
ConnectionTerminate(int, string)
public void ConnectionTerminate(int clientId, string reason = "Unknown error")
Parameters
GetClientId(IPAddress)
public int GetClientId(IPAddress clientAddress)
Parameters
clientAddress
IPAddress
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
clientId
intsnapshot
ClientCommands
ReceiveInvalidPacket(int)
A bad packet was detected.
public void ReceiveInvalidPacket(int clientId)
Parameters
clientId
int
ReceiveJoinRequest(IPAddress)
See JoinRequest.
public void ReceiveJoinRequest(IPAddress address)
Parameters
address
IPAddress
ReceiveSpawnComplete(int)
See SpawnComplete.
public void ReceiveSpawnComplete(int clientId)
Parameters
clientId
int
ReceiveSpawnRequest(int)
See SpawnRequest.
public void ReceiveSpawnRequest(int clientId)
Parameters
clientId
int
Setup(ElegyMapDocument)
public bool Setup(ElegyMapDocument level)
Parameters
level
ElegyMapDocument
Returns
Shutdown()
public void Shutdown()
SpawnClientEntity(int)
public int SpawnClientEntity(int clientId)
Parameters
clientId
int
Returns
Update(float)
public void Update(float delta)
Parameters
delta
float