Open 3D Engine Multiplayer Gem API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
#include <NetworkEntityManager.h>
Inherits Multiplayer::INetworkEntityManager, AzFramework::RootSpawnableNotificationBus::Handler, and AzFramework::SpawnableAssetEventsBus::Handler.
Public Member Functions | |
void | DispatchLocalDeferredRpcMessages () |
void | Reset () |
Used to release all memory prior to shutdown. | |
void | Initialize (const HostId &hostId, AZStd::unique_ptr< IEntityDomain > entityDomain) override |
bool | IsInitialized () const override |
IEntityDomain * | GetEntityDomain () const override |
NetworkEntityTracker * | GetNetworkEntityTracker () override |
NetworkEntityAuthorityTracker * | GetNetworkEntityAuthorityTracker () override |
MultiplayerComponentRegistry * | GetMultiplayerComponentRegistry () override |
const HostId & | GetHostId () const override |
ConstNetworkEntityHandle | GetEntity (NetEntityId netEntityId) const override |
NetEntityId | GetNetEntityIdById (const AZ::EntityId &entityId) const override |
EntityList | CreateEntitiesImmediate (const AzFramework::Spawnable &spawnable, NetEntityRole netEntityRole, const AZ::Transform &transform, AutoActivate autoActivate) |
EntityList | CreateEntitiesImmediate (const PrefabEntityId &prefabEntryId, NetEntityRole netEntityRole, const AZ::Transform &transform, AutoActivate autoActivate=AutoActivate::Activate) override |
EntityList | CreateEntitiesImmediate (const PrefabEntityId &prefabEntryId, NetEntityId netEntityId, NetEntityRole netEntityRole, AutoActivate autoActivate, const AZ::Transform &transform) override |
AZStd::unique_ptr< AzFramework::EntitySpawnTicket > | RequestNetSpawnableInstantiation (const AZ::Data::Asset< AzFramework::Spawnable > &netSpawnable, const AZ::Transform &transform) override |
void | SetupNetEntity (AZ::Entity *netEntity, PrefabEntityId prefabEntityId, NetEntityRole netEntityRole) override |
uint32_t | GetEntityCount () const override |
NetworkEntityHandle | AddEntityToEntityMap (NetEntityId netEntityId, AZ::Entity *entity) override |
void | RemoveEntityFromEntityMap (NetEntityId netEntityId) override |
void | MarkForRemoval (const ConstNetworkEntityHandle &entityHandle) override |
bool | IsMarkedForRemoval (const ConstNetworkEntityHandle &entityHandle) const override |
void | ClearEntityFromRemovalList (const ConstNetworkEntityHandle &entityHandle) override |
void | ClearAllEntities () override |
Clears out and deletes all entities registered with the entity manager. | |
void | AddEntityMarkedDirtyHandler (AZ::Event<>::Handler &entityMarkedDirtyHandle) override |
void | AddEntityNotifyChangesHandler (AZ::Event<>::Handler &entityNotifyChangesHandle) override |
void | AddEntityExitDomainHandler (EntityExitDomainEvent::Handler &entityExitDomainHandler) override |
void | AddControllersActivatedHandler (ControllersActivatedEvent::Handler &controllersActivatedHandler) override |
void | AddControllersDeactivatedHandler (ControllersDeactivatedEvent::Handler &controllersDeactivatedHandler) override |
void | NotifyEntitiesDirtied () override |
Notifies entities that they should process their dirty state. | |
void | NotifyEntitiesChanged () override |
Notifies entities that they should process change notifications. | |
void | NotifyControllersActivated (const ConstNetworkEntityHandle &entityHandle, EntityIsMigrating entityIsMigrating) override |
void | NotifyControllersDeactivated (const ConstNetworkEntityHandle &entityHandle, EntityIsMigrating entityIsMigrating) override |
void | HandleLocalRpcMessage (NetworkEntityRpcMessage &message) override |
void | HandleEntitiesExitDomain (const NetEntityIdSet &entitiesNotInDomain) override |
void | ForceAssumeAuthority (const ConstNetworkEntityHandle &entityHandle) override |
void | MarkAlwaysRelevantToClients (const ConstNetworkEntityHandle &entityHandle, bool alwaysRelevant) override |
void | MarkAlwaysRelevantToServers (const ConstNetworkEntityHandle &entityHandle, bool alwaysRelevant) override |
const NetEntityHandleSet & | GetAlwaysRelevantToClientsSet () const override |
const NetEntityHandleSet & | GetAlwaysRelevantToServersSet () const override |
void | SetMigrateTimeoutTimeMs (AZ::TimeMs timeoutTimeMs) override |
void | DebugDraw () const override |
Visualization of network entity manager state. | |
void | OnRootSpawnableAssigned (AZ::Data::Asset< AzFramework::Spawnable > rootSpawnable, uint32_t generation) override |
void | OnRootSpawnableReleased (uint32_t generation) override |
void | OnResolveAliases (AzFramework::Spawnable::EntityAliasVisitor &aliases, const AzFramework::SpawnableMetaData &metadata, const AzFramework::Spawnable::EntityList &entities) override |
Public Member Functions inherited from Multiplayer::INetworkEntityManager | |
AZ_RTTI (INetworkEntityManager, "{109759DE-9492-439C-A0B1-AE46E6FD029C}") | |
Static Public Attributes | |
static constexpr AZ::Crc32 | NetworkEntityTag = AZ_CRC_CE("Network") |
Additional Inherited Members | |
Public Types inherited from Multiplayer::INetworkEntityManager | |
using | EntityList = AZStd::vector< NetworkEntityHandle > |
Implementation of the networked entity manager interface. This class creates and manages all networked entities.
|
overridevirtual |
Adds an event handler to be invoked when an entities controllers have activated
controllersActivatedHandler | event handler for the entity |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Adds an event handler to be invoked when an entities controllers have been deactivated
controllersDeactivatedHandler | event handler for the entity |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Adds an event handler to be invoked when we notify entities to send their change notifications.
entityNotifyChangesHandle | event handler for the dirtied entity |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Adds an event handler to be invoked when we notify which entities have been marked dirty.
entityMarkedDirtyHandle | event handler for the dirtied entity |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Adds an event handler to be invoked when we notify entities to send their change notifications.
entityNotifyChangesHandle | event handler for the dirtied entity |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Adds the provided entity to the internal entity map identified by the provided netEntityId.
netEntityId | the identifier to use for the added entity |
entity | the entity to add to the internal entity map |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Unmarks the specified entity so it will no longer be removed and deleted.
entityHandle | the entity to unmark for removal and deletion |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Creates new entities of the given archetype This interface is internally used to spawn replicated entities
prefabEntryId | the name of the spawnable to spawn |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Creates new entities of the given archetype
prefabEntryId | the name of the spawnable to spawn |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Forcibly assumes authoritative control over the given entity. This should only be used in the event of the unexpected loss of the previous authority, any other usage could corrupt the simulation.
entityHandle | the entity to forcibly assume authoritative control over |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Retrieves the set of network entities that should always be relevant to client connections.
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Retrieves the set of network entities that should always be relevant to server connections.
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Returns an ConstEntityPtr for the provided entityId.
netEntityId | the netEntityId to get an ConstEntityPtr for |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Returns the total number of entities tracked by this INetworkEntityManager instance.
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Returns the entity domain associated with this network entity manager, this will be nullptr on clients.
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Returns the HostId for this INetworkEntityManager instance.
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Returns the MultiplayerComponentRegistry for this INetworkEntityManager instance.
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Returns the Net Entity ID for a given AZ Entity ID.
entityId | the AZ Entity ID |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Returns the NetworkEntityAuthorityTracker for this INetworkEntityManager instance.
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Returns the NetworkEntityTracker for this INetworkEntityManager instance.
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Handles a set of entities transitioning between entity domains.
entitiesNotInDomain | the set of entities that are no longer contained within our entity domain |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Handle a local rpc message.
entityRpcMessage | the local rpc message to handle |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
INetworkEntityManager overrides.
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Returns whether or not the network entity manager has been initialized.
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Returns true if the indicated entity is marked for removal.
entityHandle | the entity to test if marked for removal |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Will toggle whether or not the provided entity should always be relevant to client connections. Use carefully, as this will cause the entity to bypass normal relevancy checks and could cause bandwidth issues.
entityHandle | const network entity handle to the entity to override relevancy for |
alwaysRelevant | a true value will enable always relevant, false will disable |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Will toggle whether or not the provided entity should always be relevant to server connections. Use carefully, as this will cause the entity to bypass normal relevancy checks and could cause bandwidth issues.
entityHandle | const network entity handle to the entity to override relevancy for |
alwaysRelevant | a true value will enable always relevant, false will disable |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Marks the specified entity for removal and deletion.
entityHandle | the entity to remove and delete |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Notifies that an entities controllers have activated.
entityHandle | handle to the entity whose controllers have activated |
entityIsMigrating | true if the entity is activating after a migration |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Notifies that an entities controllers have been deactivated.
entityHandle | handle to the entity whose controllers have been deactivated |
entityIsMigrating | true if the entity is deactivating due to a migration |
Implements Multiplayer::INetworkEntityManager.
|
override |
SpawnableAssetEventsBus
|
override |
RootSpawnableNotificationBus
|
overridevirtual |
Removes the provided netEntityId from the internal entity map.
netEntityId | the identifier to use for the added entity |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Requests a network spawnable to instantiate at a given transform This is an async function. The instantiated entities are not available immediately but will be constructed by the spawnable system The spawnable ticket has to be kept for the whole lifetime of the entities
netSpawnable | the network spawnable to spawn |
transform | the transform where the spawnable should be spawned |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Overrides the default timeout time used during entity migrations.
timeoutTimeMs | the timeout time to use in milliseconds |
Implements Multiplayer::INetworkEntityManager.
|
overridevirtual |
Configures new networked entity
netEntity | the entity to setup |
prefabEntryId | the name of the spawnable the entity originated from |
netEntityRole | the net role the entity should be setup for |
Implements Multiplayer::INetworkEntityManager.