check for outdated pbo files

This commit is contained in:
commy2 2015-05-09 13:25:19 +02:00
parent 19e8d7bbe7
commit 57131496f2
3 changed files with 61 additions and 11 deletions

View File

@ -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");

View File

@ -21,6 +21,7 @@ PREP(canInteract);
PREP(canInteractWith);
PREP(canUseWeapon);
PREP(changeProjectileDirection);
PREP(checkFiles);
PREP(checkPBOs);
PREP(claim);
PREP(closeDialogIfTargetMoves);

View 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");