diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index 3f1a5707a8..8e79bc8056 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -35,7 +35,7 @@ // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + if !(call FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange); @@ -49,7 +49,7 @@ // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + if !(call FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange); diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 6da8353126..8fa96c036a 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -130,7 +130,7 @@ FUNC(disableFire) = { if(_firedEH < 0 && difficulty > 0) then { _firedEH = [ACE_player, "DefaultAction", {true}, { - _canFire = _currentShooter getVariable["ace_missileguidance_target", nil]; + _canFire = _this getVariable["ace_missileguidance_target", nil]; if(!isNil "_canFire") exitWith { false }; true }] call EFUNC(common,addActionEventHandler); @@ -289,4 +289,4 @@ _args set[3, _lockTime]; _args set[4, _soundTime]; _args set[6, _fireDisabledEH]; -uiNamespace setVariable[QGVAR(arguments), _args ]; \ No newline at end of file +uiNamespace setVariable[QGVAR(arguments), _args ]; diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 341b2a383f..69b568dbca 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -519,7 +519,7 @@ Punisher (GMG) Punisher (GMW) Punisher (GMG) - Punisher (CKM) + Punisher (GMG) Punisher (granátomet) Punisher (GMG) Kаратель (Гранатомет) diff --git a/extras/CfgWeaponsReference.hpp b/extras/CfgWeaponsReference.hpp index 77ce494e39..4821d53813 100644 --- a/extras/CfgWeaponsReference.hpp +++ b/extras/CfgWeaponsReference.hpp @@ -294,7 +294,7 @@ class CfgWeapons class RH_gsh18 : Pistol_Base_F { ACE_barrelTwist=9.8; - ACE_barrelLength=4.1; + ACE_barrelLength=4.1; }; class RH_mateba : Pistol_Base_F { @@ -329,7 +329,7 @@ class CfgWeapons class RH_fn57 : Pistol_Base_F { ACE_barrelTwist=9.1; - ACE_barrelLength=4.8; + ACE_barrelLength=4.8; }; class RH_vp70 : Pistol_Base_F { diff --git a/optionals/asdg_comp/config.cpp b/optionals/compat_asdg/config.cpp similarity index 100% rename from optionals/asdg_comp/config.cpp rename to optionals/compat_asdg/config.cpp diff --git a/optionals/asdg_comp/script_component.hpp b/optionals/compat_asdg/script_component.hpp similarity index 100% rename from optionals/asdg_comp/script_component.hpp rename to optionals/compat_asdg/script_component.hpp diff --git a/optionals/hlc_ar15_comp/CfgWeapons.hpp b/optionals/compat_hlc_ar15/CfgWeapons.hpp similarity index 100% rename from optionals/hlc_ar15_comp/CfgWeapons.hpp rename to optionals/compat_hlc_ar15/CfgWeapons.hpp diff --git a/optionals/hlc_ar15_comp/config.cpp b/optionals/compat_hlc_ar15/config.cpp similarity index 100% rename from optionals/hlc_ar15_comp/config.cpp rename to optionals/compat_hlc_ar15/config.cpp diff --git a/optionals/hlc_ar15_comp/script_component.hpp b/optionals/compat_hlc_ar15/script_component.hpp similarity index 100% rename from optionals/hlc_ar15_comp/script_component.hpp rename to optionals/compat_hlc_ar15/script_component.hpp diff --git a/optionals/hlc_wp_mp5_comp/CfgWeapons.hpp b/optionals/compat_hlc_wp_mp5/CfgWeapons.hpp similarity index 100% rename from optionals/hlc_wp_mp5_comp/CfgWeapons.hpp rename to optionals/compat_hlc_wp_mp5/CfgWeapons.hpp diff --git a/optionals/hlc_wp_mp5_comp/config.cpp b/optionals/compat_hlc_wp_mp5/config.cpp similarity index 100% rename from optionals/hlc_wp_mp5_comp/config.cpp rename to optionals/compat_hlc_wp_mp5/config.cpp diff --git a/optionals/hlc_wp_mp5_comp/script_component.hpp b/optionals/compat_hlc_wp_mp5/script_component.hpp similarity index 100% rename from optionals/hlc_wp_mp5_comp/script_component.hpp rename to optionals/compat_hlc_wp_mp5/script_component.hpp diff --git a/optionals/hlcmods_ak_comp/CfgWeapons.hpp b/optionals/compat_hlcmods_ak/CfgWeapons.hpp similarity index 60% rename from optionals/hlcmods_ak_comp/CfgWeapons.hpp rename to optionals/compat_hlcmods_ak/CfgWeapons.hpp index 51a86e42cf..390d3e6177 100644 --- a/optionals/hlcmods_ak_comp/CfgWeapons.hpp +++ b/optionals/compat_hlcmods_ak/CfgWeapons.hpp @@ -1,7 +1,9 @@ class CfgWeapons { + class optic_dms; class hlc_ak_base; class hlc_rifle_ak12; + class InventoryOpticsItem_Base_F; class hlc_rifle_ak74: hlc_ak_base { ACE_barrelTwist=7.8699999; @@ -52,4 +54,23 @@ class CfgWeapons ACE_twistDirection=0; ACE_barrelLength=16.9; }; + + class HLC_Optic_PSO1 : optic_dms { + ACE_ScopeAdjust_Vertical[] = { 0, 0 }; + ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; + ACE_ScopeAdjust_Increment = 0.5; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[]={100, 200, 300, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; + discreteDistanceInitIndex=3; + }; + }; + }; + }; + class HLC_Optic_1p29 : HLC_Optic_PSO1 { + ACE_ScopeAdjust_Vertical[] = {}; + ACE_ScopeAdjust_Horizontal[] = {}; + ACE_ScopeAdjust_Increment = 0; + }; }; \ No newline at end of file diff --git a/optionals/hlcmods_ak_comp/config.cpp b/optionals/compat_hlcmods_ak/config.cpp similarity index 100% rename from optionals/hlcmods_ak_comp/config.cpp rename to optionals/compat_hlcmods_ak/config.cpp diff --git a/optionals/hlcmods_ak_comp/script_component.hpp b/optionals/compat_hlcmods_ak/script_component.hpp similarity index 100% rename from optionals/hlcmods_ak_comp/script_component.hpp rename to optionals/compat_hlcmods_ak/script_component.hpp diff --git a/optionals/compat_hlcmods_aug/CfgWeapons.hpp b/optionals/compat_hlcmods_aug/CfgWeapons.hpp new file mode 100644 index 0000000000..b46cf485e1 --- /dev/null +++ b/optionals/compat_hlcmods_aug/CfgWeapons.hpp @@ -0,0 +1,51 @@ + +class CfgWeapons +{ + class Rifle_Base_F; + class hlc_aug_base; + class hlc_rifle_aug: hlc_aug_base + { + ACE_barrelTwist=9; + ACE_barrelLength=20; + }; + class hlc_rifle_auga1carb: hlc_rifle_aug + { + ACE_barrelTwist=9; + ACE_barrelLength=16; + }; + class hlc_rifle_aughbar: hlc_rifle_aug + { + ACE_barrelTwist=9; + ACE_barrelLength=24; + }; + class hlc_rifle_augpara: hlc_rifle_aug + { + ACE_barrelTwist=9; + ACE_barrelLength=16.5; + }; + class hlc_rifle_auga2: hlc_rifle_aug + { + ACE_barrelTwist=9; + ACE_barrelLength=20; + }; + class hlc_rifle_auga2para: hlc_rifle_auga2 + { + ACE_barrelTwist=9; + ACE_barrelLength=16.5; + }; + class hlc_rifle_auga2carb: hlc_rifle_auga2 + { + ACE_barrelTwist=9; + ACE_barrelLength=18; + }; + class hlc_rifle_auga2lsw: hlc_rifle_aughbar + { + ACE_barrelTwist=9; + ACE_barrelLength=24; + }; + class hlc_rifle_auga3: hlc_rifle_aug + { + ACE_barrelTwist=9; + ACE_barrelLength=18; + }; +}; \ No newline at end of file diff --git a/optionals/compat_hlcmods_aug/config.cpp b/optionals/compat_hlcmods_aug/config.cpp new file mode 100644 index 0000000000..06192a6ffd --- /dev/null +++ b/optionals/compat_hlcmods_aug/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"hlcweapons_AUG"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_hlcmods_aug/script_component.hpp b/optionals/compat_hlcmods_aug/script_component.hpp new file mode 100644 index 0000000000..d5a6712b6b --- /dev/null +++ b/optionals/compat_hlcmods_aug/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT hlcweapons_AUG_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/hlcmods_core_comp/CfgAmmo.hpp b/optionals/compat_hlcmods_core/CfgAmmo.hpp similarity index 100% rename from optionals/hlcmods_core_comp/CfgAmmo.hpp rename to optionals/compat_hlcmods_core/CfgAmmo.hpp diff --git a/optionals/hlcmods_core_comp/config.cpp b/optionals/compat_hlcmods_core/config.cpp similarity index 100% rename from optionals/hlcmods_core_comp/config.cpp rename to optionals/compat_hlcmods_core/config.cpp diff --git a/optionals/hlcmods_core_comp/script_component.hpp b/optionals/compat_hlcmods_core/script_component.hpp similarity index 100% rename from optionals/hlcmods_core_comp/script_component.hpp rename to optionals/compat_hlcmods_core/script_component.hpp diff --git a/optionals/hlcmods_fal_comp/CfgWeapons.hpp b/optionals/compat_hlcmods_fal/CfgWeapons.hpp similarity index 100% rename from optionals/hlcmods_fal_comp/CfgWeapons.hpp rename to optionals/compat_hlcmods_fal/CfgWeapons.hpp diff --git a/optionals/hlcmods_fal_comp/config.cpp b/optionals/compat_hlcmods_fal/config.cpp similarity index 100% rename from optionals/hlcmods_fal_comp/config.cpp rename to optionals/compat_hlcmods_fal/config.cpp diff --git a/optionals/hlcmods_fal_comp/script_component.hpp b/optionals/compat_hlcmods_fal/script_component.hpp similarity index 100% rename from optionals/hlcmods_fal_comp/script_component.hpp rename to optionals/compat_hlcmods_fal/script_component.hpp diff --git a/optionals/hlcmods_g3_comp/CfgWeapons.hpp b/optionals/compat_hlcmods_g3/CfgWeapons.hpp similarity index 100% rename from optionals/hlcmods_g3_comp/CfgWeapons.hpp rename to optionals/compat_hlcmods_g3/CfgWeapons.hpp diff --git a/optionals/hlcmods_g3_comp/config.cpp b/optionals/compat_hlcmods_g3/config.cpp similarity index 100% rename from optionals/hlcmods_g3_comp/config.cpp rename to optionals/compat_hlcmods_g3/config.cpp diff --git a/optionals/hlcmods_g3_comp/script_component.hpp b/optionals/compat_hlcmods_g3/script_component.hpp similarity index 100% rename from optionals/hlcmods_g3_comp/script_component.hpp rename to optionals/compat_hlcmods_g3/script_component.hpp diff --git a/optionals/hlcmods_m14_comp/CfgWeapons.hpp b/optionals/compat_hlcmods_m14/CfgWeapons.hpp similarity index 100% rename from optionals/hlcmods_m14_comp/CfgWeapons.hpp rename to optionals/compat_hlcmods_m14/CfgWeapons.hpp diff --git a/optionals/hlcmods_m14_comp/config.cpp b/optionals/compat_hlcmods_m14/config.cpp similarity index 100% rename from optionals/hlcmods_m14_comp/config.cpp rename to optionals/compat_hlcmods_m14/config.cpp diff --git a/optionals/hlcmods_m14_comp/script_component.hpp b/optionals/compat_hlcmods_m14/script_component.hpp similarity index 100% rename from optionals/hlcmods_m14_comp/script_component.hpp rename to optionals/compat_hlcmods_m14/script_component.hpp diff --git a/optionals/hlcmods_m60e4_comp/CfgWeapons.hpp b/optionals/compat_hlcmods_m60e4/CfgWeapons.hpp similarity index 100% rename from optionals/hlcmods_m60e4_comp/CfgWeapons.hpp rename to optionals/compat_hlcmods_m60e4/CfgWeapons.hpp diff --git a/optionals/hlcmods_m60e4_comp/config.cpp b/optionals/compat_hlcmods_m60e4/config.cpp similarity index 100% rename from optionals/hlcmods_m60e4_comp/config.cpp rename to optionals/compat_hlcmods_m60e4/config.cpp diff --git a/optionals/hlcmods_m60e4_comp/script_component.hpp b/optionals/compat_hlcmods_m60e4/script_component.hpp similarity index 100% rename from optionals/hlcmods_m60e4_comp/script_component.hpp rename to optionals/compat_hlcmods_m60e4/script_component.hpp diff --git a/optionals/compat_rh_acc/CfgWeapons.hpp b/optionals/compat_rh_acc/CfgWeapons.hpp new file mode 100644 index 0000000000..4dda8ffbe0 --- /dev/null +++ b/optionals/compat_rh_acc/CfgWeapons.hpp @@ -0,0 +1,131 @@ + +class CfgWeapons { + class ItemCore; + class InventoryOpticsItem_Base_F; + + class RH_accupoint : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Accupoint { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_m3lr : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class m3lr { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_leu_mk4 : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class mk4 { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_c79 : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class c79scope { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_c79_2d : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class c79scope { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_anpvs10 : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class pvs10 { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_pas13cm : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class MTWS { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_pas13cmg : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class MTWSmg { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_pas13ch : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class HTWS { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; +}; diff --git a/optionals/compat_rh_acc/config.cpp b/optionals/compat_rh_acc/config.cpp new file mode 100644 index 0000000000..9f563bd157 --- /dev/null +++ b/optionals/compat_rh_acc/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"RH_acc"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_rh_acc/script_component.hpp b/optionals/compat_rh_acc/script_component.hpp new file mode 100644 index 0000000000..4b36a38ce0 --- /dev/null +++ b/optionals/compat_rh_acc/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT RH_acc_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_rh_de/CfgAmmo.hpp b/optionals/compat_rh_de/CfgAmmo.hpp new file mode 100644 index 0000000000..b66b55f530 --- /dev/null +++ b/optionals/compat_rh_de/CfgAmmo.hpp @@ -0,0 +1,161 @@ + +class CfgAmmo +{ + class BulletBase; + class RH_50_AE_Ball: BulletBase + { + ACE_caliber=0.5; + ACE_bulletLength=1.110; + ACE_bulletMass=325; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.228}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 398, 420}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_454_Casull: BulletBase + { + ACE_caliber=0.452; + ACE_bulletLength=0.895; + ACE_bulletMass=325; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.171}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={450, 490, 500}; + ACE_barrelLengths[]={4, 7.5, 9}; + }; + class RH_32ACP: BulletBase + { + ACE_caliber=0.3125; + ACE_bulletLength=0.610; + ACE_bulletMass=65; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.118}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={282, 300, 320}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_45ACP: BulletBase + { + ACE_caliber=0.452; + ACE_bulletLength=0.68; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.195}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={230, 250, 285}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_B_40SW: BulletBase + { + ACE_caliber=0.4; + ACE_bulletLength=0.447; + ACE_bulletMass=135; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.105, 0.115, 0.120, 0.105}; + ACE_velocityBoundaries[]={365, 305, 259}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 380, 400}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_44mag_ball: BulletBase + { + ACE_caliber=0.429; + ACE_bulletLength=0.804; + ACE_bulletMass=200; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.172}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 390, 420}; + ACE_barrelLengths[]={4, 7.5, 9}; + }; + class RH_357mag_ball: BulletBase + { + ACE_caliber=0.357; + ACE_bulletLength=0.541; + ACE_bulletMass=125; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.148}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={490, 510, 535}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_762x25: BulletBase + { + ACE_caliber=0.310; + ACE_bulletLength=0.5455; + ACE_bulletMass=86; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.17}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 380, 400}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_9x18_Ball: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class RH_B_9x19_Ball: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_B_22LR_SD: BulletBase + { + ACE_caliber=0.223; + ACE_bulletLength=0.45; + ACE_bulletMass=38; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.111}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={330, 340, 360}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_57x28mm: BulletBase + { + ACE_caliber=0.224; + ACE_bulletLength=0.495; + ACE_bulletMass=28; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.144}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={550, 625, 720}; + ACE_barrelLengths[]={4, 6, 10.35}; + }; +}; \ No newline at end of file diff --git a/optionals/compat_rh_de/CfgWeapons.hpp b/optionals/compat_rh_de/CfgWeapons.hpp new file mode 100644 index 0000000000..8fdff293c9 --- /dev/null +++ b/optionals/compat_rh_de/CfgWeapons.hpp @@ -0,0 +1,140 @@ +class CfgWeapons +{ + class Pistol_Base_F; + class RH_Pistol_Base_F; + class RH_deagle: RH_Pistol_Base_F + { + ACE_barrelTwist=19; + ACE_barrelLength=6; + }; + class RH_mateba: Pistol_Base_F + { + ACE_barrelTwist=14; + ACE_barrelLength=6; + }; + class RH_mp412: Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=6; + }; + class RH_python: Pistol_Base_F + { + ACE_barrelTwist=14; + ACE_barrelLength=6; + }; + class RH_bull: RH_python + { + ACE_barrelTwist=24; + ACE_barrelLength=6.5; + }; + class RH_ttracker: Pistol_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=4; + }; + class RH_cz75: RH_Pistol_Base_F + { + ACE_barrelTwist=9.7; + ACE_barrelLength=4.7; + }; + class RH_p226: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.4; + }; + class RH_sw659: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=7.44; + }; + class RH_usp: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.41; + }; + class RH_uspm: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=6; + }; + class RH_kimber: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5; + }; + class RH_m1911: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5; + }; + class RH_tt33: RH_Pistol_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=4.6; + }; + class RH_mak: RH_Pistol_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=3.68; + }; + class RH_mk2: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4; + }; + class RH_m9: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.9; + }; + class RH_g18: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.49; + }; + class RH_g17: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.49; + }; + class RH_g19: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4; + }; + class RH_gsh18: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.1; + }; + class RH_fnp45: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.5; + }; + class RH_fn57: RH_fnp45 + { + ACE_barrelTwist=9.1; + ACE_barrelLength=4.8; + }; + class RH_vp70: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.6; + }; + class RH_vz61: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.5; + }; + class RH_tec9: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=5; + }; + class RH_muzi: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=5; + }; +}; \ No newline at end of file diff --git a/optionals/rh_m4_comp/config.cpp b/optionals/compat_rh_de/config.cpp similarity index 82% rename from optionals/rh_m4_comp/config.cpp rename to optionals/compat_rh_de/config.cpp index 937097354f..3d82eab05a 100644 --- a/optionals/rh_m4_comp/config.cpp +++ b/optionals/compat_rh_de/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"asdg_jointrails","RH_m4_cfg"}; + requiredAddons[] = {"RH_de_cfg"}; author[]={"Ruthberg"}; VERSION_CONFIG; }; diff --git a/optionals/compat_rh_de/script_component.hpp b/optionals/compat_rh_de/script_component.hpp new file mode 100644 index 0000000000..07ed06ae3f --- /dev/null +++ b/optionals/compat_rh_de/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT RH_de_cfg_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/rh_m4_comp/CfgAmmo.hpp b/optionals/compat_rh_m4/CfgAmmo.hpp similarity index 100% rename from optionals/rh_m4_comp/CfgAmmo.hpp rename to optionals/compat_rh_m4/CfgAmmo.hpp diff --git a/optionals/rh_m4_comp/CfgWeapons.hpp b/optionals/compat_rh_m4/CfgWeapons.hpp similarity index 100% rename from optionals/rh_m4_comp/CfgWeapons.hpp rename to optionals/compat_rh_m4/CfgWeapons.hpp diff --git a/optionals/compat_rh_m4/config.cpp b/optionals/compat_rh_m4/config.cpp new file mode 100644 index 0000000000..9c28be4f89 --- /dev/null +++ b/optionals/compat_rh_m4/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"RH_m4_cfg"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgWeapons.hpp" diff --git a/optionals/rh_m4_comp/script_component.hpp b/optionals/compat_rh_m4/script_component.hpp similarity index 100% rename from optionals/rh_m4_comp/script_component.hpp rename to optionals/compat_rh_m4/script_component.hpp diff --git a/optionals/compat_rh_pdw/CfgAmmo.hpp b/optionals/compat_rh_pdw/CfgAmmo.hpp new file mode 100644 index 0000000000..706344ff8c --- /dev/null +++ b/optionals/compat_rh_pdw/CfgAmmo.hpp @@ -0,0 +1,15 @@ + +class BulletBase; +class RH_B_6x35: BulletBase +{ + ACE_caliber=0.224; + ACE_bulletLength=0.445; + ACE_bulletMass=65; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.26}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={730, 750, 760}; + ACE_barrelLengths[]={8, 10, 12}; +}; \ No newline at end of file diff --git a/optionals/compat_rh_pdw/CfgWeapons.hpp b/optionals/compat_rh_pdw/CfgWeapons.hpp new file mode 100644 index 0000000000..b009a202ce --- /dev/null +++ b/optionals/compat_rh_pdw/CfgWeapons.hpp @@ -0,0 +1,10 @@ + +class CfgWeapons +{ + class Rifle_Base_F; + class RH_PDW: Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=10; + }; +}; diff --git a/optionals/compat_rh_pdw/config.cpp b/optionals/compat_rh_pdw/config.cpp new file mode 100644 index 0000000000..4aed0e6241 --- /dev/null +++ b/optionals/compat_rh_pdw/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"RH_PDW"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgWeapons.hpp" diff --git a/optionals/compat_rh_pdw/script_component.hpp b/optionals/compat_rh_pdw/script_component.hpp new file mode 100644 index 0000000000..67c4617e06 --- /dev/null +++ b/optionals/compat_rh_pdw/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT RH_PDW_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_rksl_pm_ii/CfgWeapons.hpp b/optionals/compat_rksl_pm_ii/CfgWeapons.hpp new file mode 100644 index 0000000000..621dd98b71 --- /dev/null +++ b/optionals/compat_rksl_pm_ii/CfgWeapons.hpp @@ -0,0 +1,33 @@ + +class CfgWeapons { + class ItemCore; + class InventoryOpticsItem_Base_F; + + class RKSL_optic_PMII_312 : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RKSL_optic_PMII_312_sunshade : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; +}; diff --git a/optionals/compat_rksl_pm_ii/config.cpp b/optionals/compat_rksl_pm_ii/config.cpp new file mode 100644 index 0000000000..c3ed720f8b --- /dev/null +++ b/optionals/compat_rksl_pm_ii/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"RKSL_PMII"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_rksl_pm_ii/script_component.hpp b/optionals/compat_rksl_pm_ii/script_component.hpp new file mode 100644 index 0000000000..a98639b0e8 --- /dev/null +++ b/optionals/compat_rksl_pm_ii/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT RKSL_PMII_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/tools/make.cfg b/tools/make.cfg index e89568d60e..5e2d9d78da 100644 --- a/tools/make.cfg +++ b/tools/make.cfg @@ -17,6 +17,11 @@ project = @ace # Default: None # key = D:\Program Files (x86)\Bohemia Interactive\Tools\DSSignFile Tools\keys\ace_preAlpha.biprivatekey +# Path to where private keys are automatically created if the command-line parameter "key" is used +# Make sure this isn't in your public repository! +# Default: \private_keys +# private_key_path = P:\private_keys + # If set to True, the make system will attempt to autodetect addons in the # current folder by looking for directories with 'config.cpp' in them. # Default: True diff --git a/tools/make.py b/tools/make.py index 3b7bf9d94e..c7dfd2e4fb 100644 --- a/tools/make.py +++ b/tools/make.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # vim: set fileencoding=utf-8 : # make.py @@ -60,6 +60,9 @@ module_root = "" release_dir = "" module_root_parent = "" optionals_root = "" +key_name = "ace_preAlpha" +key = "" +dssignfile = "" ############################################################################### # http://akiscode.com/articles/sha-1directoryhash.shtml @@ -196,6 +199,7 @@ def find_bi_tools(work_drive): else: raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") + def find_depbo_tools(regKey): """Use registry entries to find DePBO-based tools.""" stop = False @@ -248,6 +252,7 @@ def find_depbo_tools(regKey): #Strip any quotations from the path due to a MikeRo tool bug which leaves a trailing space in some of its registry paths. return [pboproject_path.strip('"'),rapify_path.strip('"'),makepbo_path.strip('"')] + def color(color): """Set the color. Works on Win32 and normal terminals.""" if sys.platform == "win32": @@ -336,6 +341,7 @@ def copy_important_files(source_dir,destination_dir): finally: os.chdir(originalDir) + def copy_optionals_for_building(mod,pbos): src_directories = os.listdir(optionals_root) current_dir = os.getcwd() @@ -350,10 +356,15 @@ def copy_optionals_for_building(mod,pbos): #print ("Adding the following file: " + file_name) pbos.append(file_name) pbo_path = os.path.join(release_dir, "@ace","optionals",file_name) + sigFile_name = file_name +"."+ key_name + ".bisign" + sig_path = os.path.join(release_dir, "@ace","optionals",sigFile_name) if (os.path.isfile(pbo_path)): print("Moving " + pbo_path + " for processing.") shutil.move(pbo_path, os.path.join(release_dir,"@ace","addons",file_name)) + if (os.path.isfile(sig_path)): + #print("Moving " + sig_path + " for processing.") + shutil.move(sig_path, os.path.join(release_dir,"@ace","addons",sigFile_name)) except: print_error("Error in moving") raise @@ -384,7 +395,8 @@ def copy_optionals_for_building(mod,pbos): finally: os.chdir(current_dir) -def cleanup_optionals(mod,pbos): + +def cleanup_optionals(mod): print("") try: for dir_name in mod: @@ -400,9 +412,17 @@ def cleanup_optionals(mod,pbos): file_name = "ace_{}.pbo".format(dir_name) src_file_path = os.path.join(release_dir, "@ace","addons",file_name) dst_file_path = os.path.join(release_dir, "@ace","optionals",file_name) + + sigFile_name = file_name +"."+ key_name + ".bisign" + src_sig_path = os.path.join(release_dir, "@ace","addons",sigFile_name) + dst_sig_path = os.path.join(release_dir, "@ace","optionals",sigFile_name) + if (os.path.isfile(src_file_path)): #print("Preserving " + file_name) os.renames(src_file_path,dst_file_path) + if (os.path.isfile(src_sig_path)): + #print("Preserving " + sigFile_name) + os.renames(src_sig_path,dst_sig_path) except FileExistsError: print_error(file_name + " already exists") continue @@ -411,12 +431,40 @@ def cleanup_optionals(mod,pbos): except: print_error("Cleaning Optionals Failed") raise + + +def purge(dir, pattern, friendlyPattern="files"): + print_green("Deleting " + friendlyPattern + " files from directory: " + dir) + for f in os.listdir(dir): + if re.search(pattern, f): + os.remove(os.path.join(dir, f)) + + +def build_signature_file(file_name): + global key + global dssignfile + print("Signing with " + key + ".") + ret = subprocess.call([dssignfile, key, file_name]) + if ret == 0: + return True + else: + return False ############################################################################### + def main(argv): """Build an Arma addon suite in a directory from rules in a make.cfg file.""" print_blue(("\nmake.py for Arma, modified for Advanced Combat Environment v" + __version__)) + global work_drive + global module_root + global release_dir + global module_root_parent + global optionals_root + global key_name + global key + global dssignfile + if sys.platform != "win32": print_error("Non-Windows platform (Cygwin?). Please re-run from cmd.") sys.exit(1) @@ -436,7 +484,7 @@ def main(argv): release_version = 0 # Version of release use_pboproject = True # Default to pboProject build tool make_target = "DEFAULT" # Which section in make.cfg to use for the build - new_key = False # Make a new key and use it to sign? + new_key = True # Make a new key and use it to sign? quiet = False # Suppress output from build tool? # Parse arguments @@ -512,6 +560,8 @@ See the make.cfg file for additional build options. else: check_external = False + print_yellow("\nCheck external references is set to " + str(check_external)) + # Get the directory the make script is in. make_root = os.path.dirname(os.path.realpath(__file__)) make_root_parent = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) @@ -524,26 +574,27 @@ See the make.cfg file for additional build options. commit_id = subprocess.check_output(["git", "rev-parse", "HEAD"]) commit_id = str(commit_id, "utf-8")[:8] + key_name = str(key_name+"-"+commit_id) except: print_error("FAILED TO DETERMINE COMMIT ID.") commit_id = "NOGIT" cfg = configparser.ConfigParser(); try: - global work_drive - global module_root - global release_dir - global module_root_parent - global optionals_root - cfg.read(os.path.join(make_root, "make.cfg")) # Project name (with @ symbol) project = cfg.get(make_target, "project", fallback="@"+os.path.basename(os.getcwd())) + # BI Tools work drive on Windows + work_drive = cfg.get(make_target, "work_drive", fallback="P:\\") + # Private key path key = cfg.get(make_target, "key", fallback=None) + # Private key creation directory + private_key_path = cfg.get(make_target, "private_key_path", fallback=os.path.join(work_drive, "private_keys")) + # Project prefix (folder path) prefix = cfg.get(make_target, "prefix", fallback="") @@ -561,9 +612,6 @@ See the make.cfg file for additional build options. # List of directories to ignore when detecting ignore = [x.strip() for x in cfg.get(make_target, "ignore", fallback="release").split(',')] - # BI Tools work drive on Windows - work_drive = cfg.get(make_target, "work_drive", fallback="P:\\") - # Which build tool should we use? build_tool = cfg.get(make_target, "build_tool", fallback="addonbuilder").lower() @@ -640,6 +688,20 @@ See the make.cfg file for additional build options. print ("No cache found.") cache = {} + if not os.path.isdir(os.path.join(release_dir, project, "addons")): + try: + os.makedirs(os.path.join(release_dir, project, "addons")) + except: + print_error("Cannot create release directory") + raise + + if not os.path.isdir(os.path.join(release_dir, project, "keys")): + try: + os.makedirs(os.path.join(release_dir, project, "keys")) + except: + print_error("Cannot create release directory") + raise + #Temporarily copy optionals_root for building. They will be removed later. optionals_modules = [] optional_files = [] @@ -659,32 +721,43 @@ See the make.cfg file for additional build options. # Make the key specified from command line if necessary. if new_key: - if not os.path.isfile(os.path.join(module_root, key_name + ".biprivatekey")): - print_green("\nRequested key does not exist.") + if not os.path.isfile(os.path.join(private_key_path, key_name + ".biprivatekey")): + print_yellow("\nRequested key does not exist.") + try: + os.makedirs(private_key_path) + except: + pass + curDir = os.getcwd() + os.chdir(private_key_path) ret = subprocess.call([dscreatekey, key_name]) # Created in make_root + os.chdir(curDir) if ret == 0: - print_blue("Created: " + os.path.join(module_root, key_name + ".biprivatekey")) + print_green("Created: " + os.path.join(private_key_path, key_name + ".biprivatekey")) + print("Removing any old signature keys...") + purge(os.path.join(module_root, release_dir, project, "addons"), "^.*\.bisign$","*.bisign") + purge(os.path.join(module_root, release_dir, project, "optionals"), "^.*\.bisign$","*.bisign") + purge(os.path.join(module_root, release_dir, project, "keys"), "^.*\.bikey$","*.bikey") else: print_error("Failed to create key!") try: - print_blue("Copying public key to release directory.") + print("Copying public key to release directory.") try: - os.makedirs(os.path.join(module_root, release_dir, "Keys")) + os.makedirs(os.path.join(module_root, release_dir, project, "keys")) except: pass - shutil.copyfile(os.path.join(module_root, key_name + ".bikey"), os.path.join(module_root, release_dir, "Keys", key_name + ".bikey")) + shutil.copyfile(os.path.join(private_key_path, key_name + ".bikey"), os.path.join(module_root, release_dir, project, "keys", key_name + ".bikey")) except: - raise print_error("Could not copy key to release directory.") + raise else: - print_green("\nNOTE: Using key " + os.path.join(module_root, key_name + ".biprivatekey")) + print_green("\nNOTE: Using key " + os.path.join(private_key_path, key_name + ".biprivatekey")) - key = os.path.join(module_root, key_name + ".biprivatekey") + key = os.path.join(private_key_path, key_name + ".biprivatekey") # For each module, prep files and then build. @@ -692,6 +765,7 @@ See the make.cfg file for additional build options. for module in modules: print_green("\nMaking " + module + "-"*max(1, (60-len(module)))) missing = False + sigMissing = False # Cache check if module in cache: @@ -706,16 +780,23 @@ See the make.cfg file for additional build options. # Hash the module new_sha = get_directory_hash(os.path.join(module_root, module)) - # Is the pbo file missing? + # Is the pbo or sig file missing? missing = not os.path.isfile(os.path.join(release_dir, project, "addons", "ace_{}.pbo".format(module))) + sigFile = pbo_name_prefix+module + ".pbo." + key_name + ".bisign" + sigMissing = not os.path.isfile(os.path.join(release_dir, project, "addons", sigFile )) + if missing: - print("ace_{}.pbo".format(module) + " is missing. Building...") + print_yellow("Missing PBO file ace_{}.pbo".format(module) + ". Building...") # Check if it needs rebuilt # print ("Hash:", new_sha) if old_sha == new_sha and not missing: if not force_build: print("Module has not changed.") + if sigMissing: + if key: + print("Missing Signature key " + sigFile) + build_signature_file(os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix + module + ".pbo")) # Skip everything else continue @@ -740,13 +821,13 @@ See the make.cfg file for additional build options. try: # Remove the old pbo, key, and log - old = os.path.join(module_root, release_dir, project, "Addons", module) + "*" + old = os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix+module) + "*" files = glob.glob(old) for f in files: os.remove(f) if pbo_name_prefix: - old = os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix+module) + "*" + old = os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix+module) + "*" files = glob.glob(old) for f in files: os.remove(f) @@ -759,11 +840,11 @@ See the make.cfg file for additional build options. # Build the module into a pbo print_blue("Building: " + os.path.join(work_drive, prefix, module)) - print_blue("Destination: " + os.path.join(module_root, release_dir, project, "Addons")) + print_blue("Destination: " + os.path.join(module_root, release_dir, project, "addons")) # Make destination folder (if needed) try: - os.makedirs(os.path.join(module_root, release_dir, project, "Addons")) + os.makedirs(os.path.join(module_root, release_dir, project, "addons")) except: pass @@ -815,7 +896,7 @@ See the make.cfg file for additional build options. if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): print_green("$NOBIN$ Found. Proceeding with non-binarizing!") - cmd = [makepboTool, "-P","-A","-L","-N","-G", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"Addons")] + cmd = [makepboTool, "-P","-A","-L","-N","-G", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"addons")] else: if check_external: @@ -837,7 +918,7 @@ See the make.cfg file for additional build options. # Prettyprefix rename the PBO if requested. if pbo_name_prefix: try: - os.rename(os.path.join(module_root, release_dir, project, "Addons", module+".pbo"), os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix+module+".pbo")) + os.rename(os.path.join(module_root, release_dir, project, "addons", module+".pbo"), os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix+module+".pbo")) except: raise print_error("Could not rename built PBO with prefix.") @@ -845,9 +926,9 @@ See the make.cfg file for additional build options. if key: print("Signing with " + key + ".") if pbo_name_prefix: - ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")]) + ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix + module + ".pbo")]) else: - ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "Addons", module + ".pbo")]) + ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "addons", module + ".pbo")]) if ret == 0: build_successful = True @@ -887,7 +968,7 @@ See the make.cfg file for additional build options. # Call AddonBuilder os.chdir("P:\\") - cmd = [addonbuilder, os.path.join(work_drive, prefix, module), os.path.join(make_root, release_dir, project, "Addons"), "-clear", "-project="+work_drive] + cmd = [addonbuilder, os.path.join(work_drive, prefix, module), os.path.join(make_root, release_dir, project, "addons"), "-clear", "-project="+work_drive] if not do_binarize: cmd.append("-packonly") @@ -910,7 +991,7 @@ See the make.cfg file for additional build options. # Prettyprefix rename the PBO if requested. if pbo_name_prefix: try: - os.rename(os.path.join(make_root, release_dir, project, "Addons", module+".pbo"), os.path.join(make_root, release_dir, project, "Addons", pbo_name_prefix+module+".pbo")) + os.rename(os.path.join(make_root, release_dir, project, "addons", module+".pbo"), os.path.join(make_root, release_dir, project, "addons", pbo_name_prefix+module+".pbo")) except: raise print_error("Could not rename built PBO with prefix.") @@ -920,9 +1001,9 @@ See the make.cfg file for additional build options. if key: print("Signing with " + key + ".") if pbo_name_prefix: - ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")]) + ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "addons", pbo_name_prefix + module + ".pbo")]) else: - ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "Addons", module + ".pbo")]) + ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "addons", module + ".pbo")]) if ret == 0: build_successful = True @@ -965,13 +1046,16 @@ See the make.cfg file for additional build options. print_green("\nDone.") + copy_important_files(module_root_parent,os.path.join(release_dir, "@ace")) + cleanup_optionals(optionals_modules) + # Make release if make_release: print_blue("\nMaking release: " + project + "-" + release_version + ".zip") try: # Delete all log files - for root, dirs, files in os.walk(os.path.join(module_root, release_dir, project, "Addons")): + for root, dirs, files in os.walk(os.path.join(module_root, release_dir, project, "addons")): for currentFile in files: if currentFile.lower().endswith("log"): os.remove(os.path.join(root, currentFile)) @@ -1004,8 +1088,6 @@ See the make.cfg file for additional build options. except: print_error("Could not copy files. Is Arma 3 running?") - copy_important_files(module_root_parent,os.path.join(release_dir, "@ace")) - cleanup_optionals(optionals_modules,optional_files) if __name__ == "__main__": main(sys.argv) input("Press Enter to continue...")