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.
|
A network player spawner. Attach this component to any level's root entity which needs to spawn a network player. If no spawn points are provided the network players will be spawned at the world-space origin. More...
#include <SimplePlayerSpawnerComponent.h>
Inherits AZ::Component, Multiplayer::IMultiplayerSpawner, and Multiplayer::ISimplePlayerSpawner.
Public Member Functions | |
AZ_COMPONENT (Multiplayer::SimplePlayerSpawnerComponent, "{0A6D0132-3FD2-4F13-B537-2B1DA99E34E9}") | |
AZ::Transform | GetNextSpawnPoint () const override |
const AZStd::vector< AZ::EntityId > & | GetSpawnPoints () const override |
uint32_t | GetSpawnPointCount () const override |
uint32_t | GetNextSpawnPointIndex () const override |
void | SetNextSpawnPointIndex (uint32_t index) override |
Overwrites the next joining player's spawn index. The spawn index provided must be a valid (in-bounds) index into the array of available spawn points. | |
Public Member Functions inherited from Multiplayer::IMultiplayerSpawner | |
AZ_RTTI (IMultiplayerSpawner, "{E5525317-A476-4209-BE45-477FB9D96083}") | |
Public Member Functions inherited from Multiplayer::ISimplePlayerSpawner | |
AZ_RTTI (ISimplePlayerSpawner, "{6DAC5CDE-5D63-4C0B-9F7B-9F5B09079DBB}") | |
Protected Member Functions | |
void | Activate () override |
void | Deactivate () override |
NetworkEntityHandle | OnPlayerJoin (uint64_t userId, const MultiplayerAgentDatum &agentDatum) override |
void | OnPlayerLeave (ConstNetworkEntityHandle entityHandle, const ReplicationSet &replicationSet, AzNetworking::DisconnectReason reason) override |
Friends | |
class | SimplePlayerSpawnerTests |
A network player spawner. Attach this component to any level's root entity which needs to spawn a network player. If no spawn points are provided the network players will be spawned at the world-space origin.
|
overridevirtual |
Returns the location where the next joining player will be spawned. Method is only valid if called from the multiplayer host/authority; clients are not given information regarding the spawn point index.
Implements Multiplayer::ISimplePlayerSpawner.
|
overridevirtual |
Returns the spawn point index where the next joining player will be spawned.
Implements Multiplayer::ISimplePlayerSpawner.
|
overridevirtual |
Returns the number of spawn points.
Implements Multiplayer::ISimplePlayerSpawner.
|
overridevirtual |
Returns an immutable list of all the spawn points. Only access this list on the multiplayer host; spawn points are not synced across the network and only the host is responsible for spawning players.
Implements Multiplayer::ISimplePlayerSpawner.
|
overrideprotectedvirtual |
Invoked when a Client connects/ClientHost starts a session to determine what autonomous Prefab should be spawned where
userId | User ID of joining player |
agentDatum | Datum containing connection data that can be used to inform join logic |
Implements Multiplayer::IMultiplayerSpawner.
|
overrideprotectedvirtual |
Invoked when a Client disconnects from the session to determine how the autonomous prefab should be cleaned up
entityHandle | The entity handle to consider on leaving, generally the connection's primary player entity |
replicationSet | The replication set of the related connection |
reason | The cause of disconnection |
Implements Multiplayer::IMultiplayerSpawner.