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

Go to the source code of this file.

Enumerations

enum  EGameFlags { Metabolism = 1, SpawnVehicles = 2, SpawnAI = 4, Last = 4 }
 GameMode Game Flags represented by bit mask. More...
 

Functions

void ~ArmaReforgerScripted ()
 
SCR_DataCollectorComponent GetDataCollector ()
 
SCR_ResourceGrid GetResourceGrid ()
 
SCR_ResourceSystemSubscriptionManager GetResourceSystemSubscriptionManager ()
 
void RegisterDataCollector (SCR_DataCollectorComponent instance)
 
void UnregisterBuildingDestructionManager (notnull SCR_BuildingDestructionManagerComponent manager)
 
void RegisterBuildingDestructionManager (notnull SCR_BuildingDestructionManagerComponent manager)
 
SCR_BuildingDestructionManagerComponent GetBuildingDestructionManager ()
 
SCR_LoadoutManager GetLoadoutManager ()
 
void RegisterSoundManagerEntity (SCR_SoundManagerEntity instance)
 
SCR_SoundManagerEntity GetSoundManagerEntity ()
 
SCR_SettingsManager GetSettingsManager ()
 
SCR_ProfaneFilter GetProfanityFilter ()
 
SCR_SaveManagerCore GetSaveManager ()
 
bool GetHasKeyboard ()
 
ScriptCallQueue GetCallqueue ()
 
ScriptInvoker OnUserSettingsChangedInvoker ()
 
ScriptInvoker OnInputDeviceUserChangedInvoker ()
 
ScriptInvoker OnInputDeviceIsGamepadInvoker ()
 
ScriptInvoker OnWorldSimulatePhysicsInvoker ()
 
ScriptInvoker OnWindowResizeInvoker ()
 
override bool GetIsClientAuthority ()
 
override protected void OnMissionSet (MissionHeader mission)
 
override void OnCinematicStart ()
 
override void OnCinematicEnd ()
 
override void OnCinematicBlending (float blendFactor, vector cameraPosition)
 
override protected void OnKickedFromGame (KickCauseCode kickCode)
 Called after player was kicked from game back to main menu, providing reason for the kick. More...
 
bool GetFullKickReason (KickCauseCode kickCode, out KickCauseGroup2 groupInt, out int reasonInt, out string group, out string reason)
 
protected void AddRejoinAttempt ()
 
protected override void OnWorldPostProcess (World world)
 
protected override void ShowErrorMessage (string msg)
 
protected void ShowNextErrorDialog ()
 
bool GetGameStarted ()
 
EGameFlags GetGameFlags ()
 
void SetGameFlags (EGameFlags newGameFlags, bool shouldInvoke)
 
bool AreGameFlagsObtained ()
 
bool AreGameFlagsSet (EGameFlags checkGameFlags)
 
ScriptInvoker GetOnObtainedGameFlagsInvoker ()
 
protected void InvokeGameFlags ()
 
override GetMenuPreset ()
 
override LoadingAnim CreateLoadingAnim (WorkspaceWidget workspaceWidget)
 
override void OnAfterInit (BaseWorld world)
 
override bool OnGameStart ()
 Gets called after world is initialized but before first ticks. More...
 
override void OnGameEnd ()
 Called on all machines when the world ends. More...
 
override void OnUserSettingsChangedEvent ()
 
override void OnInputDeviceUserChangedEvent (EInputDeviceType oldDevice, EInputDeviceType newDevice)
 
override void OnInputDeviceIsGamepadEvent (bool isGamepad)
 
override void OnWorldSimulatePhysics (float timeSlice)
 
override event void OnWindowResize (int w, int h, bool windowed)
 
void AddActionListeners ()
 
void RemoveActionListeners ()
 
override void OnUpdate (BaseWorld world, float timeslice)
 
void ShutdownBackend ()
 
void SetHUDManager (SCR_HUDManagerComponent hud)
 
void LoadSave (string fileName)
 
void RegisterLoadoutManager (SCR_LoadoutManager instance)
 
void UnregisterLoadoutManager (SCR_LoadoutManager instance)
 
SCR_HUDManagerComponent GetHUDManager ()
 
override protected ref Managed GetPlayerDataStats (int playerID)
 
override string GetMissionName ()
 
override void PlayGameConfig (ResourceName sResource, string addonsList)
 
override void HostGameConfig ()
 
override Managed ReadGameConfig (string sResource)
 
override array< ResourceName > GetDefaultGameConfigs ()
 
protected void InsertNewScenario (ResourceName scenario, inout array< ResourceName > resources)
 
bool IsPlatformGameConsole ()
 
override void OnGamepadConnectionStatus (bool isConnected)
 
Game CreateGame ()
 
ArmaReforgerScripted GetGame ()
 

Variables

enum EGameFlags CONFIG_CORES_PATH = "Configs/Core/"
 Enum of DiagMenu id values, generated by Game. More...
 
const ResourceName CONFIG_DIALOGS_ERROR = "{D3BFEE28E7D5B6A1}Configs/ServerBrowser/KickDialogs.conf"
 
protected EGameFlags m_eGameFlags
 Game Flags specific for current game mode, or for the game mode which is going to be played when it is a host/server side. More...
 
protected bool m_bAreGameFlagsObtained
 
protected ref ScriptInvoker Event_OnObtainedGameFlags = new ScriptInvoker()
 
protected SCR_HUDManagerComponent m_HUDManager
 
protected ScriptedChatEntity m_ChatEntity
 
protected ref SCR_GameCoresManager m_CoresManager
 
protected ref SCR_SettingsManager m_SettingsManager
 
protected ref SCR_ProfaneFilter m_ProfanityFilter
 
protected SCR_SaveManagerCore m_SaveManagerCore
 
protected SCR_BuildingDestructionManagerComponent m_BuildingDestructionManager
 
protected SCR_SpawnerAIGroupManagerComponent m_SpawnerAIGroupManager
 
protected bool m_bHasKeyboard
 
protected SCR_LoadoutManager m_pLoadoutManager
 Object responsible for managing and providing game modes with list of available loadouts. More...
 
protected SCR_DataCollectorComponent m_DataCollectorComponent
 Object responsible for tracking and connecting to the database for Career Profile. More...
 
protected SCR_SoundManagerEntity m_SoundManagerEntity
 Object responsible for managing sounds trigged in script. More...
 
ref ScriptInvoker m_OnMissionSetInvoker = new ScriptInvoker()
 
ref RplSessionErrorHandler m_SessionErrorHandler
 
bool m_bIsMainMenuOpen = false
 
private bool m_bGameStarted = false
 
protected ref SCR_Stack< SCR_GameErrorMessagem_aErrorStack = new SCR_Stack<SCR_GameErrorMessage>()
 Stack of queued error messages. All messages are popped one by one as user closes them and only in the main menu. More...
 
protected ref ScriptInvoker m_OnChangeUserSettingsInvoker = new ScriptInvoker()
 
protected ref ScriptInvoker m_OnInputDeviceUserChangedInvoker = new ScriptInvoker()
 
protected ref ScriptInvoker m_OnInputDeviceIsGamepadInvoker = new ScriptInvoker()
 
protected ref ScriptInvoker m_OnWorldSimulatePhysicsInvoker = new ScriptInvoker()
 
protected ref ScriptInvoker< int, int, bool > m_OnWindowResizeInvoker = new ScriptInvoker()
 
protected ref ScriptCallQueue m_Callqueue = new ScriptCallQueue()
 
protected ref SCR_ResourceGrid m_ResourceGrid
 
protected ref SCR_ResourceSystemSubscriptionManager m_ResourceSystemSubscriptionManager
 
ArmaReforgerScripted g_ARGame
 

Enumeration Type Documentation

◆ EGameFlags

enum EGameFlags

GameMode Game Flags represented by bit mask.

Enumerator
Metabolism 
SpawnVehicles 
SpawnAI 
Last 

Definition at line 16 of file game.c.

Function Documentation

◆ AddActionListeners()

void AddActionListeners ( )

Definition at line 846 of file game.c.

◆ AddRejoinAttempt()

protected void AddRejoinAttempt ( )

Definition at line 457 of file game.c.

◆ AreGameFlagsObtained()

bool AreGameFlagsObtained ( )

You should normally register to GetOnObtainedGameFlagsInvoker() but this is available for cases where registration is not possible.

See also
GetOnObtainedGameFlagsInvoker()
Returns

Definition at line 558 of file game.c.

◆ AreGameFlagsSet()

bool AreGameFlagsSet ( EGameFlags  checkGameFlags)

Can check for multiple bits at the same time.

Parameters
[in]checkGameFlags
Returns

Definition at line 567 of file game.c.

◆ CreateGame()

Game CreateGame ( )

Definition at line 1417 of file game.c.

◆ CreateLoadingAnim()

override LoadingAnim CreateLoadingAnim ( WorkspaceWidget  workspaceWidget)

Definition at line 594 of file game.c.

◆ GetBuildingDestructionManager()

SCR_BuildingDestructionManagerComponent GetBuildingDestructionManager ( )
Returns

Definition at line 155 of file game.c.

◆ GetCallqueue()

ScriptCallQueue GetCallqueue ( )
Returns

Definition at line 225 of file game.c.

◆ GetDataCollector()

SCR_DataCollectorComponent GetDataCollector ( )
Returns

Definition at line 90 of file game.c.

◆ GetDefaultGameConfigs()

override array<ResourceName> GetDefaultGameConfigs ( )

Get a list of all missions, featured, tutorial, recommended ones

Returns
mission resources list

Definition at line 1295 of file game.c.

◆ GetFullKickReason()

bool GetFullKickReason ( KickCauseCode  kickCode,
out KickCauseGroup2  groupInt,
out int  reasonInt,
out string  group,
out string  reason 
)

Convert KickCauseCode into proper kick reason variables

Parameters
[in]kickCodeKick code to convert
[out]groupInt
[out]reasonInt
[out]group
[out]reason
Returns
Will return true if proper kick reason found

Definition at line 358 of file game.c.

◆ GetGame()

◆ GetGameFlags()

EGameFlags GetGameFlags ( )
Returns

Definition at line 534 of file game.c.

◆ GetGameStarted()

bool GetGameStarted ( )
Returns

Definition at line 527 of file game.c.

◆ GetHasKeyboard()

bool GetHasKeyboard ( )
Returns

Definition at line 218 of file game.c.

◆ GetHUDManager()

SCR_HUDManagerComponent GetHUDManager ( )
Returns

Definition at line 1196 of file game.c.

◆ GetIsClientAuthority()

override bool GetIsClientAuthority ( )

Getter for where authority is for vehicles

Returns
always false

Definition at line 268 of file game.c.

◆ GetLoadoutManager()

SCR_LoadoutManager GetLoadoutManager ( )

Returns currently registered SCR_LoadoutManager if any is present.

Returns
Reference to loadout manager or null if none.

Definition at line 163 of file game.c.

◆ GetMenuPreset()

override GetMenuPreset ( )

Important for menu manager to work. Specify presets in ChimeraMenuPreset enum and add them in chimeraMenus.conf configuration file.

Returns
ChimeraMenuPreset typename

Definition at line 588 of file game.c.

◆ GetMissionName()

override string GetMissionName ( )

Definition at line 1247 of file game.c.

◆ GetOnObtainedGameFlagsInvoker()

ScriptInvoker GetOnObtainedGameFlagsInvoker ( )
Returns

Definition at line 574 of file game.c.

◆ GetPlayerDataStats()

override protected ref Managed GetPlayerDataStats ( int  playerID)

Definition at line 1238 of file game.c.

◆ GetProfanityFilter()

SCR_ProfaneFilter GetProfanityFilter ( )
Returns

Definition at line 201 of file game.c.

◆ GetResourceGrid()

SCR_ResourceGrid GetResourceGrid ( )
Returns

Definition at line 97 of file game.c.

◆ GetResourceSystemSubscriptionManager()

SCR_ResourceSystemSubscriptionManager GetResourceSystemSubscriptionManager ( )
Returns

Definition at line 107 of file game.c.

◆ GetSaveManager()

SCR_SaveManagerCore GetSaveManager ( )
Returns

Definition at line 211 of file game.c.

◆ GetSettingsManager()

SCR_SettingsManager GetSettingsManager ( )
Returns

Definition at line 191 of file game.c.

◆ GetSoundManagerEntity()

SCR_SoundManagerEntity GetSoundManagerEntity ( )
Returns
registered SCR_SoundManagerEntity

Definition at line 184 of file game.c.

◆ HostGameConfig()

override void HostGameConfig ( )

Definition at line 1274 of file game.c.

◆ InsertNewScenario()

protected void InsertNewScenario ( ResourceName  scenario,
inout array< ResourceName >  resources 
)

Check that scenario isn't in list when adding new scenario

Parameters
[in]scenario
[in,out]resources

Definition at line 1317 of file game.c.

◆ InvokeGameFlags()

protected void InvokeGameFlags ( )

Definition at line 580 of file game.c.

◆ IsPlatformGameConsole()

bool IsPlatformGameConsole ( )
Returns
true if current client platform is console

Definition at line 1393 of file game.c.

◆ LoadSave()

void LoadSave ( string  fileName)
Parameters
[in]fileName

Definition at line 1139 of file game.c.

◆ OnAfterInit()

override void OnAfterInit ( BaseWorld  world)

Called after full initialization of Game instance

Parameters
[in]world

Definition at line 602 of file game.c.

◆ OnCinematicBlending()

override void OnCinematicBlending ( float  blendFactor,
vector  cameraPosition 
)

Definition at line 298 of file game.c.

◆ OnCinematicEnd()

override void OnCinematicEnd ( )

Definition at line 292 of file game.c.

◆ OnCinematicStart()

override void OnCinematicStart ( )

Definition at line 286 of file game.c.

◆ OnGameEnd()

override void OnGameEnd ( )

Called on all machines when the world ends.

Called on all machines when the world ends.

Definition at line 791 of file game.c.

◆ OnGamepadConnectionStatus()

override void OnGamepadConnectionStatus ( bool  isConnected)

Open gamepad disconnected warning dialog

Parameters
[in]isConnectedis false on disconnection, true on re-connection.

Definition at line 1405 of file game.c.

◆ OnInputDeviceIsGamepadEvent()

override void OnInputDeviceIsGamepadEvent ( bool  isGamepad)

Definition at line 825 of file game.c.

◆ OnInputDeviceIsGamepadInvoker()

ScriptInvoker OnInputDeviceIsGamepadInvoker ( )
Returns

Definition at line 246 of file game.c.

◆ OnInputDeviceUserChangedEvent()

override void OnInputDeviceUserChangedEvent ( EInputDeviceType  oldDevice,
EInputDeviceType  newDevice 
)

Event which is called when input device binded to user changed.

Parameters
[in]oldDevice
[in]newDevice

Definition at line 819 of file game.c.

◆ OnInputDeviceUserChangedInvoker()

ScriptInvoker OnInputDeviceUserChangedInvoker ( )
Returns

Definition at line 239 of file game.c.

◆ OnKickedFromGame()

override protected void OnKickedFromGame ( KickCauseCode  kickCode)

Called after player was kicked from game back to main menu, providing reason for the kick.

Definition at line 314 of file game.c.

◆ OnMissionSet()

override protected void OnMissionSet ( MissionHeader  mission)

Definition at line 274 of file game.c.

◆ OnUpdate()

override void OnUpdate ( BaseWorld  world,
float  timeslice 
)

Definition at line 910 of file game.c.

◆ OnUserSettingsChangedEvent()

override void OnUserSettingsChangedEvent ( )

Definition at line 810 of file game.c.

◆ OnUserSettingsChangedInvoker()

ScriptInvoker OnUserSettingsChangedInvoker ( )
Returns

Definition at line 232 of file game.c.

◆ OnWindowResize()

override event void OnWindowResize ( int  w,
int  h,
bool  windowed 
)

Definition at line 839 of file game.c.

◆ OnWindowResizeInvoker()

ScriptInvoker OnWindowResizeInvoker ( )
Returns

Definition at line 260 of file game.c.

◆ OnWorldPostProcess()

protected override void OnWorldPostProcess ( World  world)

Called once loading of all entities of the world have been finished (still within the loading)

Parameters
[in]worldLoaded world

Definition at line 479 of file game.c.

◆ OnWorldSimulatePhysics()

override void OnWorldSimulatePhysics ( float  timeSlice)

Definition at line 833 of file game.c.

◆ OnWorldSimulatePhysicsInvoker()

ScriptInvoker OnWorldSimulatePhysicsInvoker ( )
Returns

Definition at line 253 of file game.c.

◆ PlayGameConfig()

override void PlayGameConfig ( ResourceName  sResource,
string  addonsList 
)

Definition at line 1257 of file game.c.

◆ ReadGameConfig()

override Managed ReadGameConfig ( string  sResource)
Parameters
[in]sResource

Definition at line 1287 of file game.c.

◆ RegisterBuildingDestructionManager()

void RegisterBuildingDestructionManager ( notnull SCR_BuildingDestructionManagerComponent  manager)
Parameters
[in]manager

Definition at line 142 of file game.c.

◆ RegisterDataCollector()

void RegisterDataCollector ( SCR_DataCollectorComponent  instance)
Parameters
[in]instance

Definition at line 118 of file game.c.

◆ RegisterLoadoutManager()

void RegisterLoadoutManager ( SCR_LoadoutManager  instance)

Registers provided loadout manager as the one used by the game. Multiple registrations are not supported and will log an error.

Parameters
[in]instanceInstance to register.

Definition at line 1154 of file game.c.

◆ RegisterSoundManagerEntity()

void RegisterSoundManagerEntity ( SCR_SoundManagerEntity  instance)
Parameters
[in]instance

Definition at line 171 of file game.c.

◆ RemoveActionListeners()

void RemoveActionListeners ( )

Definition at line 860 of file game.c.

◆ SetGameFlags()

void SetGameFlags ( EGameFlags  newGameFlags,
bool  shouldInvoke 
)
Parameters
[in]newGameFlags
[in]shouldInvoke

Definition at line 542 of file game.c.

◆ SetHUDManager()

void SetHUDManager ( SCR_HUDManagerComponent  hud)
Parameters
[in]hud

Definition at line 1131 of file game.c.

◆ ShowErrorMessage()

protected override void ShowErrorMessage ( string  msg)

Push an error message to the error message stack

Parameters
[in]msg

Definition at line 491 of file game.c.

◆ ShowNextErrorDialog()

protected void ShowNextErrorDialog ( )

If no error dialogue is currently shown try to pop it from the error stack and display it as an error dialogue

Definition at line 499 of file game.c.

◆ ShutdownBackend()

void ShutdownBackend ( )

Definition at line 1122 of file game.c.

◆ UnregisterBuildingDestructionManager()

void UnregisterBuildingDestructionManager ( notnull SCR_BuildingDestructionManagerComponent  manager)
Parameters
[in]manager

Definition at line 132 of file game.c.

◆ UnregisterLoadoutManager()

void UnregisterLoadoutManager ( SCR_LoadoutManager  instance)

Unregisters provided loadout manager. Wrong unregistrations will log an error.

Parameters
[in]instanceInstance to unregister.

Definition at line 1169 of file game.c.

◆ ~ArmaReforgerScripted()

void ~ArmaReforgerScripted ( )

Definition at line 83 of file game.c.

Variable Documentation

◆ CONFIG_CORES_PATH

enum EGameFlags CONFIG_CORES_PATH = "Configs/Core/"

Enum of DiagMenu id values, generated by Game.

Main game instance. Created when the game starts (not when a world starts!) and persists until the game is closed.

◆ CONFIG_DIALOGS_ERROR

const ResourceName CONFIG_DIALOGS_ERROR = "{D3BFEE28E7D5B6A1}Configs/ServerBrowser/KickDialogs.conf"

Definition at line 35 of file game.c.

◆ Event_OnObtainedGameFlags

protected ref ScriptInvoker Event_OnObtainedGameFlags = new ScriptInvoker()

Definition at line 40 of file game.c.

◆ g_ARGame

ArmaReforgerScripted g_ARGame

Definition at line 1414 of file game.c.

◆ m_aErrorStack

protected ref SCR_Stack<SCR_GameErrorMessage> m_aErrorStack = new SCR_Stack<SCR_GameErrorMessage>()

Stack of queued error messages. All messages are popped one by one as user closes them and only in the main menu.

Definition at line 67 of file game.c.

◆ m_bAreGameFlagsObtained

protected bool m_bAreGameFlagsObtained

Definition at line 39 of file game.c.

◆ m_bGameStarted

private bool m_bGameStarted = false

Definition at line 64 of file game.c.

◆ m_bHasKeyboard

protected bool m_bHasKeyboard

Definition at line 49 of file game.c.

◆ m_bIsMainMenuOpen

bool m_bIsMainMenuOpen = false

Definition at line 63 of file game.c.

◆ m_BuildingDestructionManager

protected SCR_BuildingDestructionManagerComponent m_BuildingDestructionManager

Definition at line 47 of file game.c.

◆ m_Callqueue

protected ref ScriptCallQueue m_Callqueue = new ScriptCallQueue()

Definition at line 74 of file game.c.

◆ m_ChatEntity

protected ScriptedChatEntity m_ChatEntity

Definition at line 42 of file game.c.

◆ m_CoresManager

protected ref SCR_GameCoresManager m_CoresManager

Definition at line 43 of file game.c.

◆ m_DataCollectorComponent

protected SCR_DataCollectorComponent m_DataCollectorComponent

Object responsible for tracking and connecting to the database for Career Profile.

Definition at line 55 of file game.c.

◆ m_eGameFlags

protected EGameFlags m_eGameFlags

Game Flags specific for current game mode, or for the game mode which is going to be played when it is a host/server side.

Definition at line 38 of file game.c.

◆ m_HUDManager

protected SCR_HUDManagerComponent m_HUDManager

Definition at line 41 of file game.c.

◆ m_OnChangeUserSettingsInvoker

protected ref ScriptInvoker m_OnChangeUserSettingsInvoker = new ScriptInvoker()

Definition at line 69 of file game.c.

◆ m_OnInputDeviceIsGamepadInvoker

protected ref ScriptInvoker m_OnInputDeviceIsGamepadInvoker = new ScriptInvoker()

Definition at line 71 of file game.c.

◆ m_OnInputDeviceUserChangedInvoker

protected ref ScriptInvoker m_OnInputDeviceUserChangedInvoker = new ScriptInvoker()

Definition at line 70 of file game.c.

◆ m_OnMissionSetInvoker

ref ScriptInvoker m_OnMissionSetInvoker = new ScriptInvoker()

Definition at line 60 of file game.c.

◆ m_OnWindowResizeInvoker

protected ref ScriptInvoker<int, int, bool> m_OnWindowResizeInvoker = new ScriptInvoker()

Definition at line 73 of file game.c.

◆ m_OnWorldSimulatePhysicsInvoker

protected ref ScriptInvoker m_OnWorldSimulatePhysicsInvoker = new ScriptInvoker()

Definition at line 72 of file game.c.

◆ m_pLoadoutManager

protected SCR_LoadoutManager m_pLoadoutManager

Object responsible for managing and providing game modes with list of available loadouts.

Definition at line 52 of file game.c.

◆ m_ProfanityFilter

protected ref SCR_ProfaneFilter m_ProfanityFilter

Definition at line 45 of file game.c.

◆ m_ResourceGrid

protected ref SCR_ResourceGrid m_ResourceGrid

Definition at line 78 of file game.c.

◆ m_ResourceSystemSubscriptionManager

protected ref SCR_ResourceSystemSubscriptionManager m_ResourceSystemSubscriptionManager

Definition at line 79 of file game.c.

◆ m_SaveManagerCore

protected SCR_SaveManagerCore m_SaveManagerCore

Definition at line 46 of file game.c.

◆ m_SessionErrorHandler

ref RplSessionErrorHandler m_SessionErrorHandler

Definition at line 61 of file game.c.

◆ m_SettingsManager

protected ref SCR_SettingsManager m_SettingsManager

Definition at line 44 of file game.c.

◆ m_SoundManagerEntity

protected SCR_SoundManagerEntity m_SoundManagerEntity

Object responsible for managing sounds trigged in script.

Definition at line 58 of file game.c.

◆ m_SpawnerAIGroupManager

protected SCR_SpawnerAIGroupManagerComponent m_SpawnerAIGroupManager

Definition at line 48 of file game.c.