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::MultiplayerController Class Referenceabstract

A base class for all multiplayer component controllers responsible for running local prediction logic. More...

#include <MultiplayerController.h>

Public Types

enum class  InputPriorityOrder { First = 0 , Default = 1000 , SubEntities = 90000 , Last = 100000 }
 

Public Member Functions

 MultiplayerController (MultiplayerComponent &owner)
 
virtual void Activate (EntityIsMigrating entityIsMigrating)=0
 Activates the controller.
 
virtual void Deactivate (EntityIsMigrating entityIsMigrating)=0
 Deactivates the controller.
 
NetEntityId GetNetEntityId () const
 
bool IsNetEntityRoleAuthority () const
 
bool IsNetEntityRoleAutonomous () const
 
AZ::Entity * GetEntity () const
 
AZ::EntityId GetEntityId () const
 
ConstNetworkEntityHandle GetEntityHandle () const
 
NetworkEntityHandle GetEntityHandle ()
 

Protected Member Functions

bool IsProcessingInput () const
 Returns true if the owning entity is currently inside ProcessInput scope.
 
virtual InputPriorityOrder GetInputOrder () const =0
 Returns the input priority ordering for determining the order of ProcessInput or CreateInput functions.
 
virtual void ProcessInput (NetworkInput &networkInput, float deltaTime)=0
 
virtual void ProcessInputFromScript (NetworkInput &networkInput, float deltaTime)
 
virtual void CreateInput (NetworkInput &networkInput, float deltaTime)=0
 
virtual void CreateInputFromScript (NetworkInput &networkInput, float deltaTime)
 
template<typename ComponentType >
const ComponentType * FindComponent () const
 
template<typename ComponentType >
ComponentType * FindComponent ()
 
template<typename ControllerType >
ControllerType * FindController (const NetworkEntityHandle &entityHandle) const
 
MultiplayerControllerFindController (const AZ::Uuid &typeId, const NetworkEntityHandle &entityHandle) const
 
const NetBindComponentGetNetBindComponent () const
 
NetBindComponentGetNetBindComponent ()
 
const MultiplayerComponentGetOwner () const
 
MultiplayerComponentGetOwner ()
 

Friends

class NetBindComponent
 

Detailed Description

A base class for all multiplayer component controllers responsible for running local prediction logic.

Member Function Documentation

◆ CreateInput()

virtual void Multiplayer::MultiplayerController::CreateInput ( NetworkInput networkInput,
float  deltaTime 
)
protectedpure virtual

Only valid on a client, should never be invoked on the server.

Parameters
networkInputinput structure to process
deltaTimeamount of time to integrate the provided inputs over

◆ CreateInputFromScript()

virtual void Multiplayer::MultiplayerController::CreateInputFromScript ( NetworkInput networkInput,
float  deltaTime 
)
inlineprotectedvirtual

Similar to CreateInput, should never be invoked on the server. This only needs to be overridden in components which allow NetworkInput creation to be handled by scripts.

Parameters
networkInputinput structure to process
deltaTimeamount of time to integrate the provided inputs over

◆ GetEntity()

AZ::Entity * Multiplayer::MultiplayerController::GetEntity ( ) const

Returns the raw AZ::Entity pointer for the entity that owns this controller.

Returns
the raw AZ::Entity pointer for the entity that owns this controller

◆ GetEntityHandle() [1/2]

NetworkEntityHandle Multiplayer::MultiplayerController::GetEntityHandle ( )

Returns the network entity handle for the entity that owns this controller.

Returns
the network entity handle for the entity that owns this controller

◆ GetEntityHandle() [2/2]

ConstNetworkEntityHandle Multiplayer::MultiplayerController::GetEntityHandle ( ) const

Returns the network entity handle for the entity that owns this controller.

Returns
the network entity handle for the entity that owns this controller

◆ GetEntityId()

AZ::EntityId Multiplayer::MultiplayerController::GetEntityId ( ) const
Returns
the AZ::EntityId of the entity that owns this controller

◆ GetNetBindComponent()

const NetBindComponent * Multiplayer::MultiplayerController::GetNetBindComponent ( ) const
protected

Returns the NetBindComponent responsible for net binding for this controller

◆ GetNetEntityId()

NetEntityId Multiplayer::MultiplayerController::GetNetEntityId ( ) const

Returns the networkId for the entity that owns this controller.

Returns
the networkId for the entity that owns this controller

◆ GetOwner()

const MultiplayerComponent & Multiplayer::MultiplayerController::GetOwner ( ) const
protected

Returns the MultiplayerComponent that owns this controller instance.

Returns
the MultiplayerComponent that owns this controller instance

◆ IsNetEntityRoleAuthority()

bool Multiplayer::MultiplayerController::IsNetEntityRoleAuthority ( ) const

Returns true if this controller has authority.

Returns
boolean true if this controller has authority

◆ IsNetEntityRoleAutonomous()

bool Multiplayer::MultiplayerController::IsNetEntityRoleAutonomous ( ) const

Returns true if this controller has autonomy (can locally predict).

Returns
boolean true if this controller has autonomy

◆ ProcessInput()

virtual void Multiplayer::MultiplayerController::ProcessInput ( NetworkInput networkInput,
float  deltaTime 
)
protectedpure virtual

Base execution for ProcessInput packet, do not call directly.

Parameters
networkInputinput structure to process
deltaTimeamount of time to integrate the provided inputs over

◆ ProcessInputFromScript()

virtual void Multiplayer::MultiplayerController::ProcessInputFromScript ( NetworkInput networkInput,
float  deltaTime 
)
inlineprotectedvirtual

Similar to ProcessInput, do not call directly. This only needs to be overridden in components which allow NetworkInput to be processed by script.

Parameters
networkInputinput structure to process
deltaTimeamount of time to integrate the provided inputs over

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