Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PopMon_fnc_monitor = {
- _this spawn {
- if (isNil "_this") then {_this = []};
- if (typeName(_this) != "ARRAY") then {_this = [_this]};
- private ["_delay","_tiempoSync"];
- _delay = if ((count _this) > 0) then {_this select 0} else {0};
- _metrosx = _this select 1;
- _tiempoSync = 3;
- if (_delay >= _tiempoSync) then {_delay = _delay - _tiempoSync};
- if (isNil "PopMon_init") then {
- PopMon_init = true;
- PopMon_clientID = nil;
- PopMon_sincroDatos = [-1,0,0];
- [0, {
- PopMon_clientID = owner _this;
- PopMon_clientID publicVariableClient "PopMon_clientID";
- }, player] call CBA_fnc_globalExecute;
- waitUntil {!isNil "PopMon_clientID"};
- "PopMon_sincroDatos" addPublicVariableEventHandler {
- private ["_valor", "_maquina", "_mediaFPS", "_minFPS"];
- _valor = _this select 1;
- _maquina = _valor select 0;
- _mediaFPS = _valor select 1;
- _minFPS = _valor select 2;
- if ((_maquina >= 0) && {_maquina < (count PopMon_data)}) then {
- (PopMon_data select _maquina) set [0, (((PopMon_data select _maquina) select 0) + _mediaFPS)];
- (PopMon_data select _maquina) set [1, (((PopMon_data select _maquina) select 1) + _minFPS)];
- (PopMon_data select _maquina) set [2, (((PopMon_data select _maquina) select 2) + 1)];
- };
- };
- };
- if ((_delay > 0) && (isNil "PopMon_handle")) then {
- PopMon_handle = [_tiempoSync, _delay,_metrosx] spawn {
- waitUntil {
- PopMon_data = [[0,0,0],[0,0,0],[0,0,0]];
- [-2, {
- if (isNil "PopMon_maquina") then {
- PopMon_maquina = switch (true) do {
- case (isServer): {0};
- case (!hasInterface && !isDedicated): {1};
- default {2};
- };
- };
- PopMon_sincroDatos = [PopMon_maquina, diag_fps, diag_fpsmin];
- (_this select 0) publicVariableClient "PopMon_sincroDatos";
- }, [PopMon_clientID]] call CBA_fnc_globalExecute;
- uisleep (_this select 0);
- private ["_salida"];
- _salida = [];
- {
- _salida = _salida + [
- round((_x select 1) / ((_x select 2) max (1))),
- round((_x select 0) / ((_x select 2) max (1))),
- (_x select 2)
- ];
- } forEach PopMon_data;
- _metros = _this select 2;
- if (_metros > 2000) then {_metros = 2000};
- todos_objetos = count nearestObjects [player, ["ALL"], _metros];
- tios_objetos = count nearestObjects [player, ["MAN"], _metros];
- arraycosas = nearestObjects [player, ["AllVehicles"], _metros]; { if !(_x isKindOf "Man") then {arrayland pushback _x};} foreach arraycosas;
- hintSilent format (["FPS Mios: %4 - %5\nFPS del Server: %6 - %7 / %8\nFPS del Headless: %9 - %10 / %11\nFPS de Otros Clientes: %12 - %13 / %14\n Cosas con ClassName 1k: %1 \nTodos los Vehiculos 1k: %2 \nSolo Tios en 1k: %3",
- todos_objetos,count arrayland,tios_objetos,
- round(diag_fpsmin),
- round(diag_fps)
- ] + _salida);
- arrayland = [];
- uisleep (_this select 1);
- false;
- };
- };
- hint format["Inicio Monitoreo de FPS.\n%1 Intervalo por segundo.", (_delay + _tiempoSync)];
- } else {
- terminate PopMon_handle;
- PopMon_handle = nil;
- hint "Paro monitoreo de FPS.";
- };
- };
- };
- [4,1000] call PopMon_fnc_monitor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement