ready for dedi -- improvements to resupply, triageIcons too
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
QGVAR(server_cps_enable),
|
||||
"CHECKBOX",
|
||||
"Server CPS Metrics Enabled",
|
||||
["17th Battalion", "Server Metrics"],
|
||||
[QUOTE(SETTINGS_GROUP_NAME), QUOTE(COMPONENT_BEAUTIFIED)],
|
||||
true,
|
||||
true,
|
||||
{
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
_counter = _counter + 1;
|
||||
};
|
||||
// in an empty mission, the _counter may go well over 2000 times per frame!
|
||||
[
|
||||
LEVEL_INFO,
|
||||
QUOTE(COMPONENT),
|
||||
format ["Average Execution: %1 times per frame", _counter / (diag_frameNo - _frameNo)],
|
||||
[["playerRawCPS", _counter / (diag_frameNo - _frameNo)]]
|
||||
] call EFUNC(common,log);
|
||||
player setVariable [QGVAR(player_raw_cps), _counter / (diag_frameNo - _frameNo), true];
|
||||
private _rawCPS = _counter / (diag_frameNo - _frameNo);
|
||||
player setVariable [QGVAR(player_raw_cps), _rawCPS, true];
|
||||
|
||||
// with suspension
|
||||
private _counter = 0;
|
||||
@@ -28,13 +23,23 @@
|
||||
uiSleep 0.001; // waits at least 1 frame
|
||||
};
|
||||
// _counter says one per frame, as expected
|
||||
private _playerCPS = _counter / (diag_frameNo - _frameNo);
|
||||
player setVariable [QGVAR(player_cps), _playerCPS, true];
|
||||
|
||||
// log to RPT
|
||||
[
|
||||
LEVEL_INFO,
|
||||
QUOTE(COMPONENT),
|
||||
format ["Average Execution: %1 times per frame", _counter / (diag_frameNo - _frameNo)],
|
||||
[["playerCPS", _counter / (diag_frameNo - _frameNo)]]
|
||||
] call EFUNC(common,log);
|
||||
player setVariable [QGVAR(player_cps), _counter / (diag_frameNo - _frameNo), true];
|
||||
|
||||
{_this call EFUNC(common,log);},
|
||||
[
|
||||
LEVEL_INFO,
|
||||
QUOTE(COMPONENT),
|
||||
format ["Average Execution: %1 times per frame", _playerCPS],
|
||||
[
|
||||
["playerRawCPS", _rawCPS],
|
||||
["playerCPS", _playerCPS]
|
||||
]
|
||||
]
|
||||
] call CBA_fnc_directCall;
|
||||
};
|
||||
|
||||
nil;
|
||||
@@ -1,3 +1,5 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
[] spawn {
|
||||
// warning: while loop without suspension executes multiple times per frame
|
||||
private _counter = 0;
|
||||
@@ -8,10 +10,9 @@
|
||||
_counter = _counter + 1;
|
||||
};
|
||||
|
||||
diag_log text format ["[MILSIM] (server) Average Server Execution: %1 times per frame", _counter / (diag_frameNo - _frameNo)];
|
||||
|
||||
missionNamespace setVariable ["milsim_raw_cps", _counter / (diag_frameNo - _frameNo)];
|
||||
publicVariable "milsim_raw_cps";
|
||||
private _rawCPS = _counter / (diag_frameNo - _frameNo);
|
||||
missionNamespace setVariable [QGVAR(server_raw_cps), _rawCPS];
|
||||
publicVariable QGVAR(server_raw_cps);
|
||||
|
||||
// with suspension
|
||||
private _counter = 0;
|
||||
@@ -23,12 +24,31 @@
|
||||
uiSleep 0.001; // waits at least 1 frame
|
||||
};
|
||||
|
||||
diag_log text format ["[MILSIM] (server) Average Server Execution: %1 times per frame", _counter / (diag_frameNo - _frameNo)];
|
||||
private _serverCPS = _counter / (diag_frameNo - _frameNo);
|
||||
missionNamespace setVariable [QGVAR(server_cps), _counter / (diag_frameNo - _frameNo)];
|
||||
publicVariable QGVAR(server_cps);
|
||||
|
||||
missionNamespace setVariable ["milsim_cps", _counter / (diag_frameNo - _frameNo)];
|
||||
publicVariable "milsim_cps";
|
||||
// log to RPT
|
||||
[
|
||||
|
||||
{_this call EFUNC(common,log);},
|
||||
[
|
||||
LEVEL_INFO,
|
||||
QUOTE(COMPONENT),
|
||||
format ["Average Server Execution: %1 times per frame", _serverCPS],
|
||||
[
|
||||
["serverRawCPS", _rawCPS],
|
||||
["serverCPS", _serverCPS]
|
||||
]
|
||||
]
|
||||
] call CBA_fnc_directCall;
|
||||
|
||||
["milsim_serverEfficiency", [ [ ["float", "milsim_raw_cps", missionNamespace getVariable ["milsim_raw_cps", -1]], ["float", "milsim_cps", missionNamespace getVariable ["milsim_cps", -1]] ] ] ] call CBA_fnc_localEvent;
|
||||
[QGVARMAIN(serverEfficiency), [
|
||||
[
|
||||
["float", QGVAR(server_raw_cps), missionNamespace getVariable [QGVAR(server_raw_cps), -1]],
|
||||
["float", QGVAR(server_cps), missionNamespace getVariable [QGVAR(server_cps), -1]]
|
||||
]
|
||||
]] call CBA_fnc_localEvent;
|
||||
};
|
||||
|
||||
nil;
|
||||
Reference in New Issue
Block a user