2023-10-23 20:29:32 +00:00
|
|
|
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
2024-06-22 13:52:59 +00:00
|
|
|
* Diagnoses ACE install problems, this will only be called if there is a known problem.
|
2023-10-23 20:29:32 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
2024-06-22 13:52:59 +00:00
|
|
|
* ACE addons' WS IDs <HASHMAP>
|
2023-10-23 20:29:32 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ace_common_fnc_checkFiles_diagnoseACE
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Only run once
|
2024-06-22 13:52:59 +00:00
|
|
|
if (missionNameSpace getVariable [QGVAR(checkFiles_diagnoseACE), false]) exitWith {
|
|
|
|
createHashMap // return
|
|
|
|
};
|
|
|
|
|
2023-10-23 20:29:32 +00:00
|
|
|
GVAR(checkFiles_diagnoseACE) = true;
|
|
|
|
|
2024-06-22 13:52:59 +00:00
|
|
|
private _addons = CBA_common_addons select {(_x select [0, 4]) == "ace_"};
|
2023-10-23 20:29:32 +00:00
|
|
|
private _cfgPatches = configFile >> "CfgPatches";
|
|
|
|
private _allMods = createHashMap;
|
2024-06-22 13:52:59 +00:00
|
|
|
private _getLoadedModsInfo = getLoadedModsInfo;
|
2023-10-23 20:29:32 +00:00
|
|
|
|
2024-06-22 13:52:59 +00:00
|
|
|
// Check if ACE_ADDONs are in expected mod DIR
|
2023-10-23 20:29:32 +00:00
|
|
|
{
|
2024-06-22 13:52:59 +00:00
|
|
|
private _cfg = _cfgPatches >> _x;
|
2023-10-23 20:29:32 +00:00
|
|
|
private _actualModDir = configSourceMod _cfg;
|
|
|
|
private _expectedModDir = getText (_cfg >> "ACE_expectedModDir");
|
2024-06-22 13:52:59 +00:00
|
|
|
|
|
|
|
if (_expectedModDir == "") then {
|
|
|
|
_expectedModDir = "@ace";
|
|
|
|
};
|
|
|
|
|
2023-10-23 20:29:32 +00:00
|
|
|
private _expectedSteamID = getText (_cfg >> "ACE_expectedSteamID");
|
2024-06-22 13:52:59 +00:00
|
|
|
|
|
|
|
if (_expectedSteamID == "") then {
|
|
|
|
_expectedSteamID = "463939057"
|
|
|
|
};
|
2023-10-23 20:29:32 +00:00
|
|
|
|
|
|
|
(_allMods getOrDefault [_actualModDir, [], true]) pushBackUnique _expectedSteamID;
|
2024-06-22 13:52:59 +00:00
|
|
|
|
2023-10-23 20:29:32 +00:00
|
|
|
if (_actualModDir != _expectedModDir) then {
|
2024-06-22 13:52:59 +00:00
|
|
|
private _errorMsg = format ["%1 loading from unexpected modDir [%2]", _x, _actualModDir];
|
2023-10-23 20:29:32 +00:00
|
|
|
systemChat _errorMsg;
|
|
|
|
WARNING_1("%1",_errorMsg);
|
|
|
|
};
|
|
|
|
} forEach _addons;
|
|
|
|
|
2024-06-22 13:52:59 +00:00
|
|
|
// Check if all ACE ModDirs have expected steam WS ID
|
2023-10-23 20:29:32 +00:00
|
|
|
{
|
|
|
|
private _modDir = _x;
|
2024-06-22 13:52:59 +00:00
|
|
|
|
|
|
|
if (count _y != 1) then {
|
|
|
|
ERROR_2("Unexpected multiple steamIDs %1 - %2",_modDir,_y);
|
|
|
|
};
|
|
|
|
|
|
|
|
private _expectedSteamID = _y select 0;
|
|
|
|
private _index = _getLoadedModsInfo findIf {_x select 1 == _modDir};
|
|
|
|
(_getLoadedModsInfo param [_index, []]) params [["_modName", "$Error$"], "", "", "", "", "", "", ["_actualID", ""]];
|
2023-10-23 20:29:32 +00:00
|
|
|
|
|
|
|
if (_actualID != _expectedSteamID) then {
|
2024-06-22 13:52:59 +00:00
|
|
|
private _errorMsg = format ["%1 [%2] unexpected workshopID [%3]", _modDir, _modName, _actualID];
|
2023-10-23 20:29:32 +00:00
|
|
|
systemChat _errorMsg;
|
|
|
|
WARNING_1("%1",_errorMsg);
|
|
|
|
};
|
|
|
|
} forEach _allMods;
|
|
|
|
|
2024-06-22 13:52:59 +00:00
|
|
|
_allMods // return
|