Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. private ["_lastdeploy","_hours","_minutes","_date","_key","_result","_outcome"];
  2. _lastdeploy = 0;
  3. _lastlongdeploy = 0;
  4. _oldLocalSeconds = 0;
  5. _startHours = 9;
  6. globalRealtime = parseNumber("terminator" callExtension "gettime");
  7. publicVariable "globalRealtime";
  8.  
  9. _key = "CHILD:307:";
  10. _result = _key call server_hiveReadWrite;
  11. _outcome = _result select 0;
  12. if(_outcome == "PASS") then {
  13. _date = _result select 1;
  14. _startHours = _date select 3;
  15. _date set [4,0];
  16.  
  17. if(dayz_fullMoonNights) then {
  18. _date = [2013,8,3,_startHours,0];
  19. };
  20.  
  21. setDate _date;
  22.  
  23. diag_log (format["TIME SYNC: Global Time set to %1 - MIN-FPS: %2 - AVG-FPS: %3", _date, diag_fpsmin, diag_fps]);
  24. PVDZE_plr_SetDate = _date;
  25. publicVariable "PVDZE_plr_SetDate";
  26.  
  27. PVDZE_StartDate = _date;
  28. publicVariable "PVDZE_StartDate";
  29. };
  30.  
  31. while {true} do {
  32. globalRealtime = parseNumber("terminator" callExtension "gettime");
  33.  
  34. if(!isNil "restartTime") then {
  35. _date = PVDZE_StartDate;
  36.  
  37. _newLocalSeconds = 86400 / restartTime * globalRealtime;
  38.  
  39. if (DZE_FastTimeSkip) then {
  40. _skipSeconds = _newLocalSeconds - _oldLocalSeconds;
  41. _oldLocalSeconds = _newLocalSeconds;
  42. skipTime(_skipSeconds/3600);
  43. };
  44.  
  45. _newTime = _newLocalSeconds / 60;
  46. //diag_log ("HOUR: " + str(floor(_startHours + (_newTime/60))));
  47. _date set [3,floor(_startHours + (_newTime/60)) % 24];
  48. _date set [4,floor(_newTime % 60)];
  49.  
  50. PVDZE_plr_SetDate = _date;
  51. };
  52.  
  53. if ((globalRealtime - _lastdeploy) >= 30) then {
  54. publicVariable "globalRealtime";
  55. _lastdeploy = _lastdeploy + 30;
  56. };
  57.  
  58. if ((globalRealtime - _lastlongdeploy) >= 300) then {
  59. diag_log (format["TIME SYNC: Global Time set to %1 - MIN-FPS: %2 - AVG-FPS: %3", PVDZE_plr_SetDate, diag_fpsmin, diag_fps]);
  60. setDate PVDZE_plr_SetDate;
  61. publicVariable "PVDZE_plr_SetDate";
  62. _lastlongdeploy = _lastlongdeploy + 300;
  63. };
  64.  
  65. uiSleep 10;
  66. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement