Compare commits
10 Commits
4.1.1
...
7322799b78
| Author | SHA1 | Date | |
|---|---|---|---|
|
7322799b78
|
|||
|
|
db7bdf1ecd | ||
|
|
0f8783ffa9 | ||
|
|
fac86f18f0 | ||
|
|
87b6f359c1 | ||
|
|
cbd8b5963e | ||
|
|
09ee014912 | ||
|
|
5b482b022f | ||
|
|
8afe420527 | ||
| ff98546907 |
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project badly attempts [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [4.1.2] - 2024-04-25
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix internal versioning
|
||||
- Swap resupply box 5.56 magazines due to mod conflict
|
||||
- Group deletion handler now properly processes empty groups and logs errors
|
||||
|
||||
## [4.1.1] - 2024-04-19
|
||||
|
||||
### Added
|
||||
|
||||
8
custom_sounds.hpp
Normal file
8
custom_sounds.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
// EXAMPLE
|
||||
// class uncon_alarm
|
||||
// {
|
||||
// name = "uncon_alarm";
|
||||
// sound[] = {"AJ_CBRN_V2\sounds\AJ_warning_1.ogg", 0.9, 1, 5}; //directory, volume, pitch, range
|
||||
// titles[]={};
|
||||
// };
|
||||
@@ -26,7 +26,7 @@ class SupplyCrates {
|
||||
{"1Rnd_SmokeRed_Grenade_shell",24},
|
||||
{"1Rnd_SmokeGreen_Grenade_shell",24},
|
||||
{"1Rnd_SmokeYellow_Grenade_shell",12},
|
||||
{"Tier1_30Rnd_556x45_M856A1_EMag",25},
|
||||
{"rhs_mag_30Rnd_556x45_M855A1_Stanag",25},
|
||||
{"ACE_30Rnd_556x45_Stanag_M995_AP_mag",75},
|
||||
{"SMA_30Rnd_762x35_BLK_EPR",25},
|
||||
{"SMA_20Rnd_762x51mm_M80A1_EPR",25},
|
||||
@@ -57,7 +57,7 @@ class SupplyCrates {
|
||||
{"MRAWS_HEAT_F",35},
|
||||
{"MRAWS_HE_F",15},
|
||||
{"Tier1_250Rnd_762x51_Belt_M993_AP",50},
|
||||
{"Tier1_30Rnd_556x45_M856A1_EMag",25},
|
||||
{"rhs_mag_30Rnd_556x45_M855A1_Stanag",25},
|
||||
{"ACE_30Rnd_556x45_Stanag_M995_AP_mag",50},
|
||||
{"Titan_AA",10},
|
||||
{"Titan_AT",10},
|
||||
|
||||
@@ -96,6 +96,10 @@ class CfgFunctions {
|
||||
#include "custom_scripts.hpp"
|
||||
};
|
||||
|
||||
class CfgSounds {
|
||||
#include "custom_sounds.hpp"
|
||||
};
|
||||
|
||||
class CfgLeaflets {
|
||||
#include "custom_leaflets.hpp"
|
||||
};
|
||||
|
||||
@@ -120,6 +120,7 @@ class DOUBLES(PREFIX,performance) {
|
||||
class addServerStatsPFH {};
|
||||
class calculateServerStats {};
|
||||
class addEmptyGroupCleanupPFH {};
|
||||
class addDeadUnitCleanupPFH {};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -21,6 +21,23 @@ _curators = allMissionObjects "ModuleCurator_F";
|
||||
_x removeCuratorAddons ["A3_Modules_F_Curator_Lightning"];
|
||||
} foreach _curators;
|
||||
|
||||
// add dead unit time marking for custom garbage cleanup function
|
||||
addMissionEventHandler ["EntityKilled", {
|
||||
params ["_unit", "_killer", "_instigator", "_useEffects"];
|
||||
|
||||
if not (_unit isKindOf "CAManBase") exitWith {};
|
||||
|
||||
if not (isInRemainsCollector _unit) exitWith {};
|
||||
|
||||
// format["%1 from group %2 died at %3", _unit, group _unit, [datetime] call BIS_fnc_timeToString] remoteExec ["systemChat"];
|
||||
_unit setVariable["milsim_death_time", time];
|
||||
// _unit addEventHandler ["Deleted", {
|
||||
// params ["_entity"];
|
||||
// isGC = _entity getVariable["milsim_garbage_collected", false];
|
||||
// format["%1 from was deleted by custom gc: %2", _entity, str isGC ] remoteExec ["systemChat"];
|
||||
// }];
|
||||
}];
|
||||
|
||||
// declare init complete to other modules
|
||||
missionNamespace setVariable [QGVARMAIN(complete), true, true];
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
//---------------------
|
||||
// Garbage Collection
|
||||
//---------------------
|
||||
|
||||
[
|
||||
QGVAR(emptyGroupCleanup_enable),
|
||||
"CHECKBOX",
|
||||
@@ -22,6 +26,28 @@
|
||||
}
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
[
|
||||
QGVAR(deadUnitCleanup_enable),
|
||||
"CHECKBOX",
|
||||
"Dead Unit Cleanup Enabled",
|
||||
[QUOTE(SETTINGS_GROUP_NAME), QUOTE(COMPONENT_BEAUTIFIED)],
|
||||
true,
|
||||
true,
|
||||
{
|
||||
params ["_value"];
|
||||
[
|
||||
QGVAR(deadUnitCleanup_enable),
|
||||
_value
|
||||
] call EFUNC(common,logSettingChanged);
|
||||
|
||||
if (!isNull (missionNamespace getVariable [QGVAR(deadUnitCleanupPFH), locationNull])) then {
|
||||
deleteLocation GVAR(deadUnitCleanupPFH);
|
||||
};
|
||||
|
||||
call FUNC(addDeadUnitCleanupPFH);
|
||||
}
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
//---------------------
|
||||
// Server CPS
|
||||
//---------------------
|
||||
|
||||
55
framework/performance/functions/fn_addDeadUnitCleanupPFH.sqf
Normal file
55
framework/performance/functions/fn_addDeadUnitCleanupPFH.sqf
Normal file
@@ -0,0 +1,55 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
[
|
||||
LEVEL_INFO,
|
||||
QUOTE(COMPONENT),
|
||||
"Initializing dead unit deletion PFH",
|
||||
[]
|
||||
] call EFUNC(common,log);
|
||||
|
||||
GVAR(deadUnitCleanupPFH) = [
|
||||
{
|
||||
_maxTime = getMissionConfigValue ["corpseRemovalMaxTime", 300] * 1.5;
|
||||
_maxDead = getMissionConfigValue ["corpseLimit", 80];
|
||||
|
||||
// _dead = allDead select { (_x isKindOf "CAManBase") and ( ( (time - (_x getVariable ["milsim_death_time", time] ) ) > (_maxTime * 1.5) ) ) };
|
||||
// _dead = _dead apply { [ (time - (_x getVariable ["milsim_death_time", time] ) ), _x ] };
|
||||
|
||||
_dead = [];
|
||||
{
|
||||
if not (_x isKindOf "CAManBase") then { continue };
|
||||
if not (isInRemainsCollector _x) then { continue };
|
||||
_dead pushBack [time - (_x getVariable ["milsim_death_time", time] ), _x];
|
||||
} forEach allDead;
|
||||
|
||||
_dead sort false;
|
||||
_toDelete = 0 max ( (count _dead ) - _maxDead );
|
||||
_dead = _dead select [0, _toDelete];
|
||||
{
|
||||
_unit = _x#1;
|
||||
// _unit setVariable ["milsim_garbage_collected", true];
|
||||
deleteVehicle (_unit);
|
||||
} foreach _dead;
|
||||
},
|
||||
180,
|
||||
[],
|
||||
{ // on creation
|
||||
[
|
||||
LEVEL_INFO,
|
||||
QUOTE(COMPONENT),
|
||||
"dead unit deletion PFH loaded",
|
||||
[]
|
||||
] call EFUNC(common,log);
|
||||
},
|
||||
{ // on deletion
|
||||
[
|
||||
LEVEL_INFO,
|
||||
QUOTE(COMPONENT),
|
||||
"dead unit deletion PFH unloaded",
|
||||
[]
|
||||
] call EFUNC(common,log);
|
||||
},
|
||||
{ (missionNamespace getVariable [QGVAR(deadUnitCleanup_enable), false]) },
|
||||
{ false },
|
||||
[]
|
||||
] call CBA_fnc_createPerFrameHandlerObject;
|
||||
@@ -10,9 +10,39 @@
|
||||
GVAR(emptyGroupCleanupPFH) = [
|
||||
{
|
||||
{
|
||||
if (local _x) then {
|
||||
if ((count units _x) == 0) then {
|
||||
if ((count units _x) == 0) then {
|
||||
if (local _x) then {
|
||||
[
|
||||
LEVEL_INFO,
|
||||
QUOTE(COMPONENT),
|
||||
"DELETING EMPTY GROUP",
|
||||
[
|
||||
["groupId", groupId _x],
|
||||
["netId", netId _x]
|
||||
]
|
||||
] call EFUNC(common,log);
|
||||
deleteGroup _x;
|
||||
} else {
|
||||
if (isServer) then {
|
||||
[
|
||||
LEVEL_INFO,
|
||||
QUOTE(COMPONENT),
|
||||
"NON LOCAL EMPTY GROUP",
|
||||
[
|
||||
["groupId", groupId _x],
|
||||
["groupOwner", groupOwner _x]
|
||||
]
|
||||
] call EFUNC(common,log);
|
||||
} else {
|
||||
[
|
||||
LEVEL_INFO,
|
||||
QUOTE(COMPONENT),
|
||||
"EMPTY REMOTE GROUP",
|
||||
[
|
||||
["groupId", groupId _x]
|
||||
]
|
||||
] call EFUNC(common,log);
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach allGroups;
|
||||
@@ -39,6 +69,3 @@ GVAR(emptyGroupCleanupPFH) = [
|
||||
{ not (missionNamespace getVariable [QGVAR(emptyGroupCleanup_enable), false]) },
|
||||
[]
|
||||
] call CBA_fnc_createPerFrameHandlerObject;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ if (isNil "_items") exitWith {
|
||||
[_box,1] call ace_cargo_fnc_setSize;
|
||||
|
||||
// ignore weight restrictions for carry/drag
|
||||
_box setVariable ["ace_ignoreWeightCarry", true, true];
|
||||
_box setVariable ["ace_dragging_ignoreWeightCarry", true, true];
|
||||
|
||||
// Return the box
|
||||
_box;
|
||||
@@ -1,4 +1,4 @@
|
||||
#define MAJOR 4
|
||||
#define MINOR 0
|
||||
#define PATCHLVL 0
|
||||
#define MINOR 1
|
||||
#define PATCHLVL 2
|
||||
#define BUILD 0
|
||||
|
||||
Reference in New Issue
Block a user