ReplicaNet and RNLobby
1
|
#include <DataBlock_NData.h>
Classes | |
struct | SessionBlock_NData |
Public Member Functions | |
RN_CLASS_MINIMAL_RTTI () | |
DataBlock_NData () | |
virtual | ~DataBlock_NData () |
virtual void | Poll (DataBlockReason *reason, const bool discardOlderIncluded=false, const unsigned int discardOrder=0) |
virtual void | ParseMessage (MessageHelper *message) |
void | RegisterInClassPointer (void *const data, const int size) |
void | SetDefaultData (const void *data) |
bool | IsAttached (void *data) |
void | SetEndianTest (const bool test=true) |
bool | GetEndianTest (void) const |
virtual void | OwnerChanged (const int sessionID) |
![]() | |
virtual int | GetThisClassType (void) |
DataBlock () | |
virtual | ~DataBlock () |
void | SetVariableName (const char *name=0) |
void | BindReplicaNet (ReplicaNet *current) |
void | BindReplicaObject (ReplicaObject *object) |
void | SetReliableFlag (bool reliable=false) |
bool | GetReliableFlag (void) const |
void | SetCertainFlag (bool certain=false) |
bool | GetCertainFlag (void) const |
void | SetOrderedFlag (bool ordered=false) |
bool | GetOrderedFlag (void) const |
void | SetDiscardOlder (const int windowBits=0) |
int | GetDiscardOlder (void) const |
void | SetAutomaticUpdatesFlag (bool automatic=true) |
bool | GetAutomaticUpdatesFlag (void) const |
virtual void | GiveDeltaHint (void *pdata, int dataLen) |
void | GiveDeltaHint (float delta) |
virtual void | ContinuityBreak (unsigned char breakTypes) |
void | SetForceReflectionUpdate (const bool enable=false) |
bool | GetForceReflectionUpdate (void) |
void | SetReflectionMasterUpdate (const bool enable=false) |
bool | GetReflectionMasterUpdate (void) |
virtual bool | IsAllocated (void) const |
void | SetIsAllocated (const bool isAllocated=true) |
void | SetUpdateDelayMinimum (const float delay=0.0f) |
float | GetUpdateDelayMinimum (void) const |
void | SetForceSendMaximumUpdates (const int updates=0) |
int | GetForceSendMaximumUpdates (void) const |
void | SetForceSendTimeDelay (const float delay=0.0f) |
float | GetForceSendTimeDelay (void) const |
void | SetBand (const unsigned int band=0) |
unsigned int | GetBand (void) const |
bool | ShouldDiscard (MessageHelper *message) |
bool | GetDiscardThisUpdate (void) const |
Static Public Member Functions | |
static DataBlock_NData * | Register (void *const data, const int size) |
Protected Member Functions | |
void | FreeSessionBlocks (void) |
![]() | |
void | SetID (int id) |
const char * | GetROName (ReplicaObject *from=0) |
void | EmitBaseDebugInfo (const char *name, const char *className, DataBlockReason *reason) |
void | EmitBaseDebugInfoUpdates (const char *name, const char *className, DataBlockReason *reason) |
std::string | GetVariableName (void) |
Protected Attributes | |
void * | mData |
int | mSize |
RegistryManagerMap< int, SessionBlock_NData > | mPerSessionData |
void * | mDefaultData |
bool | mDisableEndian |
![]() | |
short | mID |
ReplicaNet * | mBoundReplicaNet |
ReplicaObject * | mBoundObject |
bool | mReliable |
bool | mCertain |
bool | mOrdered |
bool | mAutomaticUpdates |
bool | mIsAllocated |
bool | mDebugOn |
char * | mDebugText |
float | mUpdateDelayMinimum |
int | mForceSendMaximumUpdates |
float | mForceSendTimeDelay |
char * | mVariableName |
unsigned int | mBand |
int | mDiscardOlder |
unsigned int | mDiscardOlderMidPoint |
unsigned int | mDiscardOlderEndPoint |
size_t | mDiscardOlderRealSize |
unsigned int | mLocalisedOrderingSent |
unsigned int | mLocalisedOrderingReceived |
bool | mDiscardThisUpdate |
bool | mForceReflectionUpdate |
bool | mReflectionMasterUpdate |
Additional Inherited Members | |
![]() | |
enum | ContinuityBreakTypes { kStop = 1, kSuddenChange = 2, kTeleport = 4 } |
This DataBlock derived class scans the registered area for changes and if needed creates a packet detailing those changes
This DataBlock does not do any lag compensation or prediction. It just informs each replica of a change when one is made. By default the DataBlock will preserve the endian format of the data. To disable the endian check, an example would be for string data, then SetEndianTest(false) or the ROL command DisableEndianTest();
DataBlock_NData | ( | ) |
The ctor performs some basic initialisation
|
virtual |
The dtor makes sure everything is tidy
|
virtual |
Given a data pointer this function identifies if this data block is attached to the pointer.
Reimplemented from DataBlock.
|
virtual |
Called by ReplicaNet to indicate a change in owner. If this virtual method is implemented by a derived class the parent method must also be called.
Reimplemented from DataBlock.
|
virtual |
This parses a message for the derived class of this data block. If this virtual method is implemented by a derived class the parent method should be called. Implementation note: The same amount of data added to the message during the Poll() must equal the length of data retrieved during this function. Care must be taken when implementing functionality such as GetDiscardOlder() to preserve the length of data. Processing for this function may occur during the thread context of ReplicaNet so processing time used by this function should be kept to a minimum to avoid performance issues.
message | The current message buffer that contains the packet data |
Reimplemented from DataBlock.
|
virtual |
A poll function that is called by ReplicaNet to check for updates to this particular data block. If this virtual method is implemented by a derived class the parent method should be called before a data packet is created. Processing for this function may occur during the thread context of ReplicaNet so processing time used by this function should be kept to a minimum to avoid performance issues.
reason | the reason code that is passed in to this class to enable a response to be calculated |
discardOlderIncluded | When true and using SetDiscardOlder() this gives a hint to the DataBlock that the derived class has filled in a valid value for discardOrder. The default value is false and the DataBlock will use a global discard order seqeunce. |
discardOrder | When using SetDiscardOlder() and discardOlderIncluded is true this must contain a valid order sequence number for the update. The sequence should be unique for each target sessionID for the update. Since the sequence number is local for each target sessionID the window size for SetDiscardOlder() can be smaller. |
Reimplemented from DataBlock.
|
static |
This registers the memory area with this data block type and returns a new pointer
data | the start of the memory to check |
size | the size of the data block |
|
inline |
This registers the memory area with this data block type. This is used when the memory is in datablocks that are allocated as part of a bigger class.
data | the start of the memory to check |
size | the size of the data block |
void SetDefaultData | ( | const void * | data | ) |
This allows a block of memory to be passed in that shows a default state of the data block. This default memory state is copied so it can be temporary. When a session joins or an object is created, the datablock states are serialised. By setting a default state the user can avoid the extra data being sent out for the datablock state.
data | the pointer to the memory. |