mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
check for outdated pbo files
This commit is contained in:
parent
19e8d7bbe7
commit
57131496f2
@ -84,6 +84,7 @@ if(!isServer) then {
|
||||
["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler);
|
||||
[FUNC(syncedEventPFH), 0.5, []] call cba_fnc_addPerFrameHandler;
|
||||
|
||||
call FUNC(checkFiles);
|
||||
|
||||
/***************************************************************/
|
||||
/***************************************************************/
|
||||
@ -250,14 +251,3 @@ if(isMultiplayer && { time > 0 || isNull player } ) then {
|
||||
};
|
||||
}, 0, []] call cba_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
||||
// check dlls
|
||||
{
|
||||
if (_x callExtension "version" == "") then {
|
||||
private "_errorMsg";
|
||||
_errorMsg = format ["Extension %1.dll not installed.", _x];
|
||||
|
||||
diag_log text format ["[ACE] ERROR: %1", _errorMsg];
|
||||
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
|
||||
};
|
||||
} forEach getArray (configFile >> "ACE_Extensions" >> "extensions");
|
||||
|
@ -21,6 +21,7 @@ PREP(canInteract);
|
||||
PREP(canInteractWith);
|
||||
PREP(canUseWeapon);
|
||||
PREP(changeProjectileDirection);
|
||||
PREP(checkFiles);
|
||||
PREP(checkPBOs);
|
||||
PREP(claim);
|
||||
PREP(closeDialogIfTargetMoves);
|
||||
|
59
addons/common/functions/fnc_checkFiles.sqf
Normal file
59
addons/common/functions/fnc_checkFiles.sqf
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Compares version numbers of PBOs and DLLs.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Mode (Number)
|
||||
*
|
||||
* Return value:
|
||||
* None.
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
///////////////
|
||||
// check addons
|
||||
///////////////
|
||||
private "_version";
|
||||
_version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr");
|
||||
|
||||
diag_log text format ["[ACE]: ACE is version %1", _version]; ///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private ["_addons", "_index"];
|
||||
|
||||
_addons = activatedAddons;
|
||||
|
||||
// speed up search. all ace pbos are loaded after ace_main.
|
||||
_index = _addons find "ace_main";
|
||||
reverse _addons;
|
||||
_addons resize (count _addons - _index);
|
||||
_addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter);
|
||||
|
||||
{
|
||||
if (getText (configFile >> "CfgPatches" >> _x >> "versionStr") != _version) then {
|
||||
private "_errorMsg";
|
||||
_errorMsg = format ["File %1.pbo is outdated.", _x];
|
||||
|
||||
diag_log text format ["[ACE] ERROR: %1", _errorMsg];
|
||||
|
||||
if (hasInterface) then {
|
||||
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
|
||||
};
|
||||
};
|
||||
} forEach _addons;
|
||||
|
||||
///////////////
|
||||
// check dlls
|
||||
///////////////
|
||||
{
|
||||
if (_x callExtension "version" == "") then {
|
||||
private "_errorMsg";
|
||||
_errorMsg = format ["Extension %1.dll not installed.", _x];
|
||||
|
||||
diag_log text format ["[ACE] ERROR: %1", _errorMsg];
|
||||
|
||||
if (hasInterface) then {
|
||||
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
|
||||
};
|
||||
};
|
||||
} forEach getArray (configFile >> "ACE_Extensions" >> "extensions");
|
Loading…
Reference in New Issue
Block a user