Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SpawnRequestComponent.c File Reference

Go to the source code of this file.

Data Structures

class  SCR_SpawnRequestComponentClass
 

Functions

PlayerController GetPlayerController ()
 
int GetPlayerId ()
 
protected SCR_RespawnComponent GetRespawnComponent ()
 
SCR_SpawnHandlerComponent GetHandlerComponent ()
 
protected SCR_SpawnLockComponent GetLock ()
 
 GetHandlerType ()
 
 GetDataType ()
 
protected bool IsOwner ()
 
protected bool IsProxy ()
 
protected override void OnPostInit (IEntity owner)
 Editable Mine. More...
 
sealed bool CanRequestRespawn (SCR_SpawnData data)
 
protected bool DoCanRequestRespawn (SCR_SpawnData data)
 
protected void ProcessCanRequest_S (SCR_SpawnData data)
 
protected void SendCanResponse_S (SCR_ESpawnResult response, SCR_SpawnData data)
 
protected void Rpc_SendCanResponse_O (SCR_ESpawnResult response)
 
sealed bool RequestRespawn (SCR_SpawnData data)
 
protected bool DoRequestRespawn (SCR_SpawnData data)
 
protected void ProcessRequest_S (SCR_SpawnData data)
 
protected void OnFinalizeBegin_S (SCR_SpawnHandlerComponent handler, SCR_SpawnData data, IEntity spawnedEntity)
 
protected void AwaitFinalization_S (SCR_SpawnHandlerComponent handler, SCR_SpawnData data, IEntity spawnedEntity)
 
protected bool CanFinalize_S (SCR_SpawnHandlerComponent handler, SCR_SpawnData data, IEntity spawnedEntity)
 
protected void FinalizeRequest_S (SCR_SpawnHandlerComponent handler, SCR_SpawnData data, IEntity spawnedEntity)
 
protected void SendResponse_S (SCR_ESpawnResult response, SCR_SpawnData data)
 
protected void SendFinalizationBegin_S ()
 Send a notification from the authority that the finalisation has started. More...
 
protected void Rpc_OnFinalizationBegin_O ()
 
bool IsPreloading ()
 
void StartSpawnPreload (vector position)
 
protected void NotifyPreloadStarted_S ()
 
protected void Rpc_NotifyPreloadStarted_S ()
 
protected void NotifyPreloadFinished_S ()
 
protected void Rpc_NotifyPreloadFinished_S ()
 
protected void Rpc_StartPreload_O (vector position)
 
protected void Rpc_SendResponse_O (SCR_ESpawnResult response)
 
protected SCR_ChimeraAIAgent FindAIAgent (IEntity entity)
 
void ~SCR_SpawnRequestComponent ()
 

Variables

SCR_SpawnRequestComponentClass m_PlayerController
 
private SCR_RespawnComponent m_RespawnComponent
 
private SCR_SpawnLockComponent m_LockComponent
 
private RplComponent m_RplComponent
 
private SCR_SpawnHandlerComponent m_HandlerComponent
 
private bool m_bIsPreloading
 
private ref SCR_SpawnData m_ConfirmationPendingData
 

Function Documentation

◆ AwaitFinalization_S()

protected void AwaitFinalization_S ( SCR_SpawnHandlerComponent  handler,
SCR_SpawnData  data,
IEntity  spawnedEntity 
)

Authority callback to await finalisation.

Parameters
[in]handler
[in]data
[in]spawnedEntity

Definition at line 412 of file SCR_SpawnRequestComponent.c.

◆ CanFinalize_S()

protected bool CanFinalize_S ( SCR_SpawnHandlerComponent  handler,
SCR_SpawnData  data,
IEntity  spawnedEntity 
)
Parameters
[in]handler
[in]data
[in]spawnedEntity
Returns
true if the finalisation can occur, false if not

Definition at line 438 of file SCR_SpawnRequestComponent.c.

◆ CanRequestRespawn()

sealed bool CanRequestRespawn ( SCR_SpawnData  data)

Sends an ask request to the authority to find out whether spawn with provided data is valid. Returned value does NOT correspond to the actual response. For reponse see available events.

Returns
true if the request was sent from this client properly, false otherwise.

Definition at line 160 of file SCR_SpawnRequestComponent.c.

◆ DoCanRequestRespawn()

protected bool DoCanRequestRespawn ( SCR_SpawnData  data)

Request is first handled on the sending side (player or authority depending on context). This method can return false and will immediately raise a SCR_ESpawnResult.BAD_REQUEST response.

Returns
true in case request was sucessfully dispatched, false otherwise.

Definition at line 198 of file SCR_SpawnRequestComponent.c.

◆ DoRequestRespawn()

protected bool DoRequestRespawn ( SCR_SpawnData  data)

Request is first handled on the sending side (player or authority depending on context). This method can return false and will immediately raise a SCR_ESpawnResult.BAD_REQUEST response.

Parameters
[in]data
Returns
true in case request was sucessfully dispatched, false otherwise.

Definition at line 331 of file SCR_SpawnRequestComponent.c.

◆ FinalizeRequest_S()

protected void FinalizeRequest_S ( SCR_SpawnHandlerComponent  handler,
SCR_SpawnData  data,
IEntity  spawnedEntity 
)

Authority call to finalise respawn, after ProcessRequest_S (AwaitFinalization_S respectively) has finished. It is delayed to allow certain jobs (end of frame) to finish, before passing the ownership to the client.

Parameters
[in]handler
[in]data
[in]spawnedEntity

Definition at line 453 of file SCR_SpawnRequestComponent.c.

◆ FindAIAgent()

protected SCR_ChimeraAIAgent FindAIAgent ( IEntity  entity)

Tries to find AI agent for provided entity.

Parameters
[in]entity

Definition at line 600 of file SCR_SpawnRequestComponent.c.

◆ GetDataType()

GetDataType ( )
Returns
the type of TData this TRequestComponent is linked to. Each request sent through a TRequestComponent accepts and handles a TData payload.

Definition at line 80 of file SCR_SpawnRequestComponent.c.

◆ GetHandlerComponent()

SCR_SpawnHandlerComponent GetHandlerComponent ( )
Returns

Definition at line 52 of file SCR_SpawnRequestComponent.c.

◆ GetHandlerType()

GetHandlerType ( )
Returns
the type of THandlerComponent component this TRequestComponent is linked to. Each request sent through a TRequestComponent is always processed via a THandlerComponent.

Definition at line 72 of file SCR_SpawnRequestComponent.c.

◆ GetLock()

protected SCR_SpawnLockComponent GetLock ( )
Returns
the lock component on owner PlayerController (if any) that is used to lock requests until they are resolved.

Definition at line 59 of file SCR_SpawnRequestComponent.c.

◆ IsOwner()

protected bool IsOwner ( )

Definition at line 86 of file SCR_SpawnRequestComponent.c.

◆ IsPreloading()

bool IsPreloading ( )
Returns

Definition at line 520 of file SCR_SpawnRequestComponent.c.

◆ IsProxy()

protected bool IsProxy ( )

Definition at line 92 of file SCR_SpawnRequestComponent.c.

◆ NotifyPreloadFinished_S()

protected void NotifyPreloadFinished_S ( )

Definition at line 551 of file SCR_SpawnRequestComponent.c.

◆ NotifyPreloadStarted_S()

protected void NotifyPreloadStarted_S ( )

Definition at line 537 of file SCR_SpawnRequestComponent.c.

◆ OnFinalizeBegin_S()

protected void OnFinalizeBegin_S ( SCR_SpawnHandlerComponent  handler,
SCR_SpawnData  data,
IEntity  spawnedEntity 
)

Authority callback when finalisation of spawn has began.

Parameters
[in]handler
[in]data
[in]spawnedEntity

Definition at line 398 of file SCR_SpawnRequestComponent.c.

◆ ProcessCanRequest_S()

protected void ProcessCanRequest_S ( SCR_SpawnData  data)

Authority call to dispatch provided data to corresponding SCR_SpawnHandlerComponent. Handles responses when handler is not found or on request success internally.

Parameters
[in]data

Definition at line 208 of file SCR_SpawnRequestComponent.c.

◆ ProcessRequest_S()

protected void ProcessRequest_S ( SCR_SpawnData  data)

Authority call to dispatch provided data to corresponding SCR_SpawnHandlerComponent. Handles responses when handler is not found or on request success internally.

Parameters
[in]data

Definition at line 341 of file SCR_SpawnRequestComponent.c.

◆ RequestRespawn()

sealed bool RequestRespawn ( SCR_SpawnData  data)

Requests respawn with provided data. ! Note that even successful request can still be denied by the authority!

Parameters
[in]data
Returns
true in case success was sent from the client, false otherwise (early reject).

Definition at line 295 of file SCR_SpawnRequestComponent.c.

◆ Rpc_NotifyPreloadFinished_S()

protected void Rpc_NotifyPreloadFinished_S ( )

Definition at line 559 of file SCR_SpawnRequestComponent.c.

◆ Rpc_NotifyPreloadStarted_S()

protected void Rpc_NotifyPreloadStarted_S ( )

Definition at line 545 of file SCR_SpawnRequestComponent.c.

◆ Rpc_OnFinalizationBegin_O()

protected void Rpc_OnFinalizationBegin_O ( )

Definition at line 508 of file SCR_SpawnRequestComponent.c.

◆ Rpc_SendCanResponse_O()

protected void Rpc_SendCanResponse_O ( SCR_ESpawnResult  response)

Owner: Processes received response about current spawn process from the authority, dispatches events.

Parameters
[in]responseThe result of the respawning action.

Definition at line 271 of file SCR_SpawnRequestComponent.c.

◆ Rpc_SendResponse_O()

protected void Rpc_SendResponse_O ( SCR_ESpawnResult  response)

Owner: Processes received response about current spawn process from the authority, dispatches events.

Parameters
[in]responseThe result of the respawning action.

Definition at line 580 of file SCR_SpawnRequestComponent.c.

◆ Rpc_StartPreload_O()

protected void Rpc_StartPreload_O ( vector  position)

Definition at line 568 of file SCR_SpawnRequestComponent.c.

◆ SendCanResponse_S()

protected void SendCanResponse_S ( SCR_ESpawnResult  response,
SCR_SpawnData  data 
)

Authority: Sends a response from the server to the owner about current can-respawn request.

Parameters
[in]responseThe result of the request.
[in]dataThe data the request was instigated with.

Definition at line 244 of file SCR_SpawnRequestComponent.c.

◆ SendFinalizationBegin_S()

protected void SendFinalizationBegin_S ( )

Send a notification from the authority that the finalisation has started.

Definition at line 498 of file SCR_SpawnRequestComponent.c.

◆ SendResponse_S()

protected void SendResponse_S ( SCR_ESpawnResult  response,
SCR_SpawnData  data 
)

Authority: Sends a response from the server to the owner about current respawn request.

Parameters
[in]responseThe result of the respawning action.
[in]dataThe data the request was instigated with.

Definition at line 474 of file SCR_SpawnRequestComponent.c.

◆ StartSpawnPreload()

void StartSpawnPreload ( vector  position)
Parameters
[in]position

Definition at line 528 of file SCR_SpawnRequestComponent.c.

◆ ~SCR_SpawnRequestComponent()

void ~SCR_SpawnRequestComponent ( )

Definition at line 617 of file SCR_SpawnRequestComponent.c.

Variable Documentation

◆ m_bIsPreloading

private bool m_bIsPreloading

Definition at line 28 of file SCR_SpawnRequestComponent.c.

◆ m_ConfirmationPendingData

private ref SCR_SpawnData m_ConfirmationPendingData

When we ask the server for spawning eligibility, to prevent uneccessary transfers and unnecessary boilerplate, we store the current pending data until a response is received. The data is validated when sent during actual respawn request anyway, so in worst case scenario, we receive a response that spawn data is invalid.

Definition at line 67 of file SCR_SpawnRequestComponent.c.

◆ m_HandlerComponent

private SCR_SpawnHandlerComponent m_HandlerComponent

Definition at line 27 of file SCR_SpawnRequestComponent.c.

◆ m_LockComponent

private SCR_SpawnLockComponent m_LockComponent

Definition at line 24 of file SCR_SpawnRequestComponent.c.

◆ m_PlayerController

SCR_SpawnRequestComponentClass m_PlayerController

SCR_SpawnRequestComponent <-> SCR_SpawnHandlerComponent

SCR_SpawnRequestComponent allows communication between client and the authority, SCR_SpawnHandlerComponent handles the requests on authority as desired.

The respawn request component is the client (but can be issued by authority) component of the respawn process which sends respawn requests to be process by the authority. The process is further streamlined via the usage of a unified parent manager, the SCR_RespawnComponent.

◆ m_RespawnComponent

private SCR_RespawnComponent m_RespawnComponent

Definition at line 23 of file SCR_SpawnRequestComponent.c.

◆ m_RplComponent

private RplComponent m_RplComponent

Definition at line 25 of file SCR_SpawnRequestComponent.c.