Space Engineers
Classes | Public Member Functions | Public Attributes | Properties | List of all members
Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup Class Reference

Property sync state group. Synchronizes Sync members in SyncType. More...

Inheritance diagram for Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup:
VRage.Network.IMyStateGroup VRage.Network.IMyNetObject VRage.Network.IMyEventOwner

Public Member Functions

delegate float PriorityAdjustDelegate (int frameCountWithoutSync, MyClientStateBase clientState, float basePriority)
 
 MyPropertySyncStateGroup (IMyReplicable ownerReplicable, SyncType syncType)
 
void MarkDirty ()
 Marks dirty for all clients. More...
 
void CreateClientData (MyClientStateBase forClient)
 Called on server new clients starts replicating this group. More...
 
void DestroyClientData (MyClientStateBase forClient)
 Called on server when client stops replicating this group. More...
 
void ClientUpdate (MyTimeSpan clientTimestamp)
 Update method called on client. More...
 
void Destroy ()
 Called when state group is being destroyed. More...
 
virtual float GetGroupPriority (int frameCountWithoutSync, MyClientInfo client)
 Gets group priority, when overloaded it can be useful to scale base priority. More...
 
void Serialize (BitStream stream, EndpointId forClient, MyTimeSpan timestamp, byte packetId, int maxBitPosition)
 (De)serializes group state or it's diff for client. When writing, you can write beyond maxBitPosition, but message won't be sent and ACKs won't be received for it. ReplicationServer will detect, that state group written beyond packet size and revert it. When nothing written, ReplicationServer will detect that and state group won't receive ACK for that packet id. More...
 
void OnAck (MyClientStateBase forClient, byte packetId, bool delivered)
 Called for each packet id sent to client from this state group. When ACK received, called immediatelly. When several other packets received from client, but some were missing, called for each missing packet. More...
 
void ForceSend (MyClientStateBase clientData)
 
void TimestampReset (MyTimeSpan timestamp)
 
bool IsStillDirty (EndpointId forClient)
 

Public Attributes

Func< MyEventContext, bool > GlobalValidate = (context) => true
 
PriorityAdjustDelegate PriorityAdjust = (frames, state, priority) => priority
 

Properties

IMyReplicable Owner [get]
 
int PropertyCount [get]
 
StateGroupEnum GroupType [get]
 
- Properties inherited from VRage.Network.IMyStateGroup
StateGroupEnum GroupType [get]
 
IMyReplicable Owner [get]
 

Detailed Description

Property sync state group. Synchronizes Sync members in SyncType.

Definition at line 19 of file MyPropertySyncStateGroup.cs.

Constructor & Destructor Documentation

Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.MyPropertySyncStateGroup ( IMyReplicable  ownerReplicable,
SyncType  syncType 
)
inline

Definition at line 49 of file MyPropertySyncStateGroup.cs.

Member Function Documentation

void Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.ClientUpdate ( MyTimeSpan  clientTimestamp)
inline

Update method called on client.

Implements VRage.Network.IMyStateGroup.

Definition at line 104 of file MyPropertySyncStateGroup.cs.

void Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.CreateClientData ( MyClientStateBase  forClient)
inline

Called on server new clients starts replicating this group.

Implements VRage.Network.IMyStateGroup.

Definition at line 93 of file MyPropertySyncStateGroup.cs.

void Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.Destroy ( )
inline

Called when state group is being destroyed.

Implements VRage.Network.IMyStateGroup.

Definition at line 123 of file MyPropertySyncStateGroup.cs.

void Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.DestroyClientData ( MyClientStateBase  forClient)
inline

Called on server when client stops replicating this group.

Implements VRage.Network.IMyStateGroup.

Definition at line 99 of file MyPropertySyncStateGroup.cs.

void Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.ForceSend ( MyClientStateBase  clientData)
inline

Implements VRage.Network.IMyStateGroup.

Definition at line 231 of file MyPropertySyncStateGroup.cs.

virtual float Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.GetGroupPriority ( int  frameCountWithoutSync,
MyClientInfo  client 
)
inlinevirtual

Gets group priority, when overloaded it can be useful to scale base priority.

Implements VRage.Network.IMyStateGroup.

Definition at line 149 of file MyPropertySyncStateGroup.cs.

bool Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.IsStillDirty ( EndpointId  forClient)
inline

Implements VRage.Network.IMyStateGroup.

Definition at line 240 of file MyPropertySyncStateGroup.cs.

void Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.MarkDirty ( )
inline

Marks dirty for all clients.

Definition at line 83 of file MyPropertySyncStateGroup.cs.

void Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.OnAck ( MyClientStateBase  forClient,
byte  packetId,
bool  delivered 
)
inline

Called for each packet id sent to client from this state group. When ACK received, called immediatelly. When several other packets received from client, but some were missing, called for each missing packet.

Parameters
forClientThe client.
packetIdId of the delivered or lost packet.
deliveredTrue when packet was delivered, false when packet is considered lost.

Implements VRage.Network.IMyStateGroup.

Definition at line 213 of file MyPropertySyncStateGroup.cs.

delegate float Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.PriorityAdjustDelegate ( int  frameCountWithoutSync,
MyClientStateBase  clientState,
float  basePriority 
)
void Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.Serialize ( BitStream  stream,
EndpointId  forClient,
MyTimeSpan  timestamp,
byte  packetId,
int  maxBitPosition 
)
inline

(De)serializes group state or it's diff for client. When writing, you can write beyond maxBitPosition, but message won't be sent and ACKs won't be received for it. ReplicationServer will detect, that state group written beyond packet size and revert it. When nothing written, ReplicationServer will detect that and state group won't receive ACK for that packet id.

Parameters
streamStream to write to or read from.
forClientWhen writing the client which will receive the data. When reading, it's null.
packetIdId of packet in which the data will be sent or from which the data is received.
maxBitPositionMaximum position in bit stream where you can write data, it's inclusive.

Implements VRage.Network.IMyStateGroup.

Definition at line 181 of file MyPropertySyncStateGroup.cs.

void Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.TimestampReset ( MyTimeSpan  timestamp)
inline

Implements VRage.Network.IMyStateGroup.

Definition at line 236 of file MyPropertySyncStateGroup.cs.

Member Data Documentation

Func<MyEventContext, bool> Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.GlobalValidate = (context) => true

Definition at line 43 of file MyPropertySyncStateGroup.cs.

PriorityAdjustDelegate Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.PriorityAdjust = (frames, state, priority) => priority

Definition at line 44 of file MyPropertySyncStateGroup.cs.

Property Documentation

StateGroupEnum Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.GroupType
get

Definition at line 47 of file MyPropertySyncStateGroup.cs.

IMyReplicable Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.Owner
get

Definition at line 41 of file MyPropertySyncStateGroup.cs.

int Sandbox.Game.Replication.StateGroups.MyPropertySyncStateGroup.PropertyCount
get

Definition at line 46 of file MyPropertySyncStateGroup.cs.


The documentation for this class was generated from the following file: