Class ClientEntityManager
- Namespace
- LiteEntitySystem
- Assembly
- LiteEntitySystem.dll
Client entity manager
public sealed class ClientEntityManager : EntityManager
- Inheritance
-
objectClientEntityManager
- Inherited Members
Constructors
ClientEntityManager(EntityTypesMap, AbstractNetPeer, byte, MaxHistorySize)
Constructor
public ClientEntityManager(EntityTypesMap typesMap, AbstractNetPeer netPeer, byte headerByte, MaxHistorySize maxHistorySize = MaxHistorySize.Size32)
Parameters
typesMap
EntityTypesMapEntityTypesMap with registered entity types
netPeer
AbstractNetPeerLocal AbstractPeer
headerByte
byteHeader byte that will be used for packets (to distinguish entity system packets)
maxHistorySize
MaxHistorySizeMaximum size of lag compensation history in ticks
Fields
InputBufferSize
Maximum stored inputs count
public const int InputBufferSize = 64
Field Value
PreferredBufferTimeHighest
Preferred input and incoming states buffer length in seconds lowest bound Buffer automatically decreases to Jitter time + PreferredBufferTimeHighest
public float PreferredBufferTimeHighest
Field Value
PreferredBufferTimeLowest
Preferred input and incoming states buffer length in seconds lowest bound Buffer automatically increases to Jitter time + PreferredBufferTimeLowest
public float PreferredBufferTimeLowest
Field Value
Properties
AverageJitter
Average jitter
public float AverageJitter { get; }
Property Value
CurrentRPCTick
Tick of currently executing rpc (check only in client RPC methods)
public ushort CurrentRPCTick { get; }
Property Value
IsExecutingRPC
Is server->client rpc currently executing
public bool IsExecutingRPC { get; }
Property Value
LastProcessedTick
Player tick processed by server
public ushort LastProcessedTick { get; }
Property Value
LastReceivedTick
Last received player tick by server
public ushort LastReceivedTick { get; }
Property Value
LerpBufferCount
States count in interpolation buffer
public int LerpBufferCount { get; }
Property Value
LerpBufferTimeLength
Total states time in interpolation buffer
public float LerpBufferTimeLength { get; }
Property Value
LocalPlayer
Our local player
public NetPlayer LocalPlayer { get; }
Property Value
NetPeer
Client network peer
public AbstractNetPeer NetPeer { get; }
Property Value
NetworkJitter
Network jitter in milliseconds
public float NetworkJitter { get; }
Property Value
PendingToRemoveEntites
Entities that waiting for remove
public int PendingToRemoveEntites { get; }
Property Value
RawServerTick
Current state server tick
public ushort RawServerTick { get; }
Property Value
RawTargetServerTick
Target state server tick
public ushort RawTargetServerTick { get; }
Property Value
ServerInputBuffer
Inputs count in server input buffer
public byte ServerInputBuffer { get; }
Property Value
ServerSendRate
Send rate of server
public ServerSendRate ServerSendRate { get; }
Property Value
ServerTick
Current interpolated server tick
public ushort ServerTick { get; }
Property Value
StateSize
Current state size in bytes
public int StateSize { get; }
Property Value
StoredCommands
Stored input commands count for prediction correction
public int StoredCommands { get; }
Property Value
Methods
Deserialize(ReadOnlySpan<byte>)
public DeserializeResult Deserialize(ReadOnlySpan<byte> inData)
Parameters
inData
ReadOnlySpan<byte>Incoming data including header byte
Returns
- DeserializeResult
Deserialization result
GetDiagnosticData(Dictionary<int, LESDiagnosticDataEntry>)
public void GetDiagnosticData(Dictionary<int, LESDiagnosticDataEntry> diagnosticDataDict)
Parameters
diagnosticDataDict
Dictionary<int, LESDiagnosticDataEntry>
GetPlayerController<T>()
Return client controller if exist
public T GetPlayerController<T>() where T : HumanControllerLogic
Returns
- T
controller if exist otherwise null
Type Parameters
T
controller type
OnLogicTick()
protected override void OnLogicTick()
Reset()
Remove all entities and reset all counters and timers
public override void Reset()
Update()
Update method, call this every frame
public override void Update()