Arma Reforger Script API
|
SCR_SpawnRequestComponent <-> SCR_SpawnHandlerComponent. More...
Public Member Functions | |
SCR_ESpawnResult | CanHandleRequest_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data) |
Can a player be spawned with provided data? | |
SCR_ESpawnResult | HandleRequest_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, out IEntity spawnedEntity) |
Handle request - validate resources, try to spawn, prepare and pass ownership to player. | |
void | OnFinalizeBegin_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity) |
Called when the finalisation process begins. | |
bool | CanFinalize_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity) |
Called periodically to ask whether finalization can be finished. | |
SCR_ESpawnResult | FinalizeRequest_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity) |
Finalise request - validate resources, try to spawn, prepare and pass ownership to player. | |
void | OnFinalizeDone_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity) |
Request finalized (player spawned). | |
bool | CanRequestSpawn_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, out SCR_ESpawnResult result) |
Can a player spawn, based on the provided data? | |
Protected Member Functions | |
SCR_RespawnSystemComponent | GetRespawnSystemComponent () |
override void | OnPostInit (IEntity owner) |
Initialises the handler by finding necessary dependencies. | |
bool | ValidateData_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data) |
Verifies provided data. | |
SCR_ESpawnResult | SpawnEntity_S (SCR_SpawnRequestComponent requestComponent, notnull SCR_SpawnData data, out IEntity spawnedEntity) |
bool | ValidatePrefab_S (ResourceName resourceName) |
Verifies provided prefab. | |
bool | PrepareEntity_S (SCR_SpawnRequestComponent requestComponent, IEntity entity, SCR_SpawnData data) |
Prepare an entity on the server side prior to passing ownership. | |
bool | AssignEntity_S (SCR_SpawnRequestComponent requestComponent, IEntity entity, SCR_SpawnData data) |
Assign the entity ownership and set is as the controlled entity of provided player. | |
void | HandleSpawnEntityFailure_S (SCR_SpawnRequestComponent requestComponent, IEntity entity, SCR_SpawnData data, SCR_ESpawnResult reason) |
In cases where an entity is spawned, it might be desirable to dispose of it if it e.g. | |
bool | ShouldDeleteEntityOnSpawnFailure_S (SCR_SpawnRequestComponent requestComponent, IEntity entity, SCR_SpawnData data, SCR_ESpawnResult reason) |
Check whether spawned entity should be deleted if the spawn process failed. | |
void | HandleEntityChange_S (SCR_SpawnRequestComponent requestComponent, IEntity previousEntity, IEntity newEntity, SCR_SpawnData data) |
Called after new entity is assigned to the player. | |
Protected Attributes | |
bool | m_bDestroyPreviousControlledEntity |
bool | m_bDeletePreviousControlledEntity |
SCR_SpawnRequestComponent <-> SCR_SpawnHandlerComponent.
SCR_SpawnRequestComponent allows communication between client and the authority, SCR_SpawnHandlerComponent handles the requests on authority as desired.
The handler is the authority component of the respawn process which handles client (or authority-issued) request to respawn from a specific player controller and ensures that the spawning process is handled and streamlined. The process is further streamlined via the usage of a unified parent manager, the SCR_RespawnSystemComponent.
|
protected |
Assign the entity ownership and set is as the controlled entity of provided player.
[in] | requestComponent | |
[in] | entity | |
[in] | data |
bool SCR_SpawnHandlerComponent.CanFinalize_S | ( | SCR_SpawnRequestComponent | requestComponent, |
SCR_SpawnData | data, | ||
IEntity | entity | ||
) |
Called periodically to ask whether finalization can be finished.
[in] | requestComponent | |
[in] | data | |
[in] | entity |
Implemented in SCR_SpawnPointSpawnHandlerComponent.
SCR_ESpawnResult SCR_SpawnHandlerComponent.CanHandleRequest_S | ( | SCR_SpawnRequestComponent | requestComponent, |
SCR_SpawnData | data | ||
) |
Can a player be spawned with provided data?
[in] | requestComponent | Instigator of this request |
[in] | data | Request/ask data |
Implemented in SCR_PossessSpawnHandlerComponent.
bool SCR_SpawnHandlerComponent.CanRequestSpawn_S | ( | SCR_SpawnRequestComponent | requestComponent, |
SCR_SpawnData | data, | ||
out SCR_ESpawnResult | result | ||
) |
Can a player spawn, based on the provided data?
Handle game logic, ask game mode, respawn timers -> anything relevant for proper evaluation.
[in] | requestComponent | |
[in] | data | |
[out] | result |
Implemented in SCR_PossessSpawnHandlerComponent, and SCR_SpawnPointSpawnHandlerComponent.
SCR_ESpawnResult SCR_SpawnHandlerComponent.FinalizeRequest_S | ( | SCR_SpawnRequestComponent | requestComponent, |
SCR_SpawnData | data, | ||
IEntity | entity | ||
) |
Finalise request - validate resources, try to spawn, prepare and pass ownership to player.
[in] | requestComponent | |
[in] | data | |
[in] | entity |
|
protected |
|
protected |
Called after new entity is assigned to the player.
[in] | requestComponent | |
[in] | previousEntity | Last controlled entity or null if none. |
[in] | newEntity | New controlled entity. |
[in] | data |
SCR_ESpawnResult SCR_SpawnHandlerComponent.HandleRequest_S | ( | SCR_SpawnRequestComponent | requestComponent, |
SCR_SpawnData | data, | ||
out IEntity | spawnedEntity | ||
) |
Handle request - validate resources, try to spawn, prepare and pass ownership to player.
[in] | requestComponent | |
[in] | data | |
[out] | spawnedEntity |
Implemented in SCR_SpawnPointSpawnHandlerComponent.
|
protected |
In cases where an entity is spawned, it might be desirable to dispose of it if it e.g.
cannot be prepared, or assigned to the target player. Such cases can be handled by overriding this method. By default, the entity is deleted.
[in] | requestComponent | |
[in] | entity | The entity that should be spawned, but could not be given over (prepared, assigned, ..) |
[in] | data | |
[in] | reason |
void SCR_SpawnHandlerComponent.OnFinalizeBegin_S | ( | SCR_SpawnRequestComponent | requestComponent, |
SCR_SpawnData | data, | ||
IEntity | entity | ||
) |
Called when the finalisation process begins.
void SCR_SpawnHandlerComponent.OnFinalizeDone_S | ( | SCR_SpawnRequestComponent | requestComponent, |
SCR_SpawnData | data, | ||
IEntity | entity | ||
) |
Request finalized (player spawned).
[in] | requestComponent | |
[in] | data | |
[in] | entity |
Implemented in SCR_PossessSpawnHandlerComponent, and SCR_SpawnPointSpawnHandlerComponent.
|
protected |
Initialises the handler by finding necessary dependencies.
[in] | owner |
Implemented in SCR_SpawnPointSpawnHandlerComponent.
|
protected |
Prepare an entity on the server side prior to passing ownership.
For example in this case character can have items added, can be seated in vehicle, etc.
[in] | requestComponent | |
[in] | entity | |
[in] | data |
Implemented in SCR_SpawnPointSpawnHandlerComponent.
|
protected |
Check whether spawned entity should be deleted if the spawn process failed.
[in] | requestComponent | |
[in] | entity | |
[in] | data | |
[in] | reason |
Implemented in SCR_PossessSpawnHandlerComponent.
|
protected |
[in] | requestComponent | |
[in] | data | |
[out] | spawnedEntity |
Implemented in SCR_PossessSpawnHandlerComponent, and SCR_SpawnPointSpawnHandlerComponent.
|
protected |
Verifies provided data.
[in] | requestComponent | |
[in] | data |
Implemented in SCR_PossessSpawnHandlerComponent, and SCR_SpawnPointSpawnHandlerComponent.
|
protected |
Verifies provided prefab.
[in] | resourceName |
|
protected |
|
protected |