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::MultiplayerComponentRegistry Class Reference

Classes

struct  ComponentData
 

Public Types

using PropertyNameLookupFunction = AZStd::function< const char *(PropertyIndex index)>
 
using RpcNameLookupFunction = AZStd::function< const char *(RpcIndex index)>
 
using AllocComponentInputFunction = AZStd::function< AZStd::unique_ptr< IMultiplayerComponentInput >()>
 

Public Member Functions

NetComponentId RegisterMultiplayerComponent (const ComponentData &componentData)
 
AZStd::unique_ptr< IMultiplayerComponentInputAllocateComponentInput (NetComponentId netComponentId)
 
const char * GetComponentGemName (NetComponentId netComponentId) const
 
const char * GetComponentName (NetComponentId netComponentId) const
 
const char * GetComponentPropertyName (NetComponentId netComponentId, PropertyIndex propertyIndex) const
 
const char * GetComponentRpcName (NetComponentId netComponentId, RpcIndex rpcIndex) const
 
const ComponentDataGetMultiplayerComponentData (NetComponentId netComponentId) const
 
AZ::HashValue64 GetSystemVersionHash () const
 
const Multiplayer::ComponentVersionMap & GetMultiplayerComponentVersionHashes () const
 
bool FindComponentVersionHashByName (const AZ::Name &multiplayerComponentName, AZ::HashValue64 &hash) const
 
void Reset ()
 This releases all owned memory, should only be called during multiplayer shutdown.
 

Member Function Documentation

◆ AllocateComponentInput()

AZStd::unique_ptr< IMultiplayerComponentInput > Multiplayer::MultiplayerComponentRegistry::AllocateComponentInput ( NetComponentId  netComponentId)

Allocates a new component input for the provided netComponentId.

Parameters
netComponentIdthe NetComponentId to allocate a component input for
Returns
pointer to the allocated component input, caller assumes ownership

◆ FindComponentVersionHashByName()

bool Multiplayer::MultiplayerComponentRegistry::FindComponentVersionHashByName ( const AZ::Name &  multiplayerComponentName,
AZ::HashValue64 &  hash 
) const

Finds the multiplayer component version hash by name.

Parameters
hashvalue that will be set if the component is found.
Returns
True if we found the multiplayer component and filled out the hash value; otherwise false.

◆ GetComponentGemName()

const char * Multiplayer::MultiplayerComponentRegistry::GetComponentGemName ( NetComponentId  netComponentId) const

Returns the gem name associated with the provided NetComponentId.

Parameters
netComponentIdthe NetComponentId to return the gem name of
Returns
the name of the gem that contains the requested component

◆ GetComponentName()

const char * Multiplayer::MultiplayerComponentRegistry::GetComponentName ( NetComponentId  netComponentId) const

Returns the component name associated with the provided NetComponentId.

Parameters
netComponentIdthe NetComponentId to return the component name of
Returns
the name of the component

◆ GetComponentPropertyName()

const char * Multiplayer::MultiplayerComponentRegistry::GetComponentPropertyName ( NetComponentId  netComponentId,
PropertyIndex  propertyIndex 
) const

Returns the property name associated with the provided NetComponentId and propertyIndex.

Parameters
netComponentIdthe NetComponentId to return the property name of
propertyIndexthe index off the network property to return the property name of
Returns
the name of the network property

◆ GetComponentRpcName()

const char * Multiplayer::MultiplayerComponentRegistry::GetComponentRpcName ( NetComponentId  netComponentId,
RpcIndex  rpcIndex 
) const

Returns the Rpc name associated with the provided NetComponentId and rpcId.

Parameters
netComponentIdthe NetComponentId to return the property name of
rpcIndexthe index of the rpc to return the rpc name of
Returns
the name of the requested rpc

◆ GetMultiplayerComponentData()

const ComponentData & Multiplayer::MultiplayerComponentRegistry::GetMultiplayerComponentData ( NetComponentId  netComponentId) const

Retrieves the stored component data for a given NetComponentId.

Parameters
netComponentIdthe NetComponentId to return component data for
Returns
reference to the requested component data, an empty container will be returned if the NetComponentId does not exist

◆ GetMultiplayerComponentVersionHashes()

const Multiplayer::ComponentVersionMap & Multiplayer::MultiplayerComponentRegistry::GetMultiplayerComponentVersionHashes ( ) const

Gets the mapping of all the multiplayer components by AZ::Name and hash version value.

Returns
a map of all the multiplayer components by name and hash version value

◆ GetSystemVersionHash()

AZ::HashValue64 Multiplayer::MultiplayerComponentRegistry::GetSystemVersionHash ( ) const

Returns the combined hashes of all the multiplayer components creating a single system version hash that can be quickly compared between the server and client app.

Returns
a 64-bit system-wide hash value representing of all of the multiplayer components

◆ RegisterMultiplayerComponent()

NetComponentId Multiplayer::MultiplayerComponentRegistry::RegisterMultiplayerComponent ( const ComponentData componentData)

Registers a multiplayer component with the multiplayer system.

Parameters
componentDatathe data associated with the component being registered
Returns
the NetComponentId assigned to this particular component

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