Open 3D Engine Multiplayer Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Multiplayer::NetworkTime Class Reference

Implementation of the INetworkTime interface. More...

#include <NetworkTime.h>

Inherits Multiplayer::INetworkTime.

Public Member Functions

bool IsTimeRewound () const override
 
HostFrameId GetHostFrameId () const override
 
HostFrameId GetUnalteredHostFrameId () const override
 
void IncrementHostFrameId () override
 Increments the hosts current frameId.
 
AZ::TimeMs GetHostTimeMs () const override
 
float GetHostBlendFactor () const override
 
AzNetworking::ConnectionId GetRewindingConnectionId () const override
 
void ForceSetTime (HostFrameId frameId, AZ::TimeMs timeMs) override
 
void AlterTime (HostFrameId frameId, AZ::TimeMs timeMs, float blendFactor, AzNetworking::ConnectionId rewindConnectionId) override
 
void SyncEntitiesToRewindState (const AZ::Aabb &rewindVolume) override
 
void ClearRewoundEntities () override
 Restores all rewound entities to the current application time.
 
- Public Member Functions inherited from Multiplayer::INetworkTime
 AZ_RTTI (INetworkTime, "{7D468063-255B-4FEE-86E1-6D750EEDD42A}")
 
virtual bool IsTimeRewound () const =0
 
virtual HostFrameId GetHostFrameId () const =0
 
virtual HostFrameId GetUnalteredHostFrameId () const =0
 
virtual void IncrementHostFrameId ()=0
 Increments the hosts current frameId.
 
virtual AZ::TimeMs GetHostTimeMs () const =0
 
virtual float GetHostBlendFactor () const =0
 
virtual AzNetworking::ConnectionId GetRewindingConnectionId () const =0
 
virtual void ForceSetTime (HostFrameId frameId, AZ::TimeMs timeMs)=0
 
virtual void AlterTime (HostFrameId frameId, AZ::TimeMs timeMs, float blendFactor, AzNetworking::ConnectionId rewindConnectionId)=0
 
virtual void SyncEntitiesToRewindState (const AZ::Aabb &rewindVolume)=0
 
virtual void ClearRewoundEntities ()=0
 Restores all rewound entities to the current application time.
 
 AZ_DISABLE_COPY_MOVE (INetworkTime)
 

Detailed Description

Implementation of the INetworkTime interface.

Member Function Documentation

◆ AlterTime()

void Multiplayer::NetworkTime::AlterTime ( HostFrameId  frameId,
AZ::TimeMs  timeMs,
float  blendFactor,
AzNetworking::ConnectionId  rewindConnectionId 
)
overridevirtual

Alters the current HostFrameId and binds that alteration to the provided ConnectionId.

Parameters
frameIdthe new HostFrameId to use
timeMsthe new HostTimeMs to use
blendFactorthe factor used to blend between values at the current and previous HostFrameId
rewindConnectionIdthe rewinding ConnectionId

Implements Multiplayer::INetworkTime.

◆ ClearRewoundEntities()

void Multiplayer::NetworkTime::ClearRewoundEntities ( )
overridevirtual

Restores all rewound entities to the current application time.

Implements Multiplayer::INetworkTime.

◆ ForceSetTime()

void Multiplayer::NetworkTime::ForceSetTime ( HostFrameId  frameId,
AZ::TimeMs  timeMs 
)
overridevirtual

Forcibly sets the current network time to the provided frameId and game time in milliseconds.

Parameters
frameIdthe new HostFrameId to use
timeMsthe new HostTimeMs to use

Implements Multiplayer::INetworkTime.

◆ GetHostBlendFactor()

float Multiplayer::NetworkTime::GetHostBlendFactor ( ) const
overridevirtual

Retrieves the hosts current blend factor (may be rewound on the server during backward reconciliation).

Returns
the hosts current blend factor

Implements Multiplayer::INetworkTime.

◆ GetHostFrameId()

HostFrameId Multiplayer::NetworkTime::GetHostFrameId ( ) const
overridevirtual

Retrieves the hosts current frameId (may be rewound on the server during backward reconciliation).

Returns
the hosts current frameId

Implements Multiplayer::INetworkTime.

◆ GetHostTimeMs()

AZ::TimeMs Multiplayer::NetworkTime::GetHostTimeMs ( ) const
overridevirtual

Retrieves the hosts current timeMs (may be rewound on the server during backward reconciliation).

Returns
the hosts current timeMs

Implements Multiplayer::INetworkTime.

◆ GetRewindingConnectionId()

AzNetworking::ConnectionId Multiplayer::NetworkTime::GetRewindingConnectionId ( ) const
overridevirtual

Get the controlling connection that may be currently altering global game time. Note this abstraction is required at a relatively high level to allow for 'don't rewind the shooter' semantics

Returns
the ConnectionId of the connection requesting the rewind operation

Implements Multiplayer::INetworkTime.

◆ GetUnalteredHostFrameId()

HostFrameId Multiplayer::NetworkTime::GetUnalteredHostFrameId ( ) const
overridevirtual

Retrieves the unaltered hosts current frameId.

Returns
the hosts current frameId, unaltered by any scoped time instance

Implements Multiplayer::INetworkTime.

◆ IncrementHostFrameId()

void Multiplayer::NetworkTime::IncrementHostFrameId ( )
overridevirtual

Increments the hosts current frameId.

Implements Multiplayer::INetworkTime.

◆ IsTimeRewound()

bool Multiplayer::NetworkTime::IsTimeRewound ( ) const
overridevirtual

INetworkTime overrides.

Implements Multiplayer::INetworkTime.

◆ SyncEntitiesToRewindState()

void Multiplayer::NetworkTime::SyncEntitiesToRewindState ( const AZ::Aabb &  rewindVolume)
overridevirtual

Syncs all entities contained within a volume to the current rewind state.

Parameters
rewindVolumethe volume to rewind entities within (needed for physics entities)

Implements Multiplayer::INetworkTime.


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