mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 21:29:59 +03:00
Update using local variable from init function.
Thanks to Merlijn for pointing this out.
This commit is contained in:
@@ -27,27 +27,28 @@ epoch_eventIsAny = {
|
|||||||
|
|
||||||
sched_event_init = {
|
sched_event_init = {
|
||||||
diag_log("EPOCH EVENTS INIT");
|
diag_log("EPOCH EVENTS INIT");
|
||||||
EventSchedulerLastTime = "";
|
_lastTime = "";
|
||||||
objNull
|
_lastTime
|
||||||
};
|
};
|
||||||
|
|
||||||
// This function runs ever 10 seconds because ServerCurrentTime is used in player death logging.
|
// This function runs ever 10 seconds because ServerCurrentTime is used in player death logging.
|
||||||
sched_event = {
|
sched_event = {
|
||||||
private ["_date","_key","_result","_outcome","_handle","_datestr"];
|
private ["_date","_key","_result","_outcome","_handle","_datestr","_lastTime"];
|
||||||
// Find current time from server
|
// Find current time from server
|
||||||
|
_lastTime = _this;
|
||||||
_key = "CHILD:307:";
|
_key = "CHILD:307:";
|
||||||
_result = _key call server_hiveReadWrite;
|
_result = _key call server_hiveReadWrite;
|
||||||
_outcome = _result select 0;
|
_outcome = _result select 0;
|
||||||
if(_outcome == "PASS") then {
|
if(_outcome == "PASS") then {
|
||||||
_date = _result select 1;
|
_date = _result select 1;
|
||||||
_datestr = str(_date);
|
_datestr = str(_date);
|
||||||
if (EventSchedulerLastTime != _datestr) then {
|
if (_lastTime != _datestr) then {
|
||||||
|
|
||||||
// internal timestamp
|
// internal timestamp
|
||||||
ServerCurrentTime = [(_date select 3), (_date select 4)];
|
ServerCurrentTime = [(_date select 3), (_date select 4)];
|
||||||
|
|
||||||
// Once a minute.
|
// Once a minute.
|
||||||
EventSchedulerLastTime = _datestr;
|
_lastTime = _datestr;
|
||||||
|
|
||||||
//diag_log ("EVENTS: Local Time is: " + _datestr);
|
//diag_log ("EVENTS: Local Time is: " + _datestr);
|
||||||
|
|
||||||
@@ -73,5 +74,5 @@ sched_event = {
|
|||||||
} forEach EpochEvents;
|
} forEach EpochEvents;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
objNull
|
_lastTime
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user