Photon Fusion 2.0.4

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
SimulationMessage Struct Reference

Simulation Message More...

Inherits ILogDumpable.

Public Member Functions

void ILogDumpable. Dump (StringBuilder builder)
 
bool GetFlag (int flag)
 Get if a flag is set on this SimulationMessage More...
 
bool IsTargeted ()
 Signal if this SimulationMessage is Targeted More...
 
void ReferenceCountAdd ()
 Add a reference to this SimulationMessage More...
 
bool ReferenceCountSub ()
 Subtract a reference from this SimulationMessage More...
 
void SetDummy ()
 Set this SimulationMessage as Dummy More...
 
void SetNotTickAligned ()
 Set this SimulationMessage as Not Tick Aligned More...
 
void SetStatic ()
 Set this SimulationMessage as Static More...
 
void SetTarget (PlayerRef target)
 Set the player target of this SimulationMessage More...
 
void SetUnreliable ()
 Set this SimulationMessage as Unreliable More...
 
override string ToString ()
 Simulation Message ToString More...
 
string ToString (bool useBrackets)
 Simulation Message ToString More...
 

Static Public Member Functions

static SimulationMessageAllocate (Simulation sim, int capacityInBytes)
 Allocate a new SimulationMessage More...
 
static bool CanAllocateUserPayload (int capacityInBytes)
 Checks if a message with given size can be allocated. More...
 
static SimulationMessageClone (Simulation sim, SimulationMessage *message)
 Create a copy of a SimulationMessage More...
 
static byte * GetData (SimulationMessage *message)
 Get the byte pointer content of a SimulationMessage More...
 
static int ReadInt (SimulationMessage *message)
 Read a int from a SimulationMessage More...
 
static NetworkId ReadNetworkedObjectRef (SimulationMessage *message)
 Read a NetworkId from a SimulationMessage More...
 
static Vector3 ReadVector3 (SimulationMessage *message)
 Read a Vector3 from a SimulationMessage More...
 
static void WriteInt (SimulationMessage *message, int value)
 Write a int to a SimulationMessage More...
 
static void WriteNetworkedObjectRef (SimulationMessage *message, NetworkId value)
 Write a NetworkId to a SimulationMessage More...
 
static void WriteVector3 (SimulationMessage *message, Vector3 value)
 Write a Vector3 to a SimulationMessage More...
 

Public Attributes

int Capacity
 Capacity in Bits of this SimulationMessage More...
 
int Flags
 Flags More...
 
int Offset
 Current offset in Bits More...
 
int References
 Reference Count More...
 
PlayerRef Source
 Source Player of this SimulationMessage More...
 
PlayerRef Target
 Target Player of this SimulationMessage More...
 
int Tick
 Tick of this SimulationMessage More...
 

Static Public Attributes

const int FLAG_DUMMY = 1 << 8
 Flag for dummy messages. More...
 
const int FLAG_INTERNAL = 1 << 6
 Flag for internal messages. More...
 
const int FLAG_NOT_TICK_ALIGNED = 1 << 7
 Flag for messages that are not tick aligned. More...
 
const int FLAG_REMOTE = 1 << 1
 Flag for remote messages. More...
 
const int FLAG_STATIC = 1 << 2
 Flag for static messages. More...
 
const int FLAG_TARGET_PLAYER = 1 << 4
 Flag for targeted messages to a player. More...
 
const int FLAG_TARGET_SERVER = 1 << 5
 Flag for targeted messages to the server. More...
 
const int FLAG_UNRELIABLE = 1 << 3
 Flag for unreliable messages. More...
 
const int FLAG_USER_FLAGS_START = 1 << 16
 Flag for user flags. More...
 
const int FLAG_USER_MESSAGE = 1 << 0
 Flag for user messages. More...
 
const int FLAGS_RESERVED = 0xFFFF
 Flag for reserved flags. More...
 
const int FLAGS_RESERVED_BITS = 16
 Flag for reserved bits. More...
 
const int MAX_PAYLOAD_SIZE = 512
 Max user message size in bytes. More...
 
const int SIZE = 28
 SimulationMessage size in bytes. More...
 

Properties

bool IsUnreliable [get]
 Signal if this SimulationMessage is Unreliable More...
 

Detailed Description

Simulation Message

Member Function Documentation

◆ Allocate()

static SimulationMessage* Allocate ( Simulation  sim,
int  capacityInBytes 
)
static

Allocate a new SimulationMessage

Parameters
simSimulation to get the Memory from
capacityInBytesSize in bytes of the new SimulationMessage
Returns
Pointer to the new SimulationMessage

◆ CanAllocateUserPayload()

static bool CanAllocateUserPayload ( int  capacityInBytes)
static

Checks if a message with given size can be allocated.

◆ Clone()

static SimulationMessage* Clone ( Simulation  sim,
SimulationMessage message 
)
static

Create a copy of a SimulationMessage

Parameters
simSimulation to allocate from
messageSimulationMessage to copy
Returns
Copy of the SimulationMessage

◆ GetData()

static byte* GetData ( SimulationMessage message)
static

Get the byte pointer content of a SimulationMessage

Parameters
messageSimulationMessage to get the byte pointer of
Returns
Byte pointer of the SimulationMessage

◆ GetFlag()

bool GetFlag ( int  flag)

Get if a flag is set on this SimulationMessage

Parameters
flagFlag to check
Returns
True if the flag is set

◆ IsTargeted()

bool IsTargeted ( )

Signal if this SimulationMessage is Targeted

Returns
True if this SimulationMessage is Targeted

◆ ReadInt()

static int ReadInt ( SimulationMessage message)
static

Read a int from a SimulationMessage

Parameters
messageSimulationMessage to read from
Returns
int read

◆ ReadNetworkedObjectRef()

static NetworkId ReadNetworkedObjectRef ( SimulationMessage message)
static

Read a NetworkId from a SimulationMessage

Parameters
messageSimulationMessage to read from
Returns
NetworkId read

◆ ReadVector3()

static Vector3 ReadVector3 ( SimulationMessage message)
static

Read a Vector3 from a SimulationMessage

Parameters
messageSimulationMessage to read from
Returns
Vector3 read

◆ ReferenceCountAdd()

void ReferenceCountAdd ( )

Add a reference to this SimulationMessage

◆ ReferenceCountSub()

bool ReferenceCountSub ( )

Subtract a reference from this SimulationMessage

Returns
True if the reference count is now 0

◆ SetDummy()

void SetDummy ( )

Set this SimulationMessage as Dummy

◆ SetNotTickAligned()

void SetNotTickAligned ( )

Set this SimulationMessage as Not Tick Aligned

◆ SetStatic()

void SetStatic ( )

Set this SimulationMessage as Static

◆ SetTarget()

void SetTarget ( PlayerRef  target)

Set the player target of this SimulationMessage

Parameters
targetTarget Player

◆ SetUnreliable()

void SetUnreliable ( )

Set this SimulationMessage as Unreliable

◆ ToString() [1/2]

override string ToString ( )

Simulation Message ToString

◆ ToString() [2/2]

string ToString ( bool  useBrackets)

Simulation Message ToString

◆ WriteInt()

static void WriteInt ( SimulationMessage message,
int  value 
)
static

Write a int to a SimulationMessage

Parameters
messageSimulationMessage to write to
valueint to write

◆ WriteNetworkedObjectRef()

static void WriteNetworkedObjectRef ( SimulationMessage message,
NetworkId  value 
)
static

Write a NetworkId to a SimulationMessage

Parameters
messageSimulationMessage to write to
valueNetworkId to write

◆ WriteVector3()

static void WriteVector3 ( SimulationMessage message,
Vector3  value 
)
static

Write a Vector3 to a SimulationMessage

Parameters
messageSimulationMessage to write to
valueVector3 to write

Member Data Documentation

◆ Capacity

int Capacity

Capacity in Bits of this SimulationMessage

◆ FLAG_DUMMY

const int FLAG_DUMMY = 1 << 8
static

Flag for dummy messages.

◆ FLAG_INTERNAL

const int FLAG_INTERNAL = 1 << 6
static

Flag for internal messages.

◆ FLAG_NOT_TICK_ALIGNED

const int FLAG_NOT_TICK_ALIGNED = 1 << 7
static

Flag for messages that are not tick aligned.

◆ FLAG_REMOTE

const int FLAG_REMOTE = 1 << 1
static

Flag for remote messages.

◆ FLAG_STATIC

const int FLAG_STATIC = 1 << 2
static

Flag for static messages.

◆ FLAG_TARGET_PLAYER

const int FLAG_TARGET_PLAYER = 1 << 4
static

Flag for targeted messages to a player.

◆ FLAG_TARGET_SERVER

const int FLAG_TARGET_SERVER = 1 << 5
static

Flag for targeted messages to the server.

◆ FLAG_UNRELIABLE

const int FLAG_UNRELIABLE = 1 << 3
static

Flag for unreliable messages.

◆ FLAG_USER_FLAGS_START

const int FLAG_USER_FLAGS_START = 1 << 16
static

Flag for user flags.

◆ FLAG_USER_MESSAGE

const int FLAG_USER_MESSAGE = 1 << 0
static

Flag for user messages.

◆ Flags

int Flags

Flags

◆ FLAGS_RESERVED

const int FLAGS_RESERVED = 0xFFFF
static

Flag for reserved flags.

◆ FLAGS_RESERVED_BITS

const int FLAGS_RESERVED_BITS = 16
static

Flag for reserved bits.

◆ MAX_PAYLOAD_SIZE

const int MAX_PAYLOAD_SIZE = 512
static

Max user message size in bytes.

◆ Offset

int Offset

Current offset in Bits

◆ References

int References

Reference Count

◆ SIZE

const int SIZE = 28
static

SimulationMessage size in bytes.

◆ Source

PlayerRef Source

Source Player of this SimulationMessage

◆ Target

PlayerRef Target

Target Player of this SimulationMessage

◆ Tick

int Tick

Property Documentation

◆ IsUnreliable

bool IsUnreliable
get

Signal if this SimulationMessage is Unreliable