SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
SLNet::Replica3Composite< parent_type > Class Template Reference

Use Replica3 through composition instead of inheritance by containing an instance of this templated class Calls to parent class for all functions Parent class must still define and functions though! More...

`#include <slikenet/ReplicaManager3.h>`

Inheritance diagram for SLNet::Replica3Composite< parent_type >:

## Public Member Functions

void | SetCompositeOwner (parent_type *p)
parent_type * | GetCompositeOwner (void) const
virtual void | WriteAllocationID (SLNet::Connection_RM3 *destinationConnection, SLNet::BitStream *allocationIdBitstream) const
| Write a unique identifer that can be read on a remote system to create an object of this same class.
virtual SLNet::RM3ConstructionState | QueryConstruction (SLNet::Connection_RM3 *destinationConnection, SLNet::ReplicaManager3 *replicaManager3)
| Ask if this object, which does not exist on destinationConnection should (now) be sent to that system.
virtual SLNet::RM3DestructionState | QueryDestruction (SLNet::Connection_RM3 *destinationConnection, SLNet::ReplicaManager3 *replicaManager3)
| Ask if this object, which does exist on destinationConnection should be removed from the remote system.
virtual bool | QueryRemoteConstruction (SLNet::Connection_RM3 *sourceConnection)
| We're about to call DeserializeConstruction() on this Replica3. If QueryRemoteConstruction() returns false, this object is deleted instead.
virtual bool | QueryRelayDestruction (SLNet::Connection_RM3 *sourceConnection) const

We got a message from a connection to destroy this replica Return true to automatically relay the destruction message to all our other connections For a client in client/server, it does not matter what this funtion returns For a server in client/server, this should normally return true For a peer in peer to peer, you can normally return false since the original destroying peer would have told all other peers about the destruction If a system gets a destruction command for an object that was already destroyed, the destruction message is ignored.

virtual void | SerializeConstruction (SLNet::BitStream *constructionBitstream, SLNet::Connection_RM3 *destinationConnection)
| Write data to be sent only when the object is constructed on a remote system.
virtual bool | DeserializeConstruction (SLNet::BitStream *constructionBitstream, SLNet::Connection_RM3 *sourceConnection)
| Read data written by Replica3::SerializeConstruction()
virtual void | SerializeConstructionExisting (SLNet::BitStream *constructionBitstream, SLNet::Connection_RM3 *destinationConnection)
virtual void | DeserializeConstructionExisting (SLNet::BitStream *constructionBitstream, SLNet::Connection_RM3 *sourceConnection)
virtual void | SerializeDestruction (SLNet::BitStream *destructionBitstream, SLNet::Connection_RM3 *destinationConnection)
| Write extra data to send with the object deletion event, if desired.
virtual bool | DeserializeDestruction (SLNet::BitStream *destructionBitstream, SLNet::Connection_RM3 *sourceConnection)
| Read data written by Replica3::SerializeDestruction()
virtual SLNet::RM3ActionOnPopConnection | QueryActionOnPopConnection (SLNet::Connection_RM3 *droppedConnection) const
| The system is asking what to do with this replica when the connection is dropped.
virtual void | OnPoppedConnection (SLNet::Connection_RM3 *droppedConnection)
| Notification called for each of our replicas when a connection is popped.
virtual void | DeallocReplica (SLNet::Connection_RM3 *sourceConnection)
| Override with {delete this;}.
virtual SLNet::RM3QuerySerializationResult | QuerySerialization (SLNet::Connection_RM3 *destinationConnection)
| Implement with QuerySerialization_ClientSerializable(), QuerySerialization_ServerSerializable(), or QuerySerialization_PeerToPeer()
virtual void | OnUserReplicaPreSerializeTick (void)
| Called for each replica owned by the user, once per Serialization tick, before Serialize() is called. If you want to do some kind of operation on the Replica objects that you own, just before Serialization(), then overload this function.
virtual SLNet::RM3SerializationResult | Serialize (SLNet::SerializeParameters *serializeParameters)
| Serialize our class to a bitstream.
virtual void | OnSerializeTransmission (SLNet::BitStream *bitStream, SLNet::Connection_RM3 *destinationConnection, SLNet::BitSize_t bitsPerChannel[SLNet::RM3_NUM_OUTPUT_BITSTREAM_CHANNELS], SLNet::Time curTime)
virtual void | Deserialize (SLNet::DeserializeParameters *deserializeParameters)
| Read what was written in Serialize()
virtual void | PostSerializeConstruction (SLNet::BitStream *constructionBitstream, SLNet::Connection_RM3 *destinationConnection)
| Called after SerializeConstruction completes for all objects in a given update tick. Writes to PostDeserializeConstruction(), which is called after all objects are created for a given Construction tick(). Override to send data to PostDeserializeConstruction(), such as the NetworkID of other objects to resolve pointers to.
virtual void | PostDeserializeConstruction (SLNet::BitStream *constructionBitstream, SLNet::Connection_RM3 *sourceConnection)
virtual void | PostSerializeConstructionExisting (SLNet::BitStream *constructionBitstream, SLNet::Connection_RM3 *destinationConnection)
| Same as PostSerializeConstruction(), but for objects that returned RM3CS_ALREADY_EXISTS_REMOTELY from QueryConstruction.
virtual void | PostDeserializeConstructionExisting (SLNet::BitStream *constructionBitstream, SLNet::Connection_RM3 *sourceConnection)
| Same as PostDeserializeConstruction(), but for objects that returned RM3CS_ALREADY_EXISTS_REMOTELY from QueryConstruction.
virtual void | PreDestruction (SLNet::Connection_RM3 *sourceConnection)
Public Member Functions inherited from SLNet::Replica3
| Replica3 ()
virtual | ~Replica3 ()
virtual void | OnSerializeTransmission (SLNet::BitStream *bitStream, SLNet::Connection_RM3 *destinationConnection, BitSize_t bitsPerChannel[RM3_NUM_OUTPUT_BITSTREAM_CHANNELS], SLNet::Time curTime)
| Called when the class is actually transmitted via Serialize()
virtual RM3ConstructionState | QueryConstruction_ClientConstruction (SLNet::Connection_RM3 *destinationConnection, bool isThisTheServer)
| Default call for QueryConstruction().
virtual bool | QueryRemoteConstruction_ClientConstruction (SLNet::Connection_RM3 *sourceConnection, bool isThisTheServer)
virtual RM3ConstructionState | QueryConstruction_ServerConstruction (SLNet::Connection_RM3 *destinationConnection, bool isThisTheServer)
| Default call for QueryConstruction().
virtual bool | QueryRemoteConstruction_ServerConstruction (SLNet::Connection_RM3 *sourceConnection, bool isThisTheServer)
| Default call for QueryRemoteConstruction(). Allow the server to create this object, but not the client.
virtual RM3ConstructionState | QueryConstruction_PeerToPeer (SLNet::Connection_RM3 *destinationConnection, Replica3P2PMode p2pMode=R3P2PM_SINGLE_OWNER)
| Default call for QueryConstruction().
virtual bool | QueryRemoteConstruction_PeerToPeer (SLNet::Connection_RM3 *sourceConnection)
| Default call for QueryRemoteConstruction().
virtual SLNet::RM3QuerySerializationResult | QuerySerialization_ClientSerializable (SLNet::Connection_RM3 *destinationConnection, bool isThisTheServer)
| Default call for QuerySerialization().
virtual SLNet::RM3QuerySerializationResult | QuerySerialization_ServerSerializable (SLNet::Connection_RM3 *destinationConnection, bool isThisTheServer)
| Default call for QuerySerialization().
virtual SLNet::RM3QuerySerializationResult | QuerySerialization_PeerToPeer (SLNet::Connection_RM3 *destinationConnection, Replica3P2PMode p2pMode=R3P2PM_SINGLE_OWNER)
| Default call for QuerySerialization().
virtual RM3ActionOnPopConnection | QueryActionOnPopConnection_Client (SLNet::Connection_RM3 *droppedConnection) const
| Default: If we are a client, and the connection is lost, delete the server's objects.
virtual RM3ActionOnPopConnection | QueryActionOnPopConnection_Server (SLNet::Connection_RM3 *droppedConnection) const
| Default: If we are a server, and the connection is lost, delete the client's objects and broadcast the destruction.
virtual RM3ActionOnPopConnection | QueryActionOnPopConnection_PeerToPeer (SLNet::Connection_RM3 *droppedConnection) const
| Default: If we are a peer, and the connection is lost, delete the peer's objects.
virtual void | BroadcastDestruction (void)
RakNetGUID | GetCreatingSystemGUID (void) const
bool | WasReferenced (void) const
Public Member Functions inherited from SLNet::NetworkIDObject
| NetworkIDObject ()
virtual | ~NetworkIDObject ()
virtual void | SetNetworkIDManager (NetworkIDManager *manager)
virtual NetworkIDManager * | GetNetworkIDManager (void) const
| Returns what was passed to SetNetworkIDManager.
virtual NetworkID | GetNetworkID (void)
virtual void | SetNetworkID (NetworkID id)
virtual void | SetParent (void *_parent)
virtual void * | GetParent (void) const

## Protected Attributes

parent_type * | r3CompositeOwner

## Additional Inherited Members

Public Attributes inherited from SLNet::Replica3
RakNetGUID | creatingSystemGUID
RakNetGUID | deletingSystemGUID
| GUID of the system that caused the item to send a deletion command over the network.
ReplicaManager3 * | replicaManager
LastSerializationResultBS | lastSentSerialization
bool | forceSendUntilNextUpdate
LastSerializationResult * | lsr
uint32_t | referenceIndex

## Detailed Description

### template<class parent_type>
class SLNet::Replica3Composite< parent_type >

Use Replica3 through composition instead of inheritance by containing an instance of this templated class Calls to parent class for all functions Parent class must still define and functions though!

Precondition
  Parent class must call SetCompositeOwner() on this object

Definition at line 1104 of file ReplicaManager3.h.

## Member Function Documentation

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::DeallocReplica | ( | SLNet::Connection_RM3 * | sourceConnection | ) |

inlinevirtual

Override with {delete this;}.

1. Got a remote message to delete this object which passed DeserializeDestruction(), OR
2. ReplicaManager3::SetAutoManageConnections() was called autoDestroy true (which is the default setting), and a remote system that owns this object disconnected) OR <>
   Override with {delete this;} to actually delete the object (and any other processing you wish).
   If you don't want to delete the object, just do nothing, however, the system will not know this. You may wish to call Dereference() if the object should no longer be networked, but remain in memory. You are responsible for deleting it yoruself later.
   destructionBitstream may be 0 if the object was deleted locally

Implements SLNet::Replica3.

Definition at line 1124 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::Deserialize | ( | SLNet::DeserializeParameters * | deserializeParameters | ) |

inlinevirtual

Read what was written in Serialize()

Reads the contents of the class from SerializationParamters::serializationBitstream.
Called whenever Serialize() is called with different data from the last send.

Parameters

  [in] | serializationBitstream | Bitstream passed to Serialize()
  [in] | timeStamp | 0 if unused, else contains the time the message originated on the remote system
  [in] | sourceConnection | Which system sent to us

Implements SLNet::Replica3.

Definition at line 1129 of file ReplicaManager3.h.

template<class parent_type >

virtual bool SLNet::Replica3Composite< parent_type >::DeserializeConstruction | ( | SLNet::BitStream * | constructionBitstream,
|  | SLNet::Connection_RM3 * | sourceConnection
| ) |  |

inlinevirtual

Read data written by Replica3::SerializeConstruction()

Reads whatever data was written to constructionBitstream in Replica3::SerializeConstruction()

Parameters

  [out] | constructionBitstream | Bitstream written to in Replica3::SerializeConstruction()
  [in] | sourceConnection | System that sent us this network message.

Returns
  true to accept construction of the object. false to reject, in which case the object will be deleted via Replica3::DeallocReplica()

Implements SLNet::Replica3.

Definition at line 1117 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::DeserializeConstructionExisting | ( | SLNet::BitStream * | constructionBitstream,
|  | SLNet::Connection_RM3 * | sourceConnection
| ) |  |

inlinevirtual

Same as DeserializeConstruction(), but for an object that already exists on the remote system. Used if you return RM3CS_ALREADY_EXISTS_REMOTELY from QueryConstruction

Reimplemented from SLNet::Replica3.

Definition at line 1119 of file ReplicaManager3.h.

template<class parent_type >

virtual bool SLNet::Replica3Composite< parent_type >::DeserializeDestruction | ( | SLNet::BitStream * | destructionBitstream,
|  | SLNet::Connection_RM3 * | sourceConnection
| ) |  |

inlinevirtual

Read data written by Replica3::SerializeDestruction()

Return true to delete the object. BroadcastDestruction() will be called automatically, followed by ReplicaManager3::Dereference.
Return false to not delete it. If you delete it at a later point, you are responsible for calling BroadcastDestruction() yourself.

Implements SLNet::Replica3.

Definition at line 1121 of file ReplicaManager3.h.

template<class parent_type >

parent_type* SLNet::Replica3Composite< parent_type >::GetCompositeOwner | ( | void |  | ) | const

inline

Definition at line 1110 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::OnPoppedConnection | ( | SLNet::Connection_RM3 * | droppedConnection | ) |

inlinevirtual

Notification called for each of our replicas when a connection is popped.

Reimplemented from SLNet::Replica3.

Definition at line 1123 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::OnSerializeTransmission | ( | SLNet::BitStream * | bitStream,
|  | SLNet::Connection_RM3 * | destinationConnection,
|  | SLNet::BitSize_t | bitsPerChannel[SLNet::RM3_NUM_OUTPUT_BITSTREAM_CHANNELS],
|  | SLNet::Time | curTime
| ) |  |

inlinevirtual

Definition at line 1128 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::OnUserReplicaPreSerializeTick | ( | void |  | ) |

inlinevirtual

Called for each replica owned by the user, once per Serialization tick, before Serialize() is called. If you want to do some kind of operation on the Replica objects that you own, just before Serialization(), then overload this function.

Reimplemented from SLNet::Replica3.

Definition at line 1126 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::PostDeserializeConstruction | ( | SLNet::BitStream * | constructionBitstream,
|  | SLNet::Connection_RM3 * | sourceConnection
| ) |  |

inlinevirtual

Called after DeserializeConstruction completes for all objects in a given update tick.
This is used to resolve dependency chains, where two objects would refer to each other in DeserializeConstruction, yet one had not been constructed yet In PostDeserializeConstruction(), you know that all objects have already been created, so can resolve NetworkIDs to pointers safely. You can also use it to trigger some sort of event when you know the object has completed deserialization.

Parameters

  [in] | constructionBitstream | BitStream written in PostSerializeConstruction()
  [in] | sourceConnection | System that sent us this network message.

Reimplemented from SLNet::Replica3.

Definition at line 1131 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::PostDeserializeConstructionExisting | ( | SLNet::BitStream * | constructionBitstream,
|  | SLNet::Connection_RM3 * | sourceConnection
| ) |  |

inlinevirtual

Same as PostDeserializeConstruction(), but for objects that returned RM3CS_ALREADY_EXISTS_REMOTELY from QueryConstruction.

Reimplemented from SLNet::Replica3.

Definition at line 1133 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::PostSerializeConstruction | ( | SLNet::BitStream * | constructionBitstream,
|  | SLNet::Connection_RM3 * | destinationConnection
| ) |  |

inlinevirtual

Called after SerializeConstruction completes for all objects in a given update tick.
Writes to PostDeserializeConstruction(), which is called after all objects are created for a given Construction tick(). Override to send data to PostDeserializeConstruction(), such as the NetworkID of other objects to resolve pointers to.

Reimplemented from SLNet::Replica3.

Definition at line 1130 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::PostSerializeConstructionExisting | ( | SLNet::BitStream * | constructionBitstream,
|  | SLNet::Connection_RM3 * | destinationConnection
| ) |  |

inlinevirtual

Same as PostSerializeConstruction(), but for objects that returned RM3CS_ALREADY_EXISTS_REMOTELY from QueryConstruction.

Reimplemented from SLNet::Replica3.

Definition at line 1132 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::PreDestruction | ( | SLNet::Connection_RM3 * | sourceConnection | ) |

inlinevirtual

Called after DeserializeDestruction completes for the object successfully, but obviously before the object is deleted.
Override to trigger some sort of event when you know the object has completed destruction.

Parameters

  [in] | sourceConnection | System that sent us this network message.

Reimplemented from SLNet::Replica3.

Definition at line 1134 of file ReplicaManager3.h.

template<class parent_type >

virtual SLNet::RM3ActionOnPopConnection SLNet::Replica3Composite< parent_type >::QueryActionOnPopConnection | ( | SLNet::Connection_RM3 * | droppedConnection | ) | const

inlinevirtual

The system is asking what to do with this replica when the connection is dropped.

Return QueryActionOnPopConnection_Client, QueryActionOnPopConnection_Server, or QueryActionOnPopConnection_PeerToPeer

Implements SLNet::Replica3.

Definition at line 1122 of file ReplicaManager3.h.

template<class parent_type >

virtual SLNet::RM3ConstructionState SLNet::Replica3Composite< parent_type >::QueryConstruction | ( | SLNet::Connection_RM3 * | destinationConnection,
|  | SLNet::ReplicaManager3 * | replicaManager3
| ) |  |

inlinevirtual

Ask if this object, which does not exist on destinationConnection should (now) be sent to that system.

If ReplicaManager3::QueryConstructionMode() returns QUERY_CONNECTION_FOR_REPLICA_LIST or QUERY_REPLICA_FOR_CONSTRUCTION_AND_DESTRUCTION (default), then QueyrConstruction() is called once per tick from ReplicaManager3::Update() to determine if an object should exist on a given system.
Based on the return value, a network message may be sent to the other system to create the object.
If QueryConstructionMode() is overriden to return QUERY_CONNECTION_FOR_REPLICA_LIST, this function is unused.

Note
  Defaults are provided: QueryConstruction_PeerToPeer(), QueryConstruction_ServerConstruction(), QueryConstruction_ClientConstruction(). Return one of these functions for a working default for the relevant topology.

Parameters

  [in] | destinationConnection | Which system we will send to
  [in] | replicaManager3 | Plugin instance for this Replica3

Returns
  What action to take

Implements SLNet::Replica3.

Definition at line 1112 of file ReplicaManager3.h.

template<class parent_type >

virtual SLNet::RM3DestructionState SLNet::Replica3Composite< parent_type >::QueryDestruction | ( | SLNet::Connection_RM3 * | destinationConnection,
|  | SLNet::ReplicaManager3 * | replicaManager3
| ) |  |

inlinevirtual

Ask if this object, which does exist on destinationConnection should be removed from the remote system.

If ReplicaManager3::QueryConstructionMode() returns QUERY_REPLICA_FOR_CONSTRUCTION_AND_DESTRUCTION (default), then QueryDestruction() is called once per tick from ReplicaManager3::Update() to determine if an object that exists on a remote system should be destroyed for a given system.
Based on the return value, a network message may be sent to the other system to destroy the object.
Note that you can also destroy objects with BroadcastDestruction(), so this function is not useful unless you plan to delete objects for only a particular connection.
If QueryConstructionMode() is overriden to return QUERY_CONNECTION_FOR_REPLICA_LIST, this function is unused.

Parameters

  [in] | destinationConnection | Which system we will send to
  [in] | replicaManager3 | Plugin instance for this Replica3

Returns
  What action to take. Only RM3CS_SEND_DESTRUCTION does anything at this time.

Reimplemented from SLNet::Replica3.

Definition at line 1113 of file ReplicaManager3.h.

template<class parent_type >

virtual bool SLNet::Replica3Composite< parent_type >::QueryRelayDestruction | ( | SLNet::Connection_RM3 * | sourceConnection | ) | const

inlinevirtual

We got a message from a connection to destroy this replica Return true to automatically relay the destruction message to all our other connections For a client in client/server, it does not matter what this funtion returns For a server in client/server, this should normally return true For a peer in peer to peer, you can normally return false since the original destroying peer would have told all other peers about the destruction If a system gets a destruction command for an object that was already destroyed, the destruction message is ignored.

Reimplemented from SLNet::Replica3.

Definition at line 1115 of file ReplicaManager3.h.

template<class parent_type >

virtual bool SLNet::Replica3Composite< parent_type >::QueryRemoteConstruction | ( | SLNet::Connection_RM3 * | sourceConnection | ) |

inlinevirtual

We're about to call DeserializeConstruction() on this Replica3. If QueryRemoteConstruction() returns false, this object is deleted instead.

By default, QueryRemoteConstruction_ServerConstruction() does not allow clients to create objects. The client will get Replica3::DeserializeConstructionRequestRejected().
If you want the client to be able to potentially create objects for client/server, override accordingly.
Other variants of QueryRemoteConstruction_* just return true.

Note
  Defaults are provided: QueryRemoteConstruction_PeerToPeer(), QueryRemoteConstruction_ServerConstruction(), QueryRemoteConstruction_ClientConstruction(). Return one of these functions for a working default for the relevant topology.

Parameters

  [in] | sourceConnection | Which system sent us the object creation request message.

Returns
  True to allow the object to pass onto DeserializeConstruction() (where it may also be rejected), false to immediately reject the remote construction request

Implements SLNet::Replica3.

Definition at line 1114 of file ReplicaManager3.h.

template<class parent_type >

virtual SLNet::RM3QuerySerializationResult SLNet::Replica3Composite< parent_type >::QuerySerialization | ( | SLNet::Connection_RM3 * | destinationConnection | ) |

inlinevirtual

Implement with QuerySerialization_ClientSerializable(), QuerySerialization_ServerSerializable(), or QuerySerialization_PeerToPeer()

QuerySerialization() is a first pass query to check if a given object should serializable to a given system. The intent is that the user implements with one of the defaults for client, server, or peer to peer.
Without this function, a careless implementation would serialize an object anytime it changed to all systems. This would give you feedback loops as the sender gets the same message back from the recipient it just sent to.
If more than one system can serialize the same object then you will need to override to return true, and control the serialization result from Replica3::Serialize(). Be careful not to send back the same data to the system that just sent to you!

Returns
  True to allow calling Replica3::Serialize() for this connection, false to not call.

Implements SLNet::Replica3.

Definition at line 1125 of file ReplicaManager3.h.

template<class parent_type >

virtual SLNet::RM3SerializationResult SLNet::Replica3Composite< parent_type >::Serialize | ( | SLNet::SerializeParameters * | serializeParameters | ) |

inlinevirtual

Serialize our class to a bitstream.

User should implement this function to write the contents of this class to SerializationParamters::serializationBitstream.
If data only needs to be written once, you can write it to SerializeConstruction() instead for efficiency.
Transmitted over the network if it changed from the last time we called Serialize().
Called every time the time interval to ReplicaManager3::SetAutoSerializeInterval() elapses and ReplicaManager3::Update is subsequently called.

Parameters

  in/out] | serializeParameters Parameters controlling the serialization, including destination bitstream to write to

Returns
  Whether to serialize, and if so, how to optimize the results

Implements SLNet::Replica3.

Definition at line 1127 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::SerializeConstruction | ( | SLNet::BitStream * | constructionBitstream,
|  | SLNet::Connection_RM3 * | destinationConnection
| ) |  |

inlinevirtual

Write data to be sent only when the object is constructed on a remote system.

SerializeConstruction is used to write out data that you need to create this object in the context of your game, such as health, score, name. Use it for data you only need to send when the object is created.
After SerializeConstruction() is called, Serialize() will be called immediately thereafter. However, they are sent in different messages, so Serialize() may arrive a later frame than SerializeConstruction() For that reason, the object should be valid after a call to DeserializeConstruction() for at least a short time.

Note
  The object's NetworkID and allocation id are handled by the system automatically, you do not need to write these values to constructionBitstream

Parameters

  [out] | constructionBitstream | Destination bitstream to write your data to
  [in] | destinationConnection | System that will receive this network message.

Implements SLNet::Replica3.

Definition at line 1116 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::SerializeConstructionExisting | ( | SLNet::BitStream * | constructionBitstream,
|  | SLNet::Connection_RM3 * | destinationConnection
| ) |  |

inlinevirtual

Same as SerializeConstruction(), but for an object that already exists on the remote system. Used if you return RM3CS_ALREADY_EXISTS_REMOTELY from QueryConstruction

Reimplemented from SLNet::Replica3.

Definition at line 1118 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::SerializeDestruction | ( | SLNet::BitStream * | destructionBitstream,
|  | SLNet::Connection_RM3 * | destinationConnection
| ) |  |

inlinevirtual

Write extra data to send with the object deletion event, if desired.

Replica3::SerializeDestruction() will be called to write any object destruction specific data you want to send with this event. destructionBitstream can be read in DeserializeDestruction()

Parameters

  [out] | destructionBitstream | Bitstream for you to write to
  [in] | destinationConnection | System that will receive this network message.

Implements SLNet::Replica3.

Definition at line 1120 of file ReplicaManager3.h.

template<class parent_type >

void SLNet::Replica3Composite< parent_type >::SetCompositeOwner | ( | parent_type * | p | ) |

inline

Definition at line 1109 of file ReplicaManager3.h.

template<class parent_type >

virtual void SLNet::Replica3Composite< parent_type >::WriteAllocationID | ( | SLNet::Connection_RM3 * | destinationConnection,
|  | SLNet::BitStream * | allocationIdBitstream
| ) |  | const

inlinevirtual

Write a unique identifer that can be read on a remote system to create an object of this same class.

The value written to allocationIdBitstream will be passed to Connection_RM3::AllocReplica().
Sample implementation:
{allocationIdBitstream->Write(SLNet::RakString("Soldier");}

Parameters

  [out] | allocationIdBitstream | Bitstream for the user to write to, to identify this class

Implements SLNet::Replica3.

Definition at line 1111 of file ReplicaManager3.h.

## Member Data Documentation

template<class parent_type >

parent_type* SLNet::Replica3Composite< parent_type >::r3CompositeOwner

protected

Definition at line 1107 of file ReplicaManager3.h.

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

- Source/include/slikenet/ReplicaManager3.h