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

Go to the source code of this file.

Data Structures

class  SCR_GroupsManagerComponentClass
 

Typedefs

typedef set< FactionFactionHolder
 

Functions

SCR_GroupsManagerComponentClass SCR_BaseGameModeComponentClass Attribute ()] protected ResourceName m_sDefaultGroupPrefab
 Post-process effect of scripted camera. More...
 
void GetGroupFlags (notnull array< ResourceName > targetArray)
 
ScriptInvoker GetOnPlayableGroupCreated ()
 
protected bool IsProxy ()
 
int MovePlayerToGroup (int playerID, int previousGroupID, int newGroupID)
 
void ClearRequests (int groupID, int playerID)
 
int AddPlayerToGroup (int groupID, int playerID)
 
void CreatePredefinedGroups ()
 
void SetGroupLeader (int groupID, int playerID)
 
void SetNewGroupsAllowed (bool isAllowed)
 called on server only More...
 
void RPC_DoSetNewGroupsAllowed (bool isAllowed)
 
void SetCanPlayersChangeAttributes (bool isAllowed)
 called on server only More...
 
void RPC_SetCanPlayersChangeAttributes (bool isAllowed)
 
void SetPrivateGroup (int groupID, bool isPrivate)
 
SCR_AIGroup FindGroup (int groupID)
 
ScriptInvoker GetOnPlayableGroupRemoved ()
 
ScriptInvoker GetOnNewGroupsAllowedChanged ()
 
ScriptInvoker GetOnCanPlayersChangeAttributeChanged ()
 
SCR_AIGroup GetPlayerGroup (int playerID)
 
bool IsPlayerInAnyGroup (int playerID)
 
array< SCR_AIGroupGetPlayableGroupsByFaction (Faction faction)
 
void GetAllPlayableGroups (out array< SCR_AIGroup > outAllGroups)
 
protected void AssignGroupFrequency (notnull SCR_AIGroup group)
 
void DeleteGroupDelayed (SCR_AIGroup group)
 
void OnGroupPlayerRemoved (SCR_AIGroup group, int playerID)
 
void OnGroupPlayerAdded (SCR_AIGroup group, int playerID)
 
private BaseRadioComponent GetCommunicationDevice (notnull IEntity controlledEntity)
 Returns a gadget of EGadgetType.RADIO. More...
 
private void TuneAgentsRadio (AIAgent agentEntity)
 
void OnGroupAgentAdded (AIAgent child)
 
void OnGroupAgentRemoved (SCR_AIGroup group, AIAgent child)
 
void DeleteAndUnregisterGroup (notnull SCR_AIGroup group)
 
void UnregisterGroup (notnull SCR_AIGroup group)
 
void RegisterGroup (SCR_AIGroup group)
 
void RPC_DoSetGroupFaction (RplId groupID, int factionIndex)
 
protected void AssignGroupID (SCR_AIGroup group)
 
void OnPlayerFactionChanged (notnull FactionAffiliationComponent owner, Faction previousFaction, Faction newFaction)
 Is called only on the server (authority) More...
 
void OnGroupCreated (SCR_AIGroup group)
 Called on clients (proxies) to notice a playable group has been created. More...
 
SCR_AIGroup TryFindEmptyGroup (notnull Faction faction)
 
SCR_AIGroup CreateNewPlayableGroup (Faction faction)
 
SCR_AIGroup GetFirstNotFullForFaction (notnull Faction faction, SCR_AIGroup ownGroup=null, bool respectPrivate=false)
 
bool CanCreateNewGroup (notnull Faction newGroupFaction)
 
bool CanPlayersChangeAttributes ()
 
int GetFreeFrequency (Faction frequencyFaction)
 
void ClaimFrequency (int frequency, Faction faction)
 
bool IsFrequencyClaimed (int frequency, Faction faction)
 
void ReleaseFrequency (int frequency, Faction faction)
 
void RequestSetGroupSlave (RplId compID, RplId slaveID)
 
void RpcWrapper (RplId compID, RplId slaveID)
 
void RPC_DoSetGroupSlave (RplId masterGroupID, RplId slaveGroupID)
 
void RPC_DoRemoveAIMemberFromGroup (RplId groupRplCompID, RplId aiCharacterComponentID)
 
void GetAIMembers (RplId groupRplCompID, RplId aiCharacterComponentID, out array< SCR_ChimeraCharacter > members, out SCR_ChimeraCharacter AIMember)
 
void AskRemoveAiMemberFromGroup (RplId groupRplCompID, RplId aiCharacterComponentID)
 
void AskAddAiMemberToGroup (RplId groupRplCompID, RplId aiCharacterComponentID)
 
void RPC_DoAddAIMemberToGroup (RplId groupRplCompID, RplId aiCharacterComponentID)
 
void OnAIMemberRemoved (SCR_AIGroup group, AIAgent agent)
 
bool GetConfirmedByPlayer ()
 
bool GetNewGroupsAllowed ()
 
void SetConfirmedByPlayer (bool isConfirmed)
 
override void EOnFrame (IEntity owner, float timeSlice)
 
void DeleteGroups ()
 
void TunePlayersFrequency (int playerId, IEntity player)
 
protected override void OnPlayerRegistered (int playerId)
 Register provided client's respawn timer. More...
 
protected override void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
 
void OnPlayerReconnected (SCR_ReconnectData reconnectData)
 
override void OnPostInit (IEntity owner)
 Editable Mine. More...
 
override void EOnInit (IEntity owner)
 Initialise this component with data from FactionsManager. More...
 
void SCR_GroupsManagerComponent (IEntityComponentSource src, IEntity ent, IEntity parent)
 
void ~SCR_GroupsManagerComponent ()
 

Variables

protected int m_iPlayableGroupFrequencyOffset
 
protected int m_iPlayableGroupFrequencyMin
 
protected int m_iPlayableGroupFrequencyMax
 
private ref array< ResourceName > m_aGroupFlags
 
protected bool m_bConfirmedByPlayer
 
protected bool m_bNewGroupsAllowed = true
 
protected bool m_bCanPlayersChangeAttributes = true
 
protected ref ScriptInvoker m_OnPlayableGroupCreated = new ScriptInvoker()
 
protected ref ScriptInvoker m_OnPlayableGroupRemoved = new ScriptInvoker()
 
protected ref ScriptInvoker m_OnNewGroupsAllowedChanged = new ScriptInvoker()
 
protected ref ScriptInvoker m_OnCanPlayersChangeAttributeChanged = new ScriptInvoker()
 
protected int m_iLatestGroupID = 0
 
protected ref map< Faction, ref array< SCR_AIGroup > > m_mPlayableGroups = new map<Faction, ref array<SCR_AIGroup>>()
 
protected ref map< Faction, intm_mPlayableGroupFrequencies = new map<Faction, int>()
 
protected ref map< int, ref FactionHolderm_mUsedFrequenciesMap = new map<int, ref FactionHolder>()
 
protected ref array< SCR_AIGroupm_aDeletionQueue = {}
 
protected int m_iMovingPlayerToGroupID = -1
 

Typedef Documentation

◆ FactionHolder

typedef set<Faction> FactionHolder

Definition at line 1 of file SCR_GroupsManagerComponent.c.

Function Documentation

◆ AddPlayerToGroup()

int AddPlayerToGroup ( int  groupID,
int  playerID 
)
Parameters
[in]groupID
[in]playerID
Returns

Definition at line 144 of file SCR_GroupsManagerComponent.c.

◆ AskAddAiMemberToGroup()

void AskAddAiMemberToGroup ( RplId  groupRplCompID,
RplId  aiCharacterComponentID 
)
Parameters
[in]groupRplCompID
[in]aiCharacterComponentID

Definition at line 1115 of file SCR_GroupsManagerComponent.c.

◆ AskRemoveAiMemberFromGroup()

void AskRemoveAiMemberFromGroup ( RplId  groupRplCompID,
RplId  aiCharacterComponentID 
)
Parameters
[in]groupRplCompID
[in]aiCharacterComponentID

Definition at line 1105 of file SCR_GroupsManagerComponent.c.

◆ AssignGroupFrequency()

protected void AssignGroupFrequency ( notnull SCR_AIGroup  group)

Definition at line 436 of file SCR_GroupsManagerComponent.c.

◆ AssignGroupID()

protected void AssignGroupID ( SCR_AIGroup  group)

Definition at line 713 of file SCR_GroupsManagerComponent.c.

◆ CanCreateNewGroup()

bool CanCreateNewGroup ( notnull Faction  newGroupFaction)
Parameters
[in]newGroupFaction
Returns

Definition at line 878 of file SCR_GroupsManagerComponent.c.

◆ CanPlayersChangeAttributes()

bool CanPlayersChangeAttributes ( )
Returns

Definition at line 906 of file SCR_GroupsManagerComponent.c.

◆ ClaimFrequency()

void ClaimFrequency ( int  frequency,
Faction  faction 
)
Parameters
[in]frequency
[in]faction

Definition at line 954 of file SCR_GroupsManagerComponent.c.

◆ ClearRequests()

void ClearRequests ( int  groupID,
int  playerID 
)
Parameters
[in]groupID
[in]playerID

Definition at line 115 of file SCR_GroupsManagerComponent.c.

◆ CreateNewPlayableGroup()

SCR_AIGroup CreateNewPlayableGroup ( Faction  faction)
Parameters
[in]faction
Returns

Definition at line 788 of file SCR_GroupsManagerComponent.c.

◆ CreatePredefinedGroups()

void CreatePredefinedGroups ( )

Definition at line 159 of file SCR_GroupsManagerComponent.c.

◆ DeleteAndUnregisterGroup()

void DeleteAndUnregisterGroup ( notnull SCR_AIGroup  group)
Parameters
[in]group

Definition at line 623 of file SCR_GroupsManagerComponent.c.

◆ DeleteGroupDelayed()

void DeleteGroupDelayed ( SCR_AIGroup  group)
Parameters
[in]group

Definition at line 452 of file SCR_GroupsManagerComponent.c.

◆ DeleteGroups()

void DeleteGroups ( )

Definition at line 1193 of file SCR_GroupsManagerComponent.c.

◆ EOnFrame()

override void EOnFrame ( IEntity  owner,
float  timeSlice 
)

Definition at line 1186 of file SCR_GroupsManagerComponent.c.

◆ FindGroup()

SCR_AIGroup FindGroup ( int  groupID)
Parameters
[in]groupID
Returns

Definition at line 279 of file SCR_GroupsManagerComponent.c.

◆ GetAIMembers()

void GetAIMembers ( RplId  groupRplCompID,
RplId  aiCharacterComponentID,
out array< SCR_ChimeraCharacter >  members,
out SCR_ChimeraCharacter  AIMember 
)
Parameters
[in]groupRplCompID
[in]aiCharacterComponentID
[out]members
[out]AIMember

Definition at line 1080 of file SCR_GroupsManagerComponent.c.

◆ GetAllPlayableGroups()

void GetAllPlayableGroups ( out array< SCR_AIGroup outAllGroups)
Parameters
[out]outAllGroups

Definition at line 417 of file SCR_GroupsManagerComponent.c.

◆ GetCommunicationDevice()

private BaseRadioComponent GetCommunicationDevice ( notnull IEntity  controlledEntity)

Returns a gadget of EGadgetType.RADIO.

Definition at line 536 of file SCR_GroupsManagerComponent.c.

◆ GetConfirmedByPlayer()

bool GetConfirmedByPlayer ( )
Returns

Definition at line 1166 of file SCR_GroupsManagerComponent.c.

◆ GetFirstNotFullForFaction()

SCR_AIGroup GetFirstNotFullForFaction ( notnull Faction  faction,
SCR_AIGroup  ownGroup = null,
bool  respectPrivate = false 
)
Parameters
[in]faction
[in]ownGroup
[in]respectPrivate
Returns

Definition at line 855 of file SCR_GroupsManagerComponent.c.

◆ GetFreeFrequency()

int GetFreeFrequency ( Faction  frequencyFaction)
Parameters
[in]frequencyFaction
Returns

Definition at line 914 of file SCR_GroupsManagerComponent.c.

◆ GetGroupFlags()

void GetGroupFlags ( notnull array< ResourceName >  targetArray)
Parameters
[in]targetArray

Definition at line 57 of file SCR_GroupsManagerComponent.c.

◆ GetNewGroupsAllowed()

bool GetNewGroupsAllowed ( )
Returns

Definition at line 1173 of file SCR_GroupsManagerComponent.c.

◆ GetOnCanPlayersChangeAttributeChanged()

ScriptInvoker GetOnCanPlayersChangeAttributeChanged ( )
Returns

Definition at line 312 of file SCR_GroupsManagerComponent.c.

◆ GetOnNewGroupsAllowedChanged()

ScriptInvoker GetOnNewGroupsAllowedChanged ( )
Returns

Definition at line 304 of file SCR_GroupsManagerComponent.c.

◆ GetOnPlayableGroupCreated()

ScriptInvoker GetOnPlayableGroupCreated ( )
Returns

Definition at line 64 of file SCR_GroupsManagerComponent.c.

◆ GetOnPlayableGroupRemoved()

ScriptInvoker GetOnPlayableGroupRemoved ( )
Returns

Definition at line 296 of file SCR_GroupsManagerComponent.c.

◆ GetPlayableGroupsByFaction()

array<SCR_AIGroup> GetPlayableGroupsByFaction ( Faction  faction)
Parameters
[in]faction
Returns

Definition at line 410 of file SCR_GroupsManagerComponent.c.

◆ GetPlayerGroup()

SCR_AIGroup GetPlayerGroup ( int  playerID)
Parameters
[in]playerID
Returns

Definition at line 322 of file SCR_GroupsManagerComponent.c.

◆ IsFrequencyClaimed()

bool IsFrequencyClaimed ( int  frequency,
Faction  faction 
)
Parameters
[in]frequency
[in]faction
Returns

Definition at line 976 of file SCR_GroupsManagerComponent.c.

◆ IsPlayerInAnyGroup()

bool IsPlayerInAnyGroup ( int  playerID)
Parameters
[in]playerID
Returns

Definition at line 350 of file SCR_GroupsManagerComponent.c.

◆ IsProxy()

protected bool IsProxy ( )

Definition at line 69 of file SCR_GroupsManagerComponent.c.

◆ MovePlayerToGroup()

int MovePlayerToGroup ( int  playerID,
int  previousGroupID,
int  newGroupID 
)
Parameters
[in]playerID
[in]previousGroupID
[in]newGroupID
Returns

Definition at line 84 of file SCR_GroupsManagerComponent.c.

◆ OnAIMemberRemoved()

void OnAIMemberRemoved ( SCR_AIGroup  group,
AIAgent  agent 
)
Parameters
[in]group
[in]agent

Definition at line 1140 of file SCR_GroupsManagerComponent.c.

◆ OnGroupAgentAdded()

void OnGroupAgentAdded ( AIAgent  child)
Parameters
[in]child

Definition at line 573 of file SCR_GroupsManagerComponent.c.

◆ OnGroupAgentRemoved()

void OnGroupAgentRemoved ( SCR_AIGroup  group,
AIAgent  child 
)
Parameters
[in]group
[in]child

Definition at line 581 of file SCR_GroupsManagerComponent.c.

◆ OnGroupCreated()

void OnGroupCreated ( SCR_AIGroup  group)

Called on clients (proxies) to notice a playable group has been created.

Definition at line 757 of file SCR_GroupsManagerComponent.c.

◆ OnGroupPlayerAdded()

void OnGroupPlayerAdded ( SCR_AIGroup  group,
int  playerID 
)
Parameters
[in]group
[in]playerID

Definition at line 491 of file SCR_GroupsManagerComponent.c.

◆ OnGroupPlayerRemoved()

void OnGroupPlayerRemoved ( SCR_AIGroup  group,
int  playerID 
)
Parameters
[in]group
[in]playerID

Definition at line 461 of file SCR_GroupsManagerComponent.c.

◆ OnPlayerFactionChanged()

void OnPlayerFactionChanged ( notnull FactionAffiliationComponent  owner,
Faction  previousFaction,
Faction  newFaction 
)

Is called only on the server (authority)

Definition at line 721 of file SCR_GroupsManagerComponent.c.

◆ OnPlayerReconnected()

void OnPlayerReconnected ( SCR_ReconnectData  reconnectData)
Parameters
[in]reconnectData

Definition at line 1264 of file SCR_GroupsManagerComponent.c.

◆ RegisterGroup()

void RegisterGroup ( SCR_AIGroup  group)
Parameters
[in]group

Definition at line 675 of file SCR_GroupsManagerComponent.c.

◆ ReleaseFrequency()

void ReleaseFrequency ( int  frequency,
Faction  faction 
)
Parameters
[in]frequency
[in]faction

Definition at line 992 of file SCR_GroupsManagerComponent.c.

◆ RequestSetGroupSlave()

void RequestSetGroupSlave ( RplId  compID,
RplId  slaveID 
)
Parameters
[in]compID
[in]slaveID

Definition at line 1015 of file SCR_GroupsManagerComponent.c.

◆ RPC_DoAddAIMemberToGroup()

void RPC_DoAddAIMemberToGroup ( RplId  groupRplCompID,
RplId  aiCharacterComponentID 
)
Parameters
[in]groupRplCompID
[in]aiCharacterComponentID

Definition at line 1126 of file SCR_GroupsManagerComponent.c.

◆ RPC_DoRemoveAIMemberFromGroup()

void RPC_DoRemoveAIMemberFromGroup ( RplId  groupRplCompID,
RplId  aiCharacterComponentID 
)
Parameters
[in]groupRplCompID
[in]aiCharacterComponentID

Definition at line 1064 of file SCR_GroupsManagerComponent.c.

◆ RPC_DoSetGroupFaction()

void RPC_DoSetGroupFaction ( RplId  groupID,
int  factionIndex 
)
Parameters
[in]groupID
[in]factionIndex

Definition at line 697 of file SCR_GroupsManagerComponent.c.

◆ RPC_DoSetGroupSlave()

void RPC_DoSetGroupSlave ( RplId  masterGroupID,
RplId  slaveGroupID 
)
Parameters
[in]masterGroupID
[in]slaveGroupID

Definition at line 1036 of file SCR_GroupsManagerComponent.c.

◆ RPC_DoSetNewGroupsAllowed()

void RPC_DoSetNewGroupsAllowed ( bool  isAllowed)
Parameters
[in]isAllowed

Definition at line 229 of file SCR_GroupsManagerComponent.c.

◆ RPC_SetCanPlayersChangeAttributes()

void RPC_SetCanPlayersChangeAttributes ( bool  isAllowed)
Parameters
[in]isAllowed

Definition at line 253 of file SCR_GroupsManagerComponent.c.

◆ RpcWrapper()

void RpcWrapper ( RplId  compID,
RplId  slaveID 
)
Parameters
[in]compID
[in]slaveID

Definition at line 1026 of file SCR_GroupsManagerComponent.c.

◆ SCR_GroupsManagerComponent()

void SCR_GroupsManagerComponent ( IEntityComponentSource  src,
IEntity  ent,
IEntity  parent 
)
Parameters
[in]src
[in]ent
[in]parent

Definition at line 1320 of file SCR_GroupsManagerComponent.c.

◆ SetCanPlayersChangeAttributes()

void SetCanPlayersChangeAttributes ( bool  isAllowed)

called on server only

Definition at line 240 of file SCR_GroupsManagerComponent.c.

◆ SetConfirmedByPlayer()

void SetConfirmedByPlayer ( bool  isConfirmed)
Parameters
[in]isConfirmed

Definition at line 1180 of file SCR_GroupsManagerComponent.c.

◆ SetGroupLeader()

void SetGroupLeader ( int  groupID,
int  playerID 
)
Parameters
[in]groupID
[in]playerID

Definition at line 206 of file SCR_GroupsManagerComponent.c.

◆ SetNewGroupsAllowed()

void SetNewGroupsAllowed ( bool  isAllowed)

called on server only

Definition at line 216 of file SCR_GroupsManagerComponent.c.

◆ SetPrivateGroup()

void SetPrivateGroup ( int  groupID,
bool  isPrivate 
)
Parameters
[in]groupID
[in]isPrivate

Definition at line 266 of file SCR_GroupsManagerComponent.c.

◆ TryFindEmptyGroup()

SCR_AIGroup TryFindEmptyGroup ( notnull Faction  faction)
Parameters
[in]faction
Returns

Definition at line 766 of file SCR_GroupsManagerComponent.c.

◆ TuneAgentsRadio()

private void TuneAgentsRadio ( AIAgent  agentEntity)

Definition at line 550 of file SCR_GroupsManagerComponent.c.

◆ TunePlayersFrequency()

void TunePlayersFrequency ( int  playerId,
IEntity  player 
)
Parameters
[in]playerId
[in]player

Definition at line 1208 of file SCR_GroupsManagerComponent.c.

◆ UnregisterGroup()

void UnregisterGroup ( notnull SCR_AIGroup  group)
Parameters
[in]group

Definition at line 633 of file SCR_GroupsManagerComponent.c.

◆ ~SCR_GroupsManagerComponent()

Definition at line 1328 of file SCR_GroupsManagerComponent.c.

Variable Documentation

◆ m_aDeletionQueue

protected ref array<SCR_AIGroup> m_aDeletionQueue = {}

Definition at line 45 of file SCR_GroupsManagerComponent.c.

◆ m_aGroupFlags

private ref array<ResourceName> m_aGroupFlags

Definition at line 23 of file SCR_GroupsManagerComponent.c.

◆ m_bCanPlayersChangeAttributes

protected bool m_bCanPlayersChangeAttributes = true

Definition at line 29 of file SCR_GroupsManagerComponent.c.

◆ m_bConfirmedByPlayer

protected bool m_bConfirmedByPlayer

Definition at line 26 of file SCR_GroupsManagerComponent.c.

◆ m_bNewGroupsAllowed

protected bool m_bNewGroupsAllowed = true

Definition at line 28 of file SCR_GroupsManagerComponent.c.

◆ m_iLatestGroupID

protected int m_iLatestGroupID = 0

Definition at line 41 of file SCR_GroupsManagerComponent.c.

◆ m_iMovingPlayerToGroupID

protected int m_iMovingPlayerToGroupID = -1

Definition at line 46 of file SCR_GroupsManagerComponent.c.

◆ m_iPlayableGroupFrequencyMax

protected int m_iPlayableGroupFrequencyMax

Definition at line 20 of file SCR_GroupsManagerComponent.c.

◆ m_iPlayableGroupFrequencyMin

protected int m_iPlayableGroupFrequencyMin

Definition at line 17 of file SCR_GroupsManagerComponent.c.

◆ m_iPlayableGroupFrequencyOffset

protected int m_iPlayableGroupFrequencyOffset

Definition at line 14 of file SCR_GroupsManagerComponent.c.

◆ m_mPlayableGroupFrequencies

protected ref map<Faction, int> m_mPlayableGroupFrequencies = new map<Faction, int>()

Definition at line 43 of file SCR_GroupsManagerComponent.c.

◆ m_mPlayableGroups

protected ref map<Faction, ref array<SCR_AIGroup> > m_mPlayableGroups = new map<Faction, ref array<SCR_AIGroup>>()

Definition at line 42 of file SCR_GroupsManagerComponent.c.

◆ m_mUsedFrequenciesMap

protected ref map<int, ref FactionHolder> m_mUsedFrequenciesMap = new map<int, ref FactionHolder>()

Definition at line 44 of file SCR_GroupsManagerComponent.c.

◆ m_OnCanPlayersChangeAttributeChanged

protected ref ScriptInvoker m_OnCanPlayersChangeAttributeChanged = new ScriptInvoker()

Definition at line 40 of file SCR_GroupsManagerComponent.c.

◆ m_OnNewGroupsAllowedChanged

protected ref ScriptInvoker m_OnNewGroupsAllowedChanged = new ScriptInvoker()

Definition at line 39 of file SCR_GroupsManagerComponent.c.

◆ m_OnPlayableGroupCreated

protected ref ScriptInvoker m_OnPlayableGroupCreated = new ScriptInvoker()

Definition at line 37 of file SCR_GroupsManagerComponent.c.

◆ m_OnPlayableGroupRemoved

protected ref ScriptInvoker m_OnPlayableGroupRemoved = new ScriptInvoker()

Definition at line 38 of file SCR_GroupsManagerComponent.c.