Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PossessingManagerComponent.c File Reference

Go to the source code of this file.

Classes

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)
void SetMainEntityBroadcast (int playerID, bool isPossessing, RplId mainEntityID)
override void OnControllableDeleted (IEntity entity)
RplId GetRplId (IEntity entity)
override void OnControllableDestroyed (notnull SCR_InstigatorContextData instigatorContextData)
override bool HandlePlayerKilled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator instigator)
override void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
override void OnPostInit (IEntity owner)
 Editable Mine.
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>()
ref ScriptInvoker Event_OnPossessed
ref ScriptInvokerOnPossessedProxy Event_OnPossessedProxy

Typedef Documentation

◆ ScriptInvokerOnPossessedProxy

◆ ScriptInvokerOnPossessedProxyMethod

Function Documentation

◆ GetIdFromControlledEntity()

int GetIdFromControlledEntity ( IEntity entity)
protected

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)
protected

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)
protected

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)
protected

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)
protected

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)
protected

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 ( )
protected
Returns
Event called on server when player possession changes

Definition at line 33 of file SCR_PossessingManagerComponent.c.

◆ GetOnPossessedProxy()

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

Definition at line 43 of file SCR_PossessingManagerComponent.c.

◆ GetPossessedEntity()

IEntity GetPossessedEntity ( int iPlayerId)
protected

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)
protected

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()

RplId GetRplId ( IEntity entity)
protected

Definition at line 324 of file SCR_PossessingManagerComponent.c.

◆ HandlePlayerKilled()

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

Definition at line 349 of file SCR_PossessingManagerComponent.c.

◆ IsPossessing()

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

Definition at line 172 of file SCR_PossessingManagerComponent.c.

◆ OnControllableDeleted()

override void OnControllableDeleted ( IEntity entity)
protected

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 ( notnull SCR_InstigatorContextData instigatorContextData)
protected

When a controllable entity is destroyed, this event is raised.

Parameters
[in]instigatorContextDataHolds the data of the victim and killer

Definition at line 337 of file SCR_PossessingManagerComponent.c.

◆ OnDelete()

override void OnDelete ( IEntity owner)
protected

Definition at line 398 of file SCR_PossessingManagerComponent.c.

◆ OnPlayerDisconnected()

override void OnPlayerDisconnected ( int playerId,
KickCauseCode cause,
int timeout )
protected

Called after a player is disconnected.

Parameters
[in]playerIdPlayerId of disconnected player.
[in]causeReason player disconnected
[in]timeoutTimeout for when players are allowed to connect again. -1 means Ban without an assigned timeout

What happens when a player disconnects.

Parameters
[in]playerIDis a unique player identifier that defines which player has disconnected.
[in]cause
[in]timeout

Definition at line 386 of file SCR_PossessingManagerComponent.c.

◆ RplLoad()

override bool RplLoad ( ScriptBitReader reader)
protected

Definition at line 419 of file SCR_PossessingManagerComponent.c.

◆ RplSave()

override bool RplSave ( ScriptBitWriter writer)
protected

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 )
protected
Parameters
[in]playerID
[in]controlledEntity
[in]mainEntity
[in]isPossessing

Definition at line 182 of file SCR_PossessingManagerComponent.c.

◆ SetMainEntityBroadcast()

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

Definition at line 205 of file SCR_PossessingManagerComponent.c.

Variable Documentation

◆ Event_OnPossessed

ref ScriptInvoker Event_OnPossessed
protected

Definition at line 13 of file SCR_PossessingManagerComponent.c.

◆ Event_OnPossessedProxy

ref ScriptInvokerOnPossessedProxy Event_OnPossessedProxy
protected

Definition at line 14 of file SCR_PossessingManagerComponent.c.

◆ int

◆ m_MainEntities