Rebel Fork Framework
Urho3D::ReplicatedPeer Class Reference

Replication-oriented interface attached to transport connection. More...

#include <Urho3D/Network/ReplicatedPeer.h>

Classes

class  Listener
 

Public Member Functions

 ReplicatedPeer (NetworkConnection *connection, const ReplicatedPeerSettings &settings={})
 
unsigned GetObjectID () const
 Return unique peer ID.
 
NetworkConnectionGetConnection () const
 Return associated network connection.
 
void SetReplicationManager (ReplicationManager *replicationManager)
 
ReplicationManagerGetReplicationManager () const
 Return replication manager used for automatic message handling.
 
virtual ea::string ToString () const
 Return debug connection string for logging.
 
virtual bool IsClockSynchronized () const
 Return whether the clock is synchronized between client and server.
 
virtual unsigned RemoteToLocalTime (unsigned time) const
 Convert remote timestamp to local timestamp.
 
virtual unsigned LocalToRemoteTime (unsigned time) const
 Convert local timestamp to remote timestamp.
 
virtual unsigned GetLocalTime () const
 Return current local time.
 
virtual unsigned GetLocalTimeOfLatestRoundtrip () const
 Return local time of last successful ping-pong roundtrip.
 
virtual unsigned GetPing () const
 Return ping of the connection.
 
ClockSynchronizerGetClock ()
 
const ClockSynchronizerGetClock () const
 

Private Member Functions

ReplicatedPeerPtr AsSharedPtr ()
 
void OnConnected ()
 
void OnDisconnected ()
 
void OnMessageReceived (NetworkMessageId messageId, ConstByteSpan msg, bool &handled)
 Potentially consume a network message. Return true if consumed.
 
void SendReplicationMessages ()
 Send pending replication-related messages, if any.
 

Private Attributes

NetworkConnectionconnection_ = nullptr
 
ClockSynchronizer clock_
 
Listener listener_
 
IDFamily< ReplicatedPeeridFamily_ {}
 
WeakPtr< ReplicationManagerreplicationManager_
 

Detailed Description

Replication-oriented interface attached to transport connection.

Member Function Documentation

◆ SetReplicationManager()

void Urho3D::ReplicatedPeer::SetReplicationManager ( ReplicationManager replicationManager)

Set replication manager used for automatic message handling. This effectively enables replication-related message processing and sending. You may unset replication manager to suspend connection from participating in scene replication.


The documentation for this class was generated from the following files: