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

Go to the source code of this file.

Classes

class  SCR_FactionCommanderHandlerComponentClass
 Handles voting and AI decisions for the faction Commander role. Should be attached to gamemode entity. More...

Typedefs

typedef func OnFactionCommanderChangedDelegate
typedef ScriptInvokerBase< OnFactionCommanderChangedDelegateOnFactionCommanderChangedInvoker

Functions

void OnFactionCommanderChangedDelegate (SCR_Faction faction, int commanderPlayerId)
SCR_FactionCommanderHandlerComponentClass SCR_BaseGameModeComponentClass Attribute ("600", desc:"How often can a player volunteer for the Commander role (seconds).", params:"0 inf 1")
OnFactionCommanderChangedInvoker GetOnFactionCommanderChanged ()
int GetVolunteerCooldown ()
WorldTimestamp GetFactionCooldown (int factionIndex)
bool CheckRank ()
SCR_ECharacterRank GetMinimumRank ()
void SetGroupForOldCommander (int oldCommanderId)
void SetGroupForNewCommander (int newCommanderId)
void SetFactionCommander (notnull SCR_Faction faction, int commanderPlayerId)
void RpcDo_FactionCooldown (int factionIdx, WorldTimestamp timeStamp)
void OnFactionCommanderChanged ()
void OnServerCommanderChanged (int newCommanderId, int oldCommanderId)
void OnPlayerFactionChanged (int playerId, SCR_PlayerFactionAffiliationComponent playerFactionAffiliationComponent, Faction faction)
 Unregister player from Commander role when they change factions.
void OnVotingStart (EVotingType type, int value)
void OnVotingEnd (EVotingType type, int value, int winner)
void SetNextVolunteeringTimestamp (int playerId, WorldTimestamp timestamp)
void DisableVolunteerCooldown (int playerId, KickCauseCode cause)
override void OnPlayerRegistered (int playerId)
override void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
 Unregister player from Commander role when they disconnect.
override void OnGameModeStart ()
override void OnGameEnd ()
 Called on all machines when the world ends.
override void EOnInit (IEntity owner)
override void OnPostInit (IEntity owner)
 Editable Mine.

Variables

RplComponent m_RplComponent
ref map< int, WorldTimestampm_mReplaceCommanderCooldowns = new map<int, WorldTimestamp>()

Typedef Documentation

◆ OnFactionCommanderChangedDelegate

◆ OnFactionCommanderChangedInvoker

Function Documentation

◆ Attribute()

SCR_FactionCommanderHandlerComponentClass SCR_BaseGameModeComponentClass Attribute ( "600" ,
desc:"How often can a player volunteer for the Commander role (seconds)." ,
params:"0 inf 1"  )

Definition at line 3 of file SCR_FactionCommanderHandlerComponent.c.

◆ CheckRank()

bool CheckRank ( )
protected

Definition at line 72 of file SCR_FactionCommanderHandlerComponent.c.

◆ DisableVolunteerCooldown()

void DisableVolunteerCooldown ( int playerId,
KickCauseCode cause )
protected

Definition at line 411 of file SCR_FactionCommanderHandlerComponent.c.

◆ GetFactionCooldown()

WorldTimestamp GetFactionCooldown ( int factionIndex)
protected

Definition at line 66 of file SCR_FactionCommanderHandlerComponent.c.

◆ GetMinimumRank()

SCR_ECharacterRank GetMinimumRank ( )
protected

Definition at line 78 of file SCR_FactionCommanderHandlerComponent.c.

◆ GetOnFactionCommanderChanged()

OnFactionCommanderChangedInvoker GetOnFactionCommanderChanged ( )
protected

Definition at line 51 of file SCR_FactionCommanderHandlerComponent.c.

◆ GetVolunteerCooldown()

int GetVolunteerCooldown ( )
protected

Definition at line 60 of file SCR_FactionCommanderHandlerComponent.c.

◆ OnFactionCommanderChanged()

void OnFactionCommanderChanged ( )
protected

Definition at line 260 of file SCR_FactionCommanderHandlerComponent.c.

◆ OnFactionCommanderChangedDelegate()

void OnFactionCommanderChangedDelegate ( SCR_Faction faction,
int commanderPlayerId )

◆ OnGameEnd()

override void OnGameEnd ( )
protected

Called on all machines when the world ends.

Definition at line 510 of file SCR_FactionCommanderHandlerComponent.c.

◆ OnGameModeStart()

override void OnGameModeStart ( )
protected

Called on every machine when game mode starts. This can be immediate (if no pre-game period is set) or can happen after a certain delay, as deemed appropriate by the authority.

Definition at line 498 of file SCR_FactionCommanderHandlerComponent.c.

◆ OnPlayerDisconnected()

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

Unregister player from Commander role when they disconnect.

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 450 of file SCR_FactionCommanderHandlerComponent.c.

◆ OnPlayerFactionChanged()

void OnPlayerFactionChanged ( int playerId,
SCR_PlayerFactionAffiliationComponent playerFactionAffiliationComponent,
Faction faction )
protected

Unregister player from Commander role when they change factions.

Definition at line 326 of file SCR_FactionCommanderHandlerComponent.c.

◆ OnPlayerRegistered()

override void OnPlayerRegistered ( int playerId)
protected

Called on every machine after a player is registered (identity, name etc.). Always called after OnPlayerConnected.

Parameters
[in]playerIdPlayerId of registered player.

Definition at line 440 of file SCR_FactionCommanderHandlerComponent.c.

◆ OnServerCommanderChanged()

void OnServerCommanderChanged ( int newCommanderId,
int oldCommanderId )
protected

Definition at line 318 of file SCR_FactionCommanderHandlerComponent.c.

◆ OnVotingEnd()

void OnVotingEnd ( EVotingType type,
int value,
int winner )
protected

Definition at line 376 of file SCR_FactionCommanderHandlerComponent.c.

◆ OnVotingStart()

void OnVotingStart ( EVotingType type,
int value )
protected

Definition at line 360 of file SCR_FactionCommanderHandlerComponent.c.

◆ RpcDo_FactionCooldown()

void RpcDo_FactionCooldown ( int factionIdx,
WorldTimestamp timeStamp )
protected

Definition at line 234 of file SCR_FactionCommanderHandlerComponent.c.

◆ SetFactionCommander()

void SetFactionCommander ( notnull SCR_Faction faction,
int commanderPlayerId )
protected

Definition at line 177 of file SCR_FactionCommanderHandlerComponent.c.

◆ SetGroupForNewCommander()

void SetGroupForNewCommander ( int newCommanderId)
protected

Sets the commander to his special commander group

Parameters
[in]oldcommander id

Definition at line 138 of file SCR_FactionCommanderHandlerComponent.c.

◆ SetGroupForOldCommander()

void SetGroupForOldCommander ( int oldCommanderId)
protected

Sets the commander to his previous group if exists and if there is a free slot, otherwise a new group will be created for him

Parameters
[in]oldCommanderId

Definition at line 86 of file SCR_FactionCommanderHandlerComponent.c.

◆ SetNextVolunteeringTimestamp()

void SetNextVolunteeringTimestamp ( int playerId,
WorldTimestamp timestamp )
protected

Definition at line 395 of file SCR_FactionCommanderHandlerComponent.c.

Variable Documentation

◆ m_mReplaceCommanderCooldowns

ref map<int, WorldTimestamp> m_mReplaceCommanderCooldowns = new map<int, WorldTimestamp>()
protected

Definition at line 37 of file SCR_FactionCommanderHandlerComponent.c.

◆ m_RplComponent

RplComponent m_RplComponent
protected

Definition at line 35 of file SCR_FactionCommanderHandlerComponent.c.