update custom remainsCollector event handlers
All checks were successful
Generate testing snapshot / Create testing release (push) Successful in 39s

add extra verbose debug logging to determine owner, time, and whether or not the custom garbage collector is who processed the body
This commit is contained in:
hizumi
2024-06-19 20:55:12 -05:00
parent eee4ac1b83
commit 7c6130891a
2 changed files with 24 additions and 10 deletions

View File

@@ -27,17 +27,31 @@ addMissionEventHandler ["EntityKilled", {
if not (_unit isKindOf "CAManBase") exitWith {}; 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 setVariable["milsim_death_time", time];
// _unit addEventHandler ["Deleted", {
// params ["_entity"]; _unit addEventHandler ["Deleted", {
// isGC = _entity getVariable["milsim_garbage_collected", false]; params ["_entity"];
// format["%1 from was deleted by custom gc: %2", _entity, str isGC ] remoteExec ["systemChat"]; _remainsCollector = _entity getVariable["milsim_garbage_collected", false];
// }]; _decayTime = time - (_entity getVariable ["milsim_death_time", time]);
_i = allUsers select { (getUserInfo _x)#1 isEqualTo _ownerId;};
_owner = if ( _i isEqualTo []) then [ { "server" }, { (getUserInfo (_i#0))#3 }];
diag_log format["isServer: %5, deleted object owned by: %1 via remainsCollector: %2 after %3 seconds of type: %4", _owner, str (not _remainsCollector), _decayTime, _entity, isServer];
}];
}]; }];
// add zeus deletion logging to curator objects
{
_x addEventHandler ["CuratorObjectDeleted", {
params ["_curator", "_entity"];
_decayTime = time - (_entity getVariable ["milsim_death_time", time]);
diag_log format["deleted object: %1 via curator: %2 after %3 seconds", _entity, name _curator, _decayTime];
}];
} foreach _curators;
// declare init complete to other modules // declare init complete to other modules
missionNamespace setVariable [QGVARMAIN(complete), true, true]; missionNamespace setVariable [QGVARMAIN(complete), true, true];

View File

@@ -27,11 +27,11 @@ GVAR(deadUnitCleanupPFH) = [
_dead = _dead select [0, _toDelete]; _dead = _dead select [0, _toDelete];
{ {
_unit = _x#1; _unit = _x#1;
// _unit setVariable ["milsim_garbage_collected", true]; _unit setVariable ["milsim_garbage_collected", true];
deleteVehicle (_unit); deleteVehicle (_unit);
} foreach _dead; } foreach _dead;
}, },
180, 450,
[], [],
{ // on creation { // on creation
[ [