Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1.  
  2. PopMon_fnc_monitor = {
  3. _this spawn {
  4. if (isNil "_this") then {_this = []};
  5. if (typeName(_this) != "ARRAY") then {_this = [_this]};
  6. private ["_delay","_tiempoSync"];
  7. _delay = if ((count _this) > 0) then {_this select 0} else {0};
  8. _metrosx = _this select 1;
  9. _tiempoSync = 3;
  10. if (_delay >= _tiempoSync) then {_delay = _delay - _tiempoSync};
  11. if (isNil "PopMon_init") then {
  12. PopMon_init = true;
  13. PopMon_clientID = nil;
  14. PopMon_sincroDatos = [-1,0,0];
  15. [0, {
  16. PopMon_clientID = owner _this;
  17. PopMon_clientID publicVariableClient "PopMon_clientID";
  18. }, player] call CBA_fnc_globalExecute;
  19. waitUntil {!isNil "PopMon_clientID"};
  20. "PopMon_sincroDatos" addPublicVariableEventHandler {
  21. private ["_valor", "_maquina", "_mediaFPS", "_minFPS"];
  22. _valor = _this select 1;
  23. _maquina = _valor select 0;
  24. _mediaFPS = _valor select 1;
  25. _minFPS = _valor select 2;
  26. if ((_maquina >= 0) && {_maquina < (count PopMon_data)}) then {
  27. (PopMon_data select _maquina) set [0, (((PopMon_data select _maquina) select 0) + _mediaFPS)];
  28. (PopMon_data select _maquina) set [1, (((PopMon_data select _maquina) select 1) + _minFPS)];
  29. (PopMon_data select _maquina) set [2, (((PopMon_data select _maquina) select 2) + 1)];
  30. };
  31. };
  32. };
  33. if ((_delay > 0) && (isNil "PopMon_handle")) then {
  34. PopMon_handle = [_tiempoSync, _delay,_metrosx] spawn {
  35. waitUntil {
  36. PopMon_data = [[0,0,0],[0,0,0],[0,0,0]];
  37. [-2, {
  38. if (isNil "PopMon_maquina") then {
  39. PopMon_maquina = switch (true) do {
  40. case (isServer): {0};
  41. case (!hasInterface && !isDedicated): {1};
  42. default {2};
  43. };
  44. };
  45. PopMon_sincroDatos = [PopMon_maquina, diag_fps, diag_fpsmin];
  46. (_this select 0) publicVariableClient "PopMon_sincroDatos";
  47. }, [PopMon_clientID]] call CBA_fnc_globalExecute;
  48. uisleep (_this select 0);
  49. private ["_salida"];
  50. _salida = [];
  51. {
  52. _salida = _salida + [
  53. round((_x select 1) / ((_x select 2) max (1))),
  54. round((_x select 0) / ((_x select 2) max (1))),
  55. (_x select 2)
  56. ];
  57. } forEach PopMon_data;
  58. _metros = _this select 2;
  59. if (_metros > 2000) then {_metros = 2000};
  60. todos_objetos = count nearestObjects [player, ["ALL"], _metros];
  61.  
  62. tios_objetos = count nearestObjects [player, ["MAN"], _metros];
  63.  
  64. arraycosas = nearestObjects [player, ["AllVehicles"], _metros]; { if !(_x isKindOf "Man") then {arrayland pushback _x};} foreach arraycosas;
  65.  
  66. 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",
  67. todos_objetos,count arrayland,tios_objetos,
  68. round(diag_fpsmin),
  69. round(diag_fps)
  70. ] + _salida);
  71. arrayland = [];
  72. uisleep (_this select 1);
  73. false;
  74. };
  75. };
  76. hint format["Inicio Monitoreo de FPS.\n%1 Intervalo por segundo.", (_delay + _tiempoSync)];
  77. } else {
  78. terminate PopMon_handle;
  79. PopMon_handle = nil;
  80. hint "Paro monitoreo de FPS.";
  81. };
  82. };
  83. };
  84.  
  85. [4,1000] call PopMon_fnc_monitor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement