#include <ReplicaManager3.h>
Public Member Functions | |
virtual Replica3 * | AllocReplica (RakNet::BitStream *allocationIdBitstream, ReplicaManager3 *replicaManager3)=0 |
Class factory to create a Replica3 instance, given a user-defined identifier. | |
virtual void | GetConstructedReplicas (DataStructures::Multilist< ML_STACK, Replica3 * > &objectsTheyDoHave) |
Get list of all replicas that are constructed for this connection. | |
bool | HasReplicaConstructed (RakNet::Replica3 *replica) |
virtual void | SerializeOnDownloadStarted (RakNet::BitStream *bitStream) |
virtual void | DeserializeOnDownloadStarted (RakNet::BitStream *bitStream) |
virtual void | SerializeOnDownloadComplete (RakNet::BitStream *bitStream) |
virtual void | DeserializeOnDownloadComplete (RakNet::BitStream *bitStream) |
virtual SendSerializeIfChangedResult | SendSerialize (RakNet::Replica3 *replica, bool indicesToSend[RM3_NUM_OUTPUT_BITSTREAM_CHANNELS], RakNet::BitStream serializationData[RM3_NUM_OUTPUT_BITSTREAM_CHANNELS], RakNetTime timestamp, PRO sendParameters, RakPeerInterface *rakPeer, unsigned char worldId) |
Sends over a serialization update for replica. NetworkID::GetNetworkID() is written automatically, serializationData is the object data. This is used internally - however, you can also call it manually to send a data update for a remote replica. . | |
SystemAddress | GetSystemAddress (void) const |
RakNetGUID | GetRakNetGUID (void) const |
virtual void | SendConstruction (DataStructures::Multilist< ML_STACK, LastSerializationResult *, Replica3 * > &newObjects, DataStructures::Multilist< ML_STACK, LastSerializationResult *, Replica3 * > &deletedObjects, PRO sendParameters, RakPeerInterface *rakPeer, unsigned char worldId) |
Destroy objects that no longer exist. Create objects that now exist. objectsThatExist is the entire list of objects that should exist. Given a list of objects, compare it against constructedReplicas. Objects in objectsThatExist, that are not in constructedReplicas, and that pass Replica3::QueryConstruction() be constructed. Objects not in objectsThatExist, that are in constructedReplicas, and that pass Replica3::SerializeDestruction() be destroyed. This can be more efficient than ReplicaManager3::SetAutoConstructByQuery. |
Important function: AllocReplica() - must be overridden to create an object given an identifier for that object, which you define for all objects in your game
virtual Replica3* RakNet::Connection_RM3::AllocReplica | ( | RakNet::BitStream * | allocationIdBitstream, | |
ReplicaManager3 * | replicaManager3 | |||
) | [pure virtual] |
Class factory to create a Replica3 instance, given a user-defined identifier.
Identifier is returned by Replica3::WriteAllocationID() for what type of class to create.
See Replica3::Dealloc for the corresponding destruction message.
Return 0 if unable to create the intended object.
[in] | allocationIdBitstream | user-defined bitstream uniquely identifying a game object type |
[in] | replicaManager3 | Instance of ReplicaManager3 that controls this connection |
virtual void RakNet::Connection_RM3::DeserializeOnDownloadComplete | ( | RakNet::BitStream * | bitStream | ) | [inline, virtual] |
Receives whatever was written in DeserializeOnDownloadComplete()
[in] | bitStream | Written in SerializeOnDownloadComplete() |
virtual void RakNet::Connection_RM3::DeserializeOnDownloadStarted | ( | RakNet::BitStream * | bitStream | ) | [inline, virtual] |
Receives whatever was written in SerializeOnDownloadStarted()
[in] | bitStream | Written in SerializeOnDownloadStarted() |
virtual void RakNet::Connection_RM3::GetConstructedReplicas | ( | DataStructures::Multilist< ML_STACK, Replica3 * > & | objectsTheyDoHave | ) | [virtual] |
Get list of all replicas that are constructed for this connection.
[out] | objectsTheyDoHave | Destination list. Returned in sorted ascending order, sorted on the value of the Replica3 pointer. |
RakNetGUID RakNet::Connection_RM3::GetRakNetGUID | ( | void | ) | const [inline] |
SystemAddress RakNet::Connection_RM3::GetSystemAddress | ( | void | ) | const [inline] |
bool RakNet::Connection_RM3::HasReplicaConstructed | ( | RakNet::Replica3 * | replica | ) |
Returns true if we think this remote connection has this replica constructed
[in] | replica3 | Which replica we are querying |
virtual void RakNet::Connection_RM3::SendConstruction | ( | DataStructures::Multilist< ML_STACK, LastSerializationResult *, Replica3 * > & | newObjects, | |
DataStructures::Multilist< ML_STACK, LastSerializationResult *, Replica3 * > & | deletedObjects, | |||
PRO | sendParameters, | |||
RakPeerInterface * | rakPeer, | |||
unsigned char | worldId | |||
) | [virtual] |
Destroy objects that no longer exist. Create objects that now exist. objectsThatExist is the entire list of objects that should exist. Given a list of objects, compare it against constructedReplicas. Objects in objectsThatExist, that are not in constructedReplicas, and that pass Replica3::QueryConstruction() be constructed. Objects not in objectsThatExist, that are in constructedReplicas, and that pass Replica3::SerializeDestruction() be destroyed. This can be more efficient than ReplicaManager3::SetAutoConstructByQuery.
Does NOT check QueryConstruction(). It is assumed that the objectsThatExist list itself determines construction or destruction.
[in] | objectsThatExist | Objects to check against |
[in] | replicaManager | ReplicaManager3 instance this connection is using |
virtual SendSerializeIfChangedResult RakNet::Connection_RM3::SendSerialize | ( | RakNet::Replica3 * | replica, | |
bool | indicesToSend[RM3_NUM_OUTPUT_BITSTREAM_CHANNELS], | |||
RakNet::BitStream | serializationData[RM3_NUM_OUTPUT_BITSTREAM_CHANNELS], | |||
RakNetTime | timestamp, | |||
PRO | sendParameters, | |||
RakPeerInterface * | rakPeer, | |||
unsigned char | worldId | |||
) | [virtual] |
Sends over a serialization update for replica.
NetworkID::GetNetworkID() is written automatically, serializationData is the object data.
This is used internally - however, you can also call it manually to send a data update for a remote replica.
.
[in] | replica | Which replica to serialize |
[in] | serializationData | Serialized object data |
[in] | timestamp | 0 means no timestamp. Otherwise message is prepended with ID_TIMESTAMP |
[in] | sendParameters | Parameters on how to send |
[in] | rakPeer | Instance of RakPeerInterface to send on |
[in] | worldId | Which world, see ReplicaManager3::SetWorldID() |
virtual void RakNet::Connection_RM3::SerializeOnDownloadComplete | ( | RakNet::BitStream * | bitStream | ) | [inline, virtual] |
When a new connection connects, after constructing and serialization all objects, SerializeOnDownloadComplete() is called
[out] | bitStream | Passed to DeserializeOnDownloadComplete() |
virtual void RakNet::Connection_RM3::SerializeOnDownloadStarted | ( | RakNet::BitStream * | bitStream | ) | [inline, virtual] |
When a new connection connects, before sending any objects, SerializeOnDownloadStarted() is called
[out] | bitStream | Passed to DeserializeOnDownloadStarted() |