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.
Multiplayer::ISimplePlayerSpawner Class Referenceabstract

The SimplePlayerSpawnerRequest event-bus exposes helper methods regarding network player spawners. Although the Multiplayer System automatically spawns in players, it's common for game specific server logic to retrieve valid spawn locations when respawning a player. More...

#include <ISimplePlayerSpawner.h>

Inherited by Multiplayer::SimplePlayerSpawnerComponent.

Public Member Functions

 AZ_RTTI (ISimplePlayerSpawner, "{6DAC5CDE-5D63-4C0B-9F7B-9F5B09079DBB}")
 
virtual AZ::Transform GetNextSpawnPoint () const =0
 
virtual const AZStd::vector< AZ::EntityId > & GetSpawnPoints () const =0
 
virtual uint32_t GetSpawnPointCount () const =0
 
virtual uint32_t GetNextSpawnPointIndex () const =0
 
virtual void SetNextSpawnPointIndex (uint32_t index)=0
 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.
 

Detailed Description

The SimplePlayerSpawnerRequest event-bus exposes helper methods regarding network player spawners. Although the Multiplayer System automatically spawns in players, it's common for game specific server logic to retrieve valid spawn locations when respawning a player.

Member Function Documentation

◆ GetNextSpawnPoint()

virtual AZ::Transform Multiplayer::ISimplePlayerSpawner::GetNextSpawnPoint ( ) const
pure virtual

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.

Returns
AZ::Transform The location of the next spawn point

Implemented in Multiplayer::SimplePlayerSpawnerComponent.

◆ GetNextSpawnPointIndex()

virtual uint32_t Multiplayer::ISimplePlayerSpawner::GetNextSpawnPointIndex ( ) const
pure virtual

Returns the spawn point index where the next joining player will be spawned.

Returns
The index of the next spawn point. Index will be valid except when the spawn point count is zero.

Implemented in Multiplayer::SimplePlayerSpawnerComponent.

◆ GetSpawnPointCount()

virtual uint32_t Multiplayer::ISimplePlayerSpawner::GetSpawnPointCount ( ) const
pure virtual

Returns the number of spawn points.

Returns
Number of spawn points.

Implemented in Multiplayer::SimplePlayerSpawnerComponent.

◆ GetSpawnPoints()

virtual const AZStd::vector<AZ::EntityId>& Multiplayer::ISimplePlayerSpawner::GetSpawnPoints ( ) const
pure virtual

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.

Returns
const AZStd::vector<AZ::EntityId> List of spawn points.

Implemented in Multiplayer::SimplePlayerSpawnerComponent.


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