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

Responsible for synchronizing entity physics over network More...

Inheritance diagram for Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup:
VRage.Network.IMyStateGroup VRage.Network.IMyNetObject VRage.Network.IMyEventOwner Sandbox.Game.Replication.StateGroups.MyCharacterPhysicsStateGroup Sandbox.Game.Replication.StateGroups.MyFloatingObjectPhysicsStateGroup

Classes

class  PrioritySettings
 to be cleaned up !!!!!!!!!!!!!!!!!! More...
 

Public Member Functions

 MyEntityPhysicsStateGroup (MyEntity entity, IMyReplicable ownerReplicable)
 
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...
 
virtual void Destroy ()
 Called when state group is being destroyed. 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)
 
virtual void ClientUpdate (MyTimeSpan clientTimestamp)
 Update method called on client. More...
 
virtual 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...
 
bool IsStillDirty (EndpointId forClient)
 

Static Public Member Functions

static bool ResponsibleForUpdate (MyEntity entity, EndpointId endpointId)
 

Public Attributes

const int NUM_DECIMAL_PRECISION = 3
 

Protected Member Functions

virtual bool IsMoving (MyEntity entity)
 
float GetBasicPhysicsPriority (MyClientInfo client)
 Takes into account: Static body (zero priority for static), ResponsibilityForUpdate by client (zero priority for not responsible), otherwise returns OwnerReplicable priority. More...
 
float GetMovementScale (PrioritySettings prioritySettings, out float updateOncePer)
 Gets priority scale and update rate based on prioritySettings. More...
 
virtual float GetGroupPriority (int frameCountWithoutSync, MyClientInfo client, PrioritySettings settings)
 

Protected Attributes

readonly History.IMySnapshotSync SnapshotSync
 
readonly PrioritySettings m_prioritySettings = new PrioritySettings()
 
uint m_lastMovementFrame = 0
 

Static Protected Attributes

static float PRECISION = 1 / (float)Math.Pow(10, NUM_DECIMAL_PRECISION)
 

Properties

MyEntity Entity [get]
 
IMyReplicable Owner [get]
 
virtual StateGroupEnum GroupType [get]
 
bool IsControlledLocally [get]
 
bool IsAccelerating [get]
 
- Properties inherited from VRage.Network.IMyStateGroup
StateGroupEnum GroupType [get]
 
IMyReplicable Owner [get]
 

Detailed Description

Responsible for synchronizing entity physics over network

Definition at line 20 of file MyEntityPhysicsStateGroup.cs.

Constructor & Destructor Documentation

Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.MyEntityPhysicsStateGroup ( MyEntity  entity,
IMyReplicable  ownerReplicable 
)
inline

Definition at line 70 of file MyEntityPhysicsStateGroup.cs.

Member Function Documentation

virtual void Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.ClientUpdate ( MyTimeSpan  clientTimestamp)
inlinevirtual
void Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.CreateClientData ( MyClientStateBase  forClient)
inline

Called on server new clients starts replicating this group.

Implements VRage.Network.IMyStateGroup.

Definition at line 80 of file MyEntityPhysicsStateGroup.cs.

virtual void Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.Destroy ( )
inlinevirtual

Called when state group is being destroyed.

Implements VRage.Network.IMyStateGroup.

Definition at line 88 of file MyEntityPhysicsStateGroup.cs.

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

Called on server when client stops replicating this group.

Implements VRage.Network.IMyStateGroup.

Definition at line 84 of file MyEntityPhysicsStateGroup.cs.

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

Implements VRage.Network.IMyStateGroup.

Definition at line 97 of file MyEntityPhysicsStateGroup.cs.

float Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.GetBasicPhysicsPriority ( MyClientInfo  client)
inlineprotected

Takes into account: Static body (zero priority for static), ResponsibilityForUpdate by client (zero priority for not responsible), otherwise returns OwnerReplicable priority.

Definition at line 185 of file MyEntityPhysicsStateGroup.cs.

virtual float Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.GetGroupPriority ( int  frameCountWithoutSync,
MyClientInfo  client,
PrioritySettings  settings 
)
inlineprotectedvirtual

Definition at line 232 of file MyEntityPhysicsStateGroup.cs.

float Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.GetMovementScale ( PrioritySettings  prioritySettings,
out float  updateOncePer 
)
inlineprotected

Gets priority scale and update rate based on prioritySettings.

Definition at line 197 of file MyEntityPhysicsStateGroup.cs.

virtual bool Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.IsMoving ( MyEntity  entity)
inlineprotectedvirtual
bool Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.IsStillDirty ( EndpointId  forClient)
inline

Implements VRage.Network.IMyStateGroup.

Definition at line 305 of file MyEntityPhysicsStateGroup.cs.

void Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.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 93 of file MyEntityPhysicsStateGroup.cs.

static bool Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.ResponsibleForUpdate ( MyEntity  entity,
EndpointId  endpointId 
)
inlinestatic

Definition at line 278 of file MyEntityPhysicsStateGroup.cs.

virtual void Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.Serialize ( BitStream  stream,
EndpointId  forClient,
MyTimeSpan  timestamp,
byte  packetId,
int  maxBitPosition 
)
inlinevirtual

(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.

Reimplemented in Sandbox.Game.Replication.StateGroups.MyCharacterPhysicsStateGroup.

Definition at line 115 of file MyEntityPhysicsStateGroup.cs.

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

Implements VRage.Network.IMyStateGroup.

Definition at line 102 of file MyEntityPhysicsStateGroup.cs.

Member Data Documentation

uint Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.m_lastMovementFrame = 0
protected

Definition at line 153 of file MyEntityPhysicsStateGroup.cs.

readonly PrioritySettings Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.m_prioritySettings = new PrioritySettings()
protected

Definition at line 152 of file MyEntityPhysicsStateGroup.cs.

const int Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.NUM_DECIMAL_PRECISION = 3

Definition at line 155 of file MyEntityPhysicsStateGroup.cs.

float Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.PRECISION = 1 / (float)Math.Pow(10, NUM_DECIMAL_PRECISION)
staticprotected

Definition at line 156 of file MyEntityPhysicsStateGroup.cs.

readonly History.IMySnapshotSync Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.SnapshotSync
protected

Definition at line 60 of file MyEntityPhysicsStateGroup.cs.

Property Documentation

MyEntity Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.Entity
get

Definition at line 22 of file MyEntityPhysicsStateGroup.cs.

virtual StateGroupEnum Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.GroupType
get

Definition at line 25 of file MyEntityPhysicsStateGroup.cs.

bool Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.IsAccelerating
getprotected

Definition at line 168 of file MyEntityPhysicsStateGroup.cs.

bool Sandbox.Game.Replication.StateGroups.MyEntityPhysicsStateGroup.IsControlledLocally
getprotected

Definition at line 63 of file MyEntityPhysicsStateGroup.cs.

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

Definition at line 23 of file MyEntityPhysicsStateGroup.cs.


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