Open 3D Engine Multiplayer Gem API Reference  22.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Member Functions | Static Public Member Functions | Friends | List of all members
Multiplayer::NetBindComponent Class Referencefinal

Component that provides net-binding to a networked entity. More...

#include <NetBindComponent.h>

Inherits Component.

Public Member Functions

 AZ_COMPONENT (NetBindComponent, "{DAA076B3-1A1C-4FEF-8583-1DF696971604}")
 
NetEntityRole GetNetEntityRole () const
 
bool IsNetEntityRoleAuthority () const
 
bool IsNetEntityRoleAutonomous () const
 
bool IsNetEntityRoleServer () const
 
bool IsNetEntityRoleClient () const
 
void SetAllowEntityMigration (EntityMigration value)
 
EntityMigration GetAllowEntityMigration () const
 
bool HasController () const
 
NetEntityId GetNetEntityId () const
 
const PrefabEntityIdGetPrefabEntityId () const
 
void SetPrefabEntityId (const PrefabEntityId &prefabEntityId)
 
const AZ::Data::AssetId & GetPrefabAssetId () const
 
void SetPrefabAssetId (const AZ::Data::AssetId &val)
 
ConstNetworkEntityHandle GetEntityHandle () const
 
NetworkEntityHandle GetEntityHandle ()
 
void SetOwningConnectionId (AzNetworking::ConnectionId connectionId)
 
AzNetworking::ConnectionId GetOwningConnectionId () const
 
void EnablePlayerHostAutonomy (bool enabled)
 
MultiplayerComponentInputVector AllocateComponentInputs ()
 
bool IsProcessingInput () const
 
bool IsReprocessingInput () const
 
void CreateInput (NetworkInput &networkInput, float deltaTime)
 
void ProcessInput (NetworkInput &networkInput, float deltaTime)
 
void ReprocessInput (NetworkInput &networkInput, float deltaTime)
 
bool HandleRpcMessage (AzNetworking::IConnection *invokingConnection, NetEntityRole remoteRole, NetworkEntityRpcMessage &message)
 
bool HandlePropertyChangeMessage (AzNetworking::ISerializer &serializer, bool notifyChanges=true)
 
RpcSendEvent & GetSendAuthorityToClientRpcEvent ()
 
RpcSendEvent & GetSendAuthorityToAutonomousRpcEvent ()
 
RpcSendEvent & GetSendServerToAuthorityRpcEvent ()
 
RpcSendEvent & GetSendAutonomousToAuthorityRpcEvent ()
 
const ReplicationRecordGetPredictableRecord () const
 
void MarkDirty ()
 
void NotifyLocalChanges ()
 
void NotifySyncRewindState ()
 
void NotifyServerMigration (const HostId &remoteHostId)
 
void NotifyPreRender (float deltaTime)
 
void NotifyCorrection ()
 
void AddEntityStopEventHandler (EntityStopEvent::Handler &eventHandler)
 
void AddEntityDirtiedEventHandler (EntityDirtiedEvent::Handler &eventHandler)
 
void AddEntitySyncRewindEventHandler (EntitySyncRewindEvent::Handler &eventHandler)
 
void AddEntityServerMigrationEventHandler (EntityServerMigrationEvent::Handler &eventHandler)
 
void AddEntityPreRenderEventHandler (EntityPreRenderEvent::Handler &eventHandler)
 
void AddEntityCorrectionEventHandler (EntityCorrectionEvent::Handler &handler)
 
bool SerializeEntityCorrection (AzNetworking::ISerializer &serializer)
 
bool SerializeStateDeltaMessage (ReplicationRecord &replicationRecord, AzNetworking::ISerializer &serializer)
 
void NotifyStateDeltaChanges (ReplicationRecord &replicationRecord)
 
void FillReplicationRecord (ReplicationRecord &replicationRecord) const
 
void FillTotalReplicationRecord (ReplicationRecord &replicationRecord) const
 
void Init () override
 
void Activate () override
 
void Deactivate () override
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 
static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 

Friends

class NetworkEntityManager
 
class EntityReplicationManager
 
class HierarchyTests
 
class HierarchyBenchmarkBase
 
class MultiplayerSystemTests
 
class NetworkEntityTests
 
class LocalPredictionPlayerInputTests
 

Detailed Description

Component that provides net-binding to a networked entity.

Member Function Documentation

◆ EnablePlayerHostAutonomy()

void Multiplayer::NetBindComponent::EnablePlayerHostAutonomy ( bool  enabled)

Allows a player host to autonomously control their player entity, even though the entity is in an authority role. Note: If this entity is already activated this will reactivate all of the multiplayer component controllers in order for them to reactivate under autonomous control.

◆ GetAllowEntityMigration()

EntityMigration Multiplayer::NetBindComponent::GetAllowEntityMigration ( ) const

Retrieves whether or not the netbound entity is allowed to migrate between hosts.

Returns
EntityMigration::Enabled if the entity is allowed to migrate, EntityMigration::Disabled otherwise

◆ Init()

void Multiplayer::NetBindComponent::Init ( )
override

AZ::Component overrides.

◆ IsNetEntityRoleAuthority()

bool Multiplayer::NetBindComponent::IsNetEntityRoleAuthority ( ) const

IsNetEntityRoleAuthority

Returns
true if this network entity is an authoritative proxy on a server (full authority); otherwise false.

◆ IsNetEntityRoleAutonomous()

bool Multiplayer::NetBindComponent::IsNetEntityRoleAutonomous ( ) const

IsNetEntityRoleAutonomous

Returns
true if this network entity is an autonomous proxy on a client (can execute local prediction) or if this network entity is an authoritative proxy on a server but has autonomous privileges (ie: a host who is also a player); otherwise false.

◆ IsNetEntityRoleClient()

bool Multiplayer::NetBindComponent::IsNetEntityRoleClient ( ) const

IsNetEntityRoleClient

Returns
true if this network entity is a simulated proxy on a client; otherwise false.

◆ IsNetEntityRoleServer()

bool Multiplayer::NetBindComponent::IsNetEntityRoleServer ( ) const

IsNetEntityRoleServer

Returns
true if this network entity is a simulated proxy on a server (ie: a different server may have authority for this entity, but the entity has been replicated on this server; otherwise false.

◆ IsProcessingInput()

bool Multiplayer::NetBindComponent::IsProcessingInput ( ) const

Return true if we're currently processing inputs.

Returns
true if we're within ProcessInput scope and writing to predictive state

◆ IsReprocessingInput()

bool Multiplayer::NetBindComponent::IsReprocessingInput ( ) const

Return true if we're currently replaying inputs after a correction. If this value returns true, effects, audio, and other cosmetic triggers should be suppressed

Returns
true if we're within correction scope and replaying inputs

◆ SetAllowEntityMigration()

void Multiplayer::NetBindComponent::SetAllowEntityMigration ( EntityMigration  value)

Sets whether or not a netbound entity is allowed to migrate between hosts. Use this feature carefully, as replication is spatially based. If migration is disabled chances are you want to mark the entity as always persistent as well. See INetworkEntityManager::MarkAlwaysRelevantToClients and INetworkEntityManager::MarkAlwaysRelevantToServers

Parameters
valuewhether to enable or disable host migrations for this entity

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