From ad3a03a9c77c59c79bbcbd5be363950a4a4b0aa2 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 8 Mar 2016 13:52:34 -0600 Subject: [PATCH 1/3] versioning - Add warnings for missing compat PBOs --- addons/main/CfgDependencies.hpp | 23 +++++++++++++++++++++++ addons/main/config.cpp | 14 +------------- 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 addons/main/CfgDependencies.hpp diff --git a/addons/main/CfgDependencies.hpp b/addons/main/CfgDependencies.hpp new file mode 100644 index 0000000000..6dd58fb60b --- /dev/null +++ b/addons/main/CfgDependencies.hpp @@ -0,0 +1,23 @@ +class CfgSettings { + class CBA { + class Versioning { + class ACE { + class dependencies { + //ACE will hard exit if this is missing + CBA[] = {"cba_main", REQUIRED_CBA_VERSION, "true"}; + + //Warnings for missing compat pbos + compat_r3f[] = {"ace_compat_r3f", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'R3F_Armes')"}; + compat_rh_acc[] = {"ace_compat_rh_acc", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'RH_acc')"}; + compat_rh_de[] = {"ace_compat_rh_de", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'RH_de_cfg')"}; + compat_rh_m4[] = {"ace_compat_rh_m4", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'RH_m4_cfg')"}; + compat_rh_pdw[] = {"ace_compat_rh_pdw", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'RH_PDW')"}; + compat_rhs_afrf3[] = {"ace_compat_rhs_afrf3", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'rhs_main')"}; + compat_rhs_usf3[] = {"ace_compat_rhs_usf3", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'rhsusf_main')"}; + compat_rksl_pm_ii[] = {"ace_compat_rksl_pm_ii", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'RKSL_PMII')"}; + compat_sma3_iansky[] = {"ace_compat_sma3_iansky", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'iansky_opt')"}; + }; + }; + }; + }; +}; diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 5f34c6137d..3181df1dea 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -586,18 +586,6 @@ class CfgMods { }; }; +#include "CfgDependencies.hpp" #include "CfgModuleCategories.hpp" #include "CfgVehicleClasses.hpp" - -class CfgSettings { - class CBA { - class Versioning { - class ACE { - class dependencies { - CBA[] = {"cba_main", REQUIRED_CBA_VERSION, "true"}; - }; - }; - }; - }; -}; - From 86ad2ab415e0e3bf30c7ea4331a7182ed80c3e2b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 24 Mar 2016 11:53:55 -0500 Subject: [PATCH 2/3] Only warn for weapon compat if AB is on --- addons/advanced_ballistics/XEH_postInit.sqf | 15 +++++++++++++++ addons/main/CfgDependencies.hpp | 11 ++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index a541d30ce8..246529299c 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -33,6 +33,21 @@ if (!hasInterface) exitWith {}; ["firedPlayer", DFUNC(handleFired)] call EFUNC(common,addEventHandler); ["firedPlayerNonLocal", DFUNC(handleFired)] call EFUNC(common,addEventHandler); + //Add warnings for missing compat PBOs (only if AB is on) + { + _x params ["_modPBO", "_compatPBO"]; + if ((isClass (configFile >> "CfgPatches" >> _modPBO)) && {!isClass (configFile >> "CfgPatches" >> _compatPBO)}) then { + ACE_LOGWARNING_2("Weapon Mod [%1] missing ace compat pbo [%2] (from @ace\optionals)",_modPBO,_compatPBO); + }; + } forEach [ + ["RH_acc","ace_compat_rh_acc"], + ["RH_de_cfg","ace_compat_rh_de"], + ["RH_m4_cfg","ace_compat_rh_m4"], + ["RH_PDW","ace_compat_rh_pdw"], + ["RKSL_PMII","ace_compat_rksl_pm_ii"], + ["iansky_opt","ace_compat_sma3_iansky"], + ["R3F_Armes","ace_compat_r3f"] + ]; }] call EFUNC(common,addEventHandler); #ifdef DEBUG_MODE_FULL diff --git a/addons/main/CfgDependencies.hpp b/addons/main/CfgDependencies.hpp index 6dd58fb60b..3414bc80b6 100644 --- a/addons/main/CfgDependencies.hpp +++ b/addons/main/CfgDependencies.hpp @@ -4,18 +4,11 @@ class CfgSettings { class ACE { class dependencies { //ACE will hard exit if this is missing - CBA[] = {"cba_main", REQUIRED_CBA_VERSION, "true"}; + CBA[] = {"cba_main", REQUIRED_CBA_VERSION, "(true)"}; - //Warnings for missing compat pbos - compat_r3f[] = {"ace_compat_r3f", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'R3F_Armes')"}; - compat_rh_acc[] = {"ace_compat_rh_acc", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'RH_acc')"}; - compat_rh_de[] = {"ace_compat_rh_de", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'RH_de_cfg')"}; - compat_rh_m4[] = {"ace_compat_rh_m4", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'RH_m4_cfg')"}; - compat_rh_pdw[] = {"ace_compat_rh_pdw", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'RH_PDW')"}; + //Warnings for missing RHS compat pbos compat_rhs_afrf3[] = {"ace_compat_rhs_afrf3", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'rhs_main')"}; compat_rhs_usf3[] = {"ace_compat_rhs_usf3", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'rhsusf_main')"}; - compat_rksl_pm_ii[] = {"ace_compat_rksl_pm_ii", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'RKSL_PMII')"}; - compat_sma3_iansky[] = {"ace_compat_sma3_iansky", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'iansky_opt')"}; }; }; }; From a4c848a090bfa25b0007482344dbaca78076a2f1 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Mar 2016 17:00:54 +0200 Subject: [PATCH 3/3] formating --- addons/advanced_ballistics/XEH_postInit.sqf | 14 +++++++------- .../main/{CfgDependencies.hpp => CfgSettings.hpp} | 1 + addons/main/config.cpp | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) rename addons/main/{CfgDependencies.hpp => CfgSettings.hpp} (99%) diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index 246529299c..7f4fc9341f 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -40,13 +40,13 @@ if (!hasInterface) exitWith {}; ACE_LOGWARNING_2("Weapon Mod [%1] missing ace compat pbo [%2] (from @ace\optionals)",_modPBO,_compatPBO); }; } forEach [ - ["RH_acc","ace_compat_rh_acc"], - ["RH_de_cfg","ace_compat_rh_de"], - ["RH_m4_cfg","ace_compat_rh_m4"], - ["RH_PDW","ace_compat_rh_pdw"], - ["RKSL_PMII","ace_compat_rksl_pm_ii"], - ["iansky_opt","ace_compat_sma3_iansky"], - ["R3F_Armes","ace_compat_r3f"] + ["RH_acc","ace_compat_rh_acc"], + ["RH_de_cfg","ace_compat_rh_de"], + ["RH_m4_cfg","ace_compat_rh_m4"], + ["RH_PDW","ace_compat_rh_pdw"], + ["RKSL_PMII","ace_compat_rksl_pm_ii"], + ["iansky_opt","ace_compat_sma3_iansky"], + ["R3F_Armes","ace_compat_r3f"] ]; }] call EFUNC(common,addEventHandler); diff --git a/addons/main/CfgDependencies.hpp b/addons/main/CfgSettings.hpp similarity index 99% rename from addons/main/CfgDependencies.hpp rename to addons/main/CfgSettings.hpp index 3414bc80b6..661108c53a 100644 --- a/addons/main/CfgDependencies.hpp +++ b/addons/main/CfgSettings.hpp @@ -1,3 +1,4 @@ + class CfgSettings { class CBA { class Versioning { diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 3181df1dea..7b15f0c8f0 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -586,6 +586,6 @@ class CfgMods { }; }; -#include "CfgDependencies.hpp" +#include "CfgSettings.hpp" #include "CfgModuleCategories.hpp" #include "CfgVehicleClasses.hpp"