Skip to content

Commit

Permalink
Merge branch 'master' into copperhead
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Jan 13, 2025
2 parents cf0eb62 + 5c6b7c1 commit c90dbfc
Show file tree
Hide file tree
Showing 29 changed files with 392 additions and 226 deletions.
6 changes: 6 additions & 0 deletions addons/common/ACE_ExtensionsHashes.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class ACE_ExtensionsHashes {
class ace {
dll = "b83c2c9c7c989eaf888c885d13a2fdf4a61d1c5f";
dll_x64 = "356a61c4bd2aa13556a8ba0b467c819b3b438d6c";
};
};
2 changes: 2 additions & 0 deletions addons/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@ class ACE_Tests {
mapConfigs = QPATHTOF(dev\test_mapConfigs.sqf);
cfgPatches = QPATHTOF(dev\test_cfgPatches.sqf);
};

#include "ACE_ExtensionsHashes.hpp"
45 changes: 33 additions & 12 deletions addons/common/functions/fnc_checkFiles.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -116,31 +116,52 @@ if (_oldCompats isNotEqualTo []) then {
///////////////
// Check extensions
///////////////
private _platform = toLowerANSI (productVersion select 6);
if (hasInterface) then {
private _platform = toLowerANSI (productVersion select 6);

if (_platform in ["linux", "osx"]) then {
// Linux and OSX client ports do not support extensions at all
if (hasInterface) then {
// Check for presence
if (_platform in ["linux", "osx"]) exitWith {
// Linux and OSX client ports do not support extensions at all
WARNING("Operating system does not support extensions");
} else {
INFO("Operating system does not support extensions");
};
} else {

("ace" callExtension ["version", []]) params [["_versionEx", "", [""]], ["_returnCode", -1, [-1]]];

if (_returnCode != 0 || {_versionEx == ""}) then {
private _errorMsg = format ["Extension not found. [Return Code: %1]", _returnCode];
ERROR(_errorMsg);

if (hasInterface) then {
["[ACE] ERROR", _errorMsg] call FUNC(errorMessage);
};
["[ACE] ERROR", _errorMsg] call FUNC(errorMessage);
} else {
_versionEx = _versionEx select [0, 8]; // git hash
INFO_1("Extension [Version: %1]",_versionEx);
};
};

// Check for correct hash
if (GVAR(checkExtensions)) then {
private _allExtensions = allExtensions;

{
private _extName = configName _x;
private _extensionType = "dll";
if (productVersion select 7 == "x64") then { _extensionType = format ["%1_x64", _extensionType]; };
private _expectedHash = getText (_x >> _extensionType);

private _extensionHash = "";
{
if ((_x getOrDefault ["name", ""]) == _extName) exitWith {
_extensionHash = _x getOrDefault ["hash", ""];
};
} forEach _allExtensions;
TRACE_3("",_extName,_expectedHash,_extensionHash);

if (_extensionHash != _expectedHash) then {
private _errorMsg = format ["Extension %1 wrong version [%2 vs %3].", _extName, _extensionHash, _expectedHash];
ERROR(_errorMsg);
["[ACE] ERROR", _errorMsg] call FUNC(errorMessage);
};
} forEach ("true" configClasses (configFile >> "ACE_ExtensionsHashes"));
};
};

///////////////
// Check server version/addons
Expand Down
9 changes: 9 additions & 0 deletions addons/common/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ private _categorySway = [_category, LSTRING(subcategory_sway)];
1
] call CBA_fnc_addSetting;

[
QGVAR(checkExtensions),
"CHECKBOX",
[LSTRING(checkExtensions_DisplayName)],
_category,
false,
1
] call CBA_fnc_addSetting;

[
QGVAR(settingFeedbackIcons),
"LIST",
Expand Down
3 changes: 3 additions & 0 deletions addons/common/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@
<Chinesesimp>检查 PBO</Chinesesimp>
<Hungarian>PBO-k ellenőrzése</Hungarian>
</Key>
<Key ID="STR_ACE_Common_checkExtensions_DisplayName">
<English>Check Extensions</English>
</Key>
<Key ID="STR_ACE_Common_CheckPBO_Whitelist_Description">
<English>What addons are allowed regardless?</English>
<Czech>Jaké addony jsou povoleny?</Czech>
Expand Down
19 changes: 0 additions & 19 deletions addons/compat_ef/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@ class CfgWeapons {
EGVAR(nightvision,border) = QPATHTOEF(nightvision,data\nvg_mask_binos_4096.paa);
};

// -- ace_hearing --
class HelmetBase;
class EF_H_Protecta: HelmetBase {
HEARING_PROTECTION_PELTOR;
};
class EF_H_MCH; // this does not have peltor
class EF_H_MCH_Basic: EF_H_MCH {
HEARING_PROTECTION_PELTOR;
};
class EF_H_MCH_BasicNet_Des: EF_H_MCH {
HEARING_PROTECTION_PELTOR;
};
class EF_H_MCH_Full: EF_H_MCH {
HEARING_PROTECTION_PELTOR;
};
class EF_H_MCH_FullCamo_Des: EF_H_MCH {
HEARING_PROTECTION_PELTOR;
};

// -- ace_overpressure --
class autocannon_30mm;
class EF_autocannon_50mm_AAV9: autocannon_30mm {
Expand Down
19 changes: 19 additions & 0 deletions addons/compat_ef/compat_ef_hearing/CfgWeapons.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class CfgWeapons {
class HelmetBase;
class EF_H_Protecta: HelmetBase {
HEARING_PROTECTION_PELTOR;
};
class EF_H_MCH; // this does not have peltor
class EF_H_MCH_Basic: EF_H_MCH {
HEARING_PROTECTION_PELTOR;
};
class EF_H_MCH_BasicNet_Des: EF_H_MCH {
HEARING_PROTECTION_PELTOR;
};
class EF_H_MCH_Full: EF_H_MCH {
HEARING_PROTECTION_PELTOR;
};
class EF_H_MCH_FullCamo_Des: EF_H_MCH {
HEARING_PROTECTION_PELTOR;
};
};
19 changes: 19 additions & 0 deletions addons/compat_ef/compat_ef_hearing/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "script_component.hpp"
#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp"

class CfgPatches {
class SUBADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"EF_Weapons", "EF_Marines", "ace_hearing"};
skipWhenMissingDependencies = 1;
author = ECSTRING(common,ACETeam);
url = ECSTRING(main,URL);
VERSION_CONFIG;
addonRootClass = QUOTE(ADDON);
};
};

#include "CfgWeapons.hpp"
3 changes: 3 additions & 0 deletions addons/compat_ef/compat_ef_hearing/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define SUBCOMPONENT hearing
#define SUBCOMPONENT_BEAUTIFIED Hearing
#include "..\script_component.hpp"
1 change: 0 additions & 1 deletion addons/compat_ef/config.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "script_component.hpp"
#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp"

class CfgPatches {
class ADDON {
Expand Down
1 change: 0 additions & 1 deletion addons/compat_spe/CfgWeapons.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class CfgWeapons {
#include "CfgWeapons\helmets.hpp"
#include "CfgWeapons\launchers.hpp"
#include "CfgWeapons\weapons.hpp"
};
142 changes: 0 additions & 142 deletions addons/compat_spe/CfgWeapons/helmets.hpp

This file was deleted.

Loading

0 comments on commit c90dbfc

Please sign in to comment.