#include <ReplicaManager3.h>
Public Member Functions | |
virtual Replica3 * | AllocReplica (RakNet::BitStream *allocationIdBitstream)=0 |
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. | |
virtual void | GetConstructedReplicas (DataStructures::Multilist< ML_ORDERED_LIST, LastSerializationResult *, Replica3 * > &objectsTheyDoHave) |
Get list of all replicas that are constructed for this connection. | |
bool | HasReplicaConstructed (RakNet::Replica3 *replica) |
virtual void | OnAutoserializeInterval (PRO defaultSendParameters, ReplicaManager3 *rm3) |
virtual void | SendSerialize (RakNet::Replica3 *replica, RakNet::BitStream *serializationData, RakNetTime timestamp, PRO sendParameters, RakPeerInterface *rakPeer, unsigned char worldId) |
SystemAddress | GetSystemAddress (void) const |
RakNetGUID | GetRakNetGUID (void) const |
virtual void | SetConstructionByList (DataStructures::Multilist< ML_STACK, Replica3 * > objectsThatExist, ReplicaManager3 *replicaManager) |
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. | |
bool | IsInitialDownload (void) const |
Before the first call to SendConstruction(), returns true. After, returns false. |
virtual Replica3* RakNet::Connection_RM3::AllocReplica | ( | RakNet::BitStream * | allocationIdBitstream | ) | [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.
[in] | allocationIdBitstream | user-defined bitstream uniquely identifying a game object type |
void Connection_RM3::GetConstructedReplicas | ( | DataStructures::Multilist< ML_ORDERED_LIST, LastSerializationResult *, 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 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 |
void Connection_RM3::OnAutoserializeInterval | ( | PRO | defaultSendParameters, | |
ReplicaManager3 * | rm3 | |||
) | [virtual] |
Called periodically when the autoserialize interval set by ReplicaManager3::SetAutoSerializeInterval() elapses Defaults to at least 30 milliseconds Override to take more complex actions when serializing objects, or call ReplicaManager3::SetAutoSerializeInterval(0) to disable this feature and serialize objects in your own way Default implementation is to call Connection_RM3::SendSerializeIfChanged() for each member of constructedReplicas
[in] | defaultSendParameters | Send parameters to use for serialization |
[in] | rm3 | Calling plugin instance |
void Connection_RM3::SendSerialize | ( | RakNet::Replica3 * | replica, | |
RakNet::BitStream * | serializationData, | |||
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() |
void Connection_RM3::SetConstructionByList | ( | DataStructures::Multilist< ML_STACK, Replica3 * > | objectsThatExist, | |
ReplicaManager3 * | replicaManager | |||
) | [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 |