Struct CommandSendSystem<TCommandDataSerializer, TCommandData>.SendJobData
Helper struct used by code-generated command job to serialize the ICommandData into the OutgoingCommandDataStreamBuffer for the client connection.
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
public struct CommandSendSystem<TCommandDataSerializer, TCommandData>.SendJobData
Fields
autoCommandTargetEntities
The list of all ghost entities with a AutoCommandTarget component.
Declaration
[ReadOnly]
public NativeList<Entity> autoCommandTargetEntities
Field Value
Type | Description |
---|---|
NativeList<Entity> |
autoCommandTargetFromEntity
Readonly accessor to retrieve the AutoCommandTarget from the target ghost entity.
Declaration
[ReadOnly]
public ComponentLookup<AutoCommandTarget> autoCommandTargetFromEntity
Field Value
Type | Description |
---|---|
ComponentLookup<AutoCommandTarget> |
commmandTargetType
The readonly CommandTarget type handle for accessing the chunk data.
Declaration
[ReadOnly]
public ComponentTypeHandle<CommandTarget> commmandTargetType
Field Value
Type | Description |
---|---|
ComponentTypeHandle<CommandTarget> |
compressionModel
The compression model used to delta encode the old inputs. The first input (the one for the current tick) is serialized as it is. The older ones, are serialized as delta in respect the first one to reduce the bandwidth.
Declaration
public StreamCompressionModel compressionModel
Field Value
Type | Description |
---|---|
StreamCompressionModel |
enablePacketLoggingType
EnablePacketLogging type handle, for packet dumping.
Declaration
public ComponentTypeHandle<EnablePacketLogging> enablePacketLoggingType
Field Value
Type | Description |
---|---|
ComponentTypeHandle<EnablePacketLogging> |
ghostFromEntity
Reaonly GhostInstance type handle for accessing the chunk data.
Declaration
[ReadOnly]
public ComponentLookup<GhostInstance> ghostFromEntity
Field Value
Type | Description |
---|---|
ComponentLookup<GhostInstance> |
ghostOwnerFromEntity
Readonly accessor to retrieve the GhostOwner from the target ghost entity.
Declaration
[ReadOnly]
public ComponentLookup<GhostOwner> ghostOwnerFromEntity
Field Value
Type | Description |
---|---|
ComponentLookup<GhostOwner> |
inputFromEntity
Accessor for retrieving the input buffer from the target entity.
Declaration
[ReadOnly]
public BufferLookup<TCommandData> inputFromEntity
Field Value
Type | Description |
---|---|
BufferLookup<TCommandData> |
inputTargetTick
The server tick the command should be executed on the server.
Declaration
public NetworkTick inputTargetTick
Field Value
Type | Description |
---|---|
NetworkTick |
numCommandsToSend
For how many ticks should we send input? Value corresponds to the last n ticks, starting at the current tick.
Declaration
public uint numCommandsToSend
Field Value
Type | Description |
---|---|
uint |
outgoingCommandBufferType
OutgoingCommandDataStreamBuffer buffer type handle for accessing the chunk data. This is the output of buffer for the job
Declaration
public BufferTypeHandle<OutgoingCommandDataStreamBuffer> outgoingCommandBufferType
Field Value
Type | Description |
---|---|
BufferTypeHandle<OutgoingCommandDataStreamBuffer> |
prevInputTargetTick
The last server tick for which we send this command
Declaration
public NetworkTick prevInputTargetTick
Field Value
Type | Description |
---|---|
NetworkTick |
stableHash
The stable type hash for the command type. Serialized and used on the server side to match and verify the correctness of the input data sent.
Declaration
public ulong stableHash
Field Value
Type | Description |
---|---|
ulong |
Methods
Execute(ArchetypeChunk, int)
Lookup all the ghost entities for which commands need to be serialized for the current tick and enqueue them into the OutgoingCommandDataStreamBuffer. Are considered as potential ghost targets:
- the entity referenced by the CommandTarget
- All ghosts owned by the player (see GhostOwner) that present an enabled AutoCommandTarget components.
Declaration
public void Execute(ArchetypeChunk chunk, int orderIndex)
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunk | chunk | The chunk that contains the connection entities |
int | orderIndex | unsed, the sorting index enequeing operation in the the entity command buffer |