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

Go to the source code of this file.

Data Structures

class  SCR_PossessingManagerComponentClass
 

Typedefs

typedef func ScriptInvokerOnPossessedProxyMethod
 
typedef ScriptInvokerBase< ScriptInvokerOnPossessedProxyMethodScriptInvokerOnPossessedProxy
 

Functions

void ScriptInvokerOnPossessedProxyMethod (int playerID, bool isPossessing, RplId mainEntityID)
 
ScriptInvoker GetOnPossessed ()
 
ScriptInvokerOnPossessedProxy GetOnPossessedProxy ()
 
IEntity GetMainEntity (int iPlayerId)
 
RplId GetMainRplId (int iPlayerId)
 
IEntity GetPossessedEntity (int iPlayerId)
 
RplId GetPossessedRplId (int iPlayerId)
 
int GetIdFromMainEntity (IEntity entity)
 
int GetIdFromMainRplId (RplId rplId)
 
int GetIdFromControlledEntity (IEntity entity)
 
int GetIdFromControlledRplId (RplId rplId)
 
bool IsPossessing (int iPlayerId)
 
void SetMainEntity (int playerID, IEntity controlledEntity, IEntity mainEntity, bool isPossessing)
 
protected void SetMainEntityBroadcast (int playerID, bool isPossessing, RplId mainEntityID)
 
protected override void OnControllableDeleted (IEntity entity)
 
protected RplId GetRplId (IEntity entity)
 
override void OnControllableDestroyed (IEntity entity, IEntity killerEntity, notnull Instigator killer)
 
override bool HandlePlayerKilled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
 
override void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
 
override void OnPostInit (IEntity owner)
 Editable Mine. More...
 
override void OnDelete (IEntity owner)
 
override bool RplSave (ScriptBitWriter writer)
 
override bool RplLoad (ScriptBitReader reader)
 

Variables

SCR_PossessingManagerComponentClass int
 
SCR_PossessingManagerComponentClass m_MainEntities = new map<int, RplId>()
 
protected ref ScriptInvoker Event_OnPossessed
 
protected ref ScriptInvokerOnPossessedProxy Event_OnPossessedProxy
 

Typedef Documentation

◆ ScriptInvokerOnPossessedProxy

◆ ScriptInvokerOnPossessedProxyMethod

Function Documentation

◆ GetIdFromControlledEntity()

int GetIdFromControlledEntity ( IEntity  entity)

Get player ID from directly controlled or main entity.

Parameters
[in]entityEvaluated entity
Returns
Player ID, or 0 if the entity does not belong to any player

Definition at line 147 of file SCR_PossessingManagerComponent.c.

◆ GetIdFromControlledRplId()

int GetIdFromControlledRplId ( RplId  rplId)

Get player ID from RplId of directly controlled or main entity.

Parameters
[in]rplIdEvaluated entity's RplId
Returns
Player ID, or 0 if the entity does not belong to any player

Definition at line 160 of file SCR_PossessingManagerComponent.c.

◆ GetIdFromMainEntity()

int GetIdFromMainEntity ( IEntity  entity)

Get player ID based on main entity, no matter if it's currently controlled or not.

Parameters
[in]entityEvaluated entity
Returns
Player ID, or 0 if the entity does not belong to any player

Definition at line 117 of file SCR_PossessingManagerComponent.c.

◆ GetIdFromMainRplId()

int GetIdFromMainRplId ( RplId  rplId)

Get player ID based on main entity's RplId, no matter if it's currently controlled or not.

Parameters
[in]rplIdEvaluated entity's RplId
Returns
Player ID, or 0 if the entity does not belong to any player

Definition at line 132 of file SCR_PossessingManagerComponent.c.

◆ GetMainEntity()

IEntity GetMainEntity ( int  iPlayerId)

Get player's main entity. When not possessing, this will be the same as GetPlayerControlledEntity() When possessing, this will be player's main entity which was controlled before possessing started

Parameters
[in]iPlayerId
Returns
Main player entity

Definition at line 57 of file SCR_PossessingManagerComponent.c.

◆ GetMainRplId()

RplId GetMainRplId ( int  iPlayerId)

Get RplId of player's main entity. When not possessing, this will be RplId of GetPlayerControlledEntity() When possessing, this will be RplId of player's main entity which was controlled before possessing started

Parameters
[in]iPlayerId
Returns
Main player entity's RplId. Returned even if the entity is not streamed in.

Definition at line 80 of file SCR_PossessingManagerComponent.c.

◆ GetOnPossessed()

ScriptInvoker GetOnPossessed ( )
Returns
Event called on server when player possession changes

Definition at line 33 of file SCR_PossessingManagerComponent.c.

◆ GetOnPossessedProxy()

ScriptInvokerOnPossessedProxy GetOnPossessedProxy ( )
Returns
Event called on proxy when player possession changes

Definition at line 43 of file SCR_PossessingManagerComponent.c.

◆ GetPossessedEntity()

IEntity GetPossessedEntity ( int  iPlayerId)

Get the entity currently possessed by player.

Parameters
[in]iPlayerId
Returns
Possessed entity. When not possessing, null is returned.

Definition at line 93 of file SCR_PossessingManagerComponent.c.

◆ GetPossessedRplId()

RplId GetPossessedRplId ( int  iPlayerId)

Get RplId of the entity currently possessed by player.

Parameters
[in]iPlayerId
Returns
RplId of possessed entity. When not possessing, default RplId is returned.

Definition at line 105 of file SCR_PossessingManagerComponent.c.

◆ GetRplId()

protected RplId GetRplId ( IEntity  entity)

Definition at line 324 of file SCR_PossessingManagerComponent.c.

◆ HandlePlayerKilled()

override bool HandlePlayerKilled ( int  playerId,
IEntity  playerEntity,
IEntity  killerEntity,
notnull Instigator  killer 
)

Definition at line 349 of file SCR_PossessingManagerComponent.c.

◆ IsPossessing()

bool IsPossessing ( int  iPlayerId)
Parameters
[in]iPlayerIdPlayer ID
Returns
if given player is currently possessing an entity.

Definition at line 172 of file SCR_PossessingManagerComponent.c.

◆ OnControllableDeleted()

protected override void OnControllableDeleted ( IEntity  entity)

Prior to a controllable entity being DELETED, this event is raised. Controllable entity is such that has BaseControllerComponent and can be possessed either by a player, an AI or stay unpossessed.

Parameters
[in]entityEntity about to be deleted

Definition at line 307 of file SCR_PossessingManagerComponent.c.

◆ OnControllableDestroyed()

override void OnControllableDestroyed ( IEntity  entity,
IEntity  killerEntity,
notnull Instigator  killer 
)

When a controllable entity is destroyed, this event is raised. Entity is destroyed when DamageManager.OnStateChanged -> EDamageState.Destroyed

Parameters
[in]entityDestroyed entity that raised this event
[in]killerEntityInstigator entity that destroyed our victim
[in]killerInstigator of the kill

Definition at line 337 of file SCR_PossessingManagerComponent.c.

◆ RplLoad()

override bool RplLoad ( ScriptBitReader  reader)

Definition at line 419 of file SCR_PossessingManagerComponent.c.

◆ RplSave()

override bool RplSave ( ScriptBitWriter  writer)

Definition at line 404 of file SCR_PossessingManagerComponent.c.

◆ ScriptInvokerOnPossessedProxyMethod()

void ScriptInvokerOnPossessedProxyMethod ( int  playerID,
bool  isPossessing,
RplId  mainEntityID 
)

◆ SetMainEntity()

void SetMainEntity ( int  playerID,
IEntity  controlledEntity,
IEntity  mainEntity,
bool  isPossessing 
)
Parameters
[in]playerID
[in]controlledEntity
[in]mainEntity
[in]isPossessing

Definition at line 182 of file SCR_PossessingManagerComponent.c.

◆ SetMainEntityBroadcast()

protected void SetMainEntityBroadcast ( int  playerID,
bool  isPossessing,
RplId  mainEntityID 
)

Definition at line 205 of file SCR_PossessingManagerComponent.c.

Variable Documentation

◆ Event_OnPossessed

protected ref ScriptInvoker Event_OnPossessed

Definition at line 13 of file SCR_PossessingManagerComponent.c.

◆ Event_OnPossessedProxy

protected ref ScriptInvokerOnPossessedProxy Event_OnPossessedProxy

Definition at line 14 of file SCR_PossessingManagerComponent.c.

◆ int

◆ m_MainEntities

SCR_PossessingManagerComponentClass m_MainEntities = new map<int, RplId>()