RakNet  4.0
Classes | Typedefs | Enumerations
ReplicaManager3
Plugins

Third implementation of object replication. More...

Classes

class  RakNet::ReplicaManager3
 System to help automate game object construction, destruction, and serialization. More...
 
struct  RakNet::LastSerializationResult
 
struct  RakNet::SerializeParameters
 
class  RakNet::Connection_RM3
 Each remote system is represented by Connection_RM3. Used to allocate Replica3 and track which instances have been allocated. More...
 
class  RakNet::Replica3
 Base class for your replicated objects for the ReplicaManager3 system. More...
 

Typedefs

typedef uint8_t RakNet::WorldId
 

Enumerations

enum  RakNet::RM3ConstructionState {
  RakNet::RM3CS_SEND_CONSTRUCTION, RakNet::RM3CS_ALREADY_EXISTS_REMOTELY, RakNet::RM3CS_ALREADY_EXISTS_REMOTELY_DO_NOT_CONSTRUCT, RakNet::RM3CS_NEVER_CONSTRUCT,
  RakNet::RM3CS_NO_ACTION, RakNet::RM3CS_MAX
}
 Return codes for Connection_RM3::GetConstructionState() and Replica3::QueryConstruction() More...
 
enum  RakNet::RM3DestructionState { RakNet::RM3DS_SEND_DESTRUCTION, RakNet::RM3DS_DO_NOT_QUERY_DESTRUCTION, RakNet::RM3DS_NO_ACTION, RakNet::RM3DS_MAX }
 
enum  RakNet::RM3SerializationResult {
  RakNet::RM3SR_BROADCAST_IDENTICALLY, RakNet::RM3SR_BROADCAST_IDENTICALLY_FORCE_SERIALIZATION, RakNet::RM3SR_SERIALIZED_UNIQUELY, RakNet::RM3SR_SERIALIZED_ALWAYS,
  RakNet::RM3SR_SERIALIZED_ALWAYS_IDENTICALLY, RakNet::RM3SR_DO_NOT_SERIALIZE, RakNet::RM3SR_NEVER_SERIALIZE_FOR_THIS_CONNECTION, RakNet::RM3SR_MAX
}
 
enum  RakNet::RM3QuerySerializationResult { RakNet::RM3QSR_CALL_SERIALIZE, RakNet::RM3QSR_DO_NOT_CALL_SERIALIZE, RakNet::RM3QSR_NEVER_CALL_SERIALIZE, RakNet::RM3QSR_MAX }
 
enum  RakNet::Replica3P2PMode {
  RakNet::R3P2PM_SINGLE_OWNER, RakNet::R3P2PM_MULTI_OWNER_CURRENTLY_AUTHORITATIVE, RakNet::R3P2PM_MULTI_OWNER_NOT_CURRENTLY_AUTHORITATIVE, RakNet::R3P2PM_STATIC_OBJECT_CURRENTLY_AUTHORITATIVE,
  RakNet::R3P2PM_STATIC_OBJECT_NOT_CURRENTLY_AUTHORITATIVE
}
 

Detailed Description

Third implementation of object replication.

Typedef Documentation

typedef uint8_t RakNet::WorldId

Used for multiple worlds. World 0 is created automatically by default

Used for multiple worlds.

Enumeration Type Documentation

Used for Replica3::QueryConstruction_PeerToPeer() and Replica3::QuerySerialization_PeerToPeer() to describe how the object replicates between hosts

Enumerator:
R3P2PM_SINGLE_OWNER 

The Replica3 instance is constructed and serialized by one system only. Example: Your avatar. No other player serializes or can create your avatar.

R3P2PM_MULTI_OWNER_CURRENTLY_AUTHORITATIVE 

The Replica3 instance is constructed and/or serialized by different systems This system is currently in charge of construction and/or serialization Example: A pickup. When an avatar holds it, that avatar controls it. When it is on the ground, the host controls it.

R3P2PM_MULTI_OWNER_NOT_CURRENTLY_AUTHORITATIVE 

The Replica3 instance is constructed and/or serialized by different systems Another system is in charge of construction and/or serialization, but this system may be in charge at a later time Example: A pickup held by another player. That player sends creation of that object to new connections, and serializes it until it is dropped.

R3P2PM_STATIC_OBJECT_CURRENTLY_AUTHORITATIVE 

The Replica3 instance is a static object (already exists on the remote system). This system is currently in charge of construction and/or serialization

R3P2PM_STATIC_OBJECT_NOT_CURRENTLY_AUTHORITATIVE 

The Replica3 instance is a static object (already exists on the remote system). Another system is in charge of construction and/or serialization, but this system may be in charge at a later time

Return codes for Connection_RM3::GetConstructionState() and Replica3::QueryConstruction()

Indicates what state the object should be in for the remote system

Enumerator:
RM3CS_SEND_CONSTRUCTION 

This object should exist on the remote system. Send a construction message if necessary If the NetworkID is already in use, it will not do anything If it is not in use, it will create the object, and then call DeserializeConstruction

RM3CS_ALREADY_EXISTS_REMOTELY 

This object should exist on the remote system. The other system already has the object, and the object will never be deleted. This is true of objects that are loaded with the level, for example. Treat it as if it existed, without sending a construction message. Will call Serialize() and SerializeConstructionExisting() to the object on the remote system

RM3CS_ALREADY_EXISTS_REMOTELY_DO_NOT_CONSTRUCT 

Same as RM3CS_ALREADY_EXISTS_REMOTELY but does not call SerializeConstructionExisting()

RM3CS_NEVER_CONSTRUCT 

This object will never be sent to the target system This object will never be serialized from this system to the target system

RM3CS_NO_ACTION 

Don't do anything this tick. Will query again next tick.

RM3CS_MAX 

Max enum.

If this object already exists for this system, should it be removed?

Enumerator:
RM3DS_SEND_DESTRUCTION 

This object should not exist on the remote system. Send a destruction message if necessary.

RM3DS_DO_NOT_QUERY_DESTRUCTION 

This object will never be destroyed by a per-tick query. Don't call again.

RM3DS_NO_ACTION 

Don't do anything this tick. Will query again next tick.

RM3DS_MAX 

Max enum.

First pass at topology to see if an object should be serialized

Enumerator:
RM3QSR_CALL_SERIALIZE 

Call Serialize() to see if this object should be serializable for this connection.

RM3QSR_DO_NOT_CALL_SERIALIZE 

Do not call Serialize() this tick to see if this object should be serializable for this connection.

RM3QSR_NEVER_CALL_SERIALIZE 

Never call Serialize() for this object and connection. This system will not serialize this object for this topology.

RM3QSR_MAX 

Max enum.

Return codes when constructing an object

Enumerator:
RM3SR_BROADCAST_IDENTICALLY 

This object serializes identically no matter who we send to We also send it to every connection (broadcast). Efficient for memory, speed, and bandwidth but only if the object is always broadcast identically.

RM3SR_BROADCAST_IDENTICALLY_FORCE_SERIALIZATION 

Same as RM3SR_BROADCAST_IDENTICALLY, but assume the object needs to be serialized, do not check with a memcmp Assume the object changed, and serialize it Use this if you know exactly when your object needs to change. Can be faster than RM3SR_BROADCAST_IDENTICALLY. An example of this is if every member variable has an accessor, changing a member sets a flag, and you check that flag in Replica3::QuerySerialization() The opposite of this is RM3SR_DO_NOT_SERIALIZE, in case the object did not change

RM3SR_SERIALIZED_UNIQUELY 

Either this object serializes differently depending on who we send to or we send it to some systems and not others. Inefficient for memory and speed, but efficient for bandwidth However, if you don't know what to return, return this

RM3SR_SERIALIZED_ALWAYS 

Do not compare against last sent value. Just send even if the data is the same as the last tick If the data is always changing anyway, or you want to send unreliably, this is a good method of serialization Can send unique data per connection if desired. If same data is sent to all connections, use RM3SR_SERIALIZED_ALWAYS_IDENTICALLY for even better performance Efficient for memory and speed, but not necessarily bandwidth

RM3SR_SERIALIZED_ALWAYS_IDENTICALLY 
Deprecated:
, use RM3SR_BROADCAST_IDENTICALLY_FORCE_SERIALIZATION
RM3SR_DO_NOT_SERIALIZE 

Do not serialize this object this tick, for this connection. Will query again next autoserialize timer.

RM3SR_NEVER_SERIALIZE_FOR_THIS_CONNECTION 

Never serialize this object for this connection Useful for objects that are downloaded, and never change again Efficient

RM3SR_MAX 

Max enum.