Rebel Fork Framework
Urho3D::SharedReplicationState Class Reference

Replication state shared between all clients. More...

#include <Urho3D/Replica/ServerReplicator.h>

Inheritance diagram for Urho3D::SharedReplicationState:
Urho3D::RefCounted

Classes

struct  DeltaBufferSpan
 A span in delta update buffer corresponding to the update data of the individual NetworkObject. More...

Public Member Functions

 SharedReplicationState (NetworkObjectRegistry *objectRegistry)
void PrepareForUpdate ()
 Initial preparation for network update.
void QueueDeltaUpdate (NetworkObject *networkObject)
 Request delta update to be prepared for specified object.
void CookDeltaUpdates (NetworkFrame currentFrame)
 Cook all requested delta updates.
const ea::unordered_set< NetworkId > & GetRecentlyRemovedObjects () const
const ea::vector< NetworkObject * > & GetSortedObjects () const
unsigned GetIndexUpperBound () const
const ea::unordered_set< NetworkObject * > & GetOwnedObjectsByConnection (ReplicatedPeer *connection) const
ea::optional< ConstByteSpan > GetReliableUpdateByIndex (unsigned index) const
ea::optional< ConstByteSpan > GetUnreliableUpdateByIndex (unsigned index) const
Public Member Functions inherited from Urho3D::RefCounted
 RefCounted ()
 Construct. Allocate the reference count structure and set an initial self weak reference.
virtual ~RefCounted ()
 Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
 RefCounted (const RefCounted &rhs)=delete
 Prevent copy construction.
RefCounted & operator= (const RefCounted &rhs)=delete
 Prevent assignment.
int AddRef () const
int ReleaseRef () const
int Refs () const
int WeakRefs () const
RefCount * RefCountPtr () const
 Return pointer to the reference count structure.
bool HasScriptObject () const
 Return true if script runtime object wrapping this native object exists.
bool IsScriptStrongRef () const
 Return true if script reference is strong.

Private Member Functions

void OnNetworkObjectAdded (NetworkObject *networkObject)
void OnNetworkObjectRemoved (NetworkObject *networkObject)
void ResetFrameBuffers ()
void InitializeNewObjects ()
ConstByteSpan GetSpanData (const DeltaBufferSpan &span) const

Private Attributes

const WeakPtr< NetworkObjectRegistry > objectRegistry_ {}
ea::unordered_set< NetworkId > recentlyRemovedObjects_
ea::unordered_set< NetworkId > recentlyAddedObjects_
ea::vector< NetworkObject * > sortedNetworkObjects_
ea::vector< bool > isDeltaUpdateQueued_
ea::vector< bool > needReliableDeltaUpdate_
ea::vector< bool > needUnreliableDeltaUpdate_
VectorBuffer deltaUpdateBuffer_
ea::vector< DeltaBufferSpan > reliableDeltaUpdateData_
ea::vector< DeltaBufferSpan > unreliableDeltaUpdateData_
ea::unordered_map< ReplicatedPeer *, ea::unordered_set< NetworkObject * > > ownedObjectsByConnection_

Detailed Description

Replication state shared between all clients.

Member Function Documentation

◆ GetRecentlyRemovedObjects()

const ea::unordered_set< NetworkId > & Urho3D::SharedReplicationState::GetRecentlyRemovedObjects ( ) const
inline

Return state of the current frame.


The documentation for this class was generated from the following files:
  • Urho3D/Replica/ServerReplicator.h
  • Urho3D/Replica/ServerReplicator.cpp