Jump to content

Joelma's Time Control


Donnovan

Recommended Posts

Ok, so I just went through a day/sunset/night/sunrise cycle and I'm happy to report everything appears to be working properly! We all seemed to be pretty closely synced with time. There were no reports of sudden night, and no complaints of FPS drop. I didn't experience any either. I think you have a winner here, Donnovan!

Link to comment
Share on other sites

Yes, I am. I did have 1 or 2 players say they thought the day/night transition was "off", but I watched a few of those and never saw any issues. I have a 4 hour restart on my server, so setting it to 4/3 with my server start time of 11am, and it works wonderfully. I haven't seen any issues yet. I do miss the weather, though. :(

Link to comment
Share on other sites

ukko,

 

On the BattlEye filter publicvariable.txt search for the line that start with 5 "" and add at the end of it an empty space and than !"cad_pvar_s".

 

My line is like that after the adition:

5 "" !"PVDZE_" !"norrn" !"usec" !="remExField" !="remExFP" !="drn_AskServerDynamicWeatherEventArgs" !="norrinRAlie" !="BIS_effects_gepv" !="dayzPlayerLogin" !="dayzPlayerLogin2" !"PVAHR_" !="PVAH_AdminReq" !="PVAH_WriteLogReq" !"cad_pvar_s"

***Main post updated with BE filters instructions***

Link to comment
Share on other sites

anoyone who is using this also using infistar? With the new update i keep getting this

"infiSTAR.de Log: ===== (=====) | ClientTime [2013,8,3,13,58]   is not equal to   ServerTime [2013,8,3,13,43]"
 6:24:31 "["PVAHR_0_uzdofmbc_PVAHR_0_uzdofmbc",["=======","========","ClientTime [2013,8,3,13,58]   is not equal to   ServerTime [2013,8,3,13,43]","",""]]"

And yes i added the BE Filters

 

NOTE: The = is my Name and my UID

Link to comment
Share on other sites

anoyone who is using this also using infistar? With the new update i keep getting this

"infiSTAR.de Log: ===== (=====) | ClientTime [2013,8,3,13,58]   is not equal to   ServerTime [2013,8,3,13,43]"
 6:24:31 "["PVAHR_0_uzdofmbc_PVAHR_0_uzdofmbc",["=======","========","ClientTime [2013,8,3,13,58]   is not equal to   ServerTime [2013,8,3,13,43]","",""]]"

And yes i added the BE Filters

 

NOTE: The = is my Name and my UID

 

I use Infistar and I don't have that problem.

 

your new edited script is not working.

 

I get stuck in authentic player or whatever then it retries to connect until i eventually return to lobby.

 

It works fine. You probably messed something up when installing it.

Link to comment
Share on other sites

піднімає сервер FPS

time_control.sql

 

private ["_multi","_maxFPS","_overcast","_fog"];


_multi = 4/3; 		// 1 for a 4 hours day, 4/3 for a 3 hours day, 2 a for a 2 hours day.
_maxFPS = true; 	// true = remove clouds and set cycles to minimum for maximum fps.
                        // true require disabled dynamic weather effects.


_xtraSmooth = 1.0; 	// Try values from 1.0 to 1.5 - Powerfull value.


_overcast = 0; 	// set overcast, from 0 to 1. If _maxFPS = true, it will be 0.
_fog = 0; 		// set fog, from 0 to 1. 0 - no fog, 1 - full fog.

if (_maxFPS && !isNil "drn_fnc_DynamicWeather_SetWeatherLocal") then {
	drn_fnc_DynamicWeather_SetWeatherLocal = {};
};
if (isNil "drn_fnc_DynamicWeather_SetWeatherLocal" || _maxFPS) then {
	if (_maxFPS) then {0 setOvercast 0;} else {0 setOvercast _overcast;};
	0 setFog _fog;
	setWind [0.3, 0.4, true];
};
donn_skipFix = 0;
donn_multi=_multi;
donn_maxFPS=_maxFPS;
if (_maxFPS) then {donn_xs = 1.0;} else {donn_xs = _xtraSmooth;};
if (!isServer) then {
	"cad_pvar_server_date" addPublicVariableEventHandler {_this call donn_setdate;};
	changeCycles = {
		private ["_col","_cya","_speed"]; _speed = _this select 0;
		_cya = [[5,13],[5,15],[5,18],[5,21],[5,23],[5,30],[5,40],[5,45],[5,50]];
		_col = 0; if (donn_maxFPS) then {_col = 0;};
		switch true do {
			case (_speed <=   4.0): {donn_cycles = (_cya select 0 select _col)+((ceil((_cya select 0 select _col)*(donn_xs-1))) min 10)};
			case (_speed <=   6.7): {donn_cycles = (_cya select 1 select _col)+((ceil((_cya select 1 select _col)*(donn_xs-1))) min 10)};
			case (_speed <=   8.9): {donn_cycles = (_cya select 2 select _col)+((ceil((_cya select 2 select _col)*(donn_xs-1))) min 10)};
			case (_speed <=  13.4): {donn_cycles = (_cya select 3 select _col)+((ceil((_cya select 3 select _col)*(donn_xs-1))) min 10)};
			case (_speed <=  20.0): {donn_cycles = (_cya select 4 select _col)+((ceil((_cya select 4 select _col)*(donn_xs-1))) min 10)};
			case (_speed <=  40.0): {donn_cycles = (_cya select 5 select _col)+((ceil((_cya select 5 select _col)*(donn_xs-1))) min 10)};
			case (_speed <=  80.0): {donn_cycles = (_cya select 6 select _col)+((ceil((_cya select 6 select _col)*(donn_xs-1))) min 10)};
			case (_speed <= 160.0): {donn_cycles = (_cya select 7 select _col)+((ceil((_cya select 7 select _col)*(donn_xs-1))) min 10)};
			case (_speed >  160.0): {donn_cycles = (_cya select 8 select _col)+((ceil((_cya select 8 select _col)*(donn_xs-1))) min 10)};
		};
	};
	donn_setdate = {
		private ["_maxError","_sendTime","_dateSer","_dateCli","_date_diff"];
		
		if (isNil "drn_fnc_DynamicWeather_SetWeatherLocal") then {
			if (_maxFPS) then {15 setOvercast 0;} else {15 setOvercast _overcast;};
			15 setFog _fog;
			setWind [0.3, 0.4, true];
		};
		
		_dateSer = ((_this select 1) select 0);
		_dateCli = date;
		_date_diff = (
			((_dateSer select 0) - (_dateCli select 0))*12*31*24 +
			((_dateSer select 1) - (_dateCli select 1))*31*24 +
			((_dateSer select 2) - (_dateCli select 2))*24 +
			((_dateSer select 3) - (_dateCli select 3)) +
			((_dateSer select 4) - (_dateCli select 4))/60
		);
		diag_log format ["DATE DIFFERENCE: %1", _date_diff*60];
		if (isNil "donn_speed") then {
			setDate _dateSer; //NEW LINE 1!
			_date_diff = 0; //NEW LINE 2!
			donn_speed = ((_this select 1) select 1);
			[donn_speed*donn_multi] call changeCycles;
			donn_skipExit = false;
		} else {
			if (((_this select 1) select 1) != donn_speed) then {
				donn_speed = ((_this select 1) select 1);
				[donn_speed*donn_multi] call changeCycles;
				donn_skipExit = true;
			};
		};
		_sendTime = 30;
		donn_skipFix = (_date_diff*3600)/(donn_cycles*_sendTime);
	};
};
waitUntil {!isNil "donn_speed" && !isNil "donn_skipExit"};
if (isServer) then {donn_cycles = 5;};
[] spawn {
	while {true} do {
		private ["_speed","_cycleTime","_timePixel","_skipTime","_tickTimeLenAvg","_tickTimeInitial","_tickTime","_tickTimeLenLast"];
		_speed = donn_speed*donn_multi;
		_cycleTime = 1/donn_cycles;
		_timePixel = 0;
		_skipTime = 0;
		_tickTimeLenAvg = _cycleTime;
		_tickTimeInitial = diag_tickTime;
		_tickTime = _tickTimeInitial;
		donn_skipExit=false;
		while {!donn_skipExit} do {
			skipTime ((_timePixel+donn_skipFix)/3600);
			_skipTime=_skipTime+_timePixel;
			_tickTimeLenLast=diag_tickTime-_tickTime;
			_tickTimeLenAvg=(_tickTimeLenAvg*3+_tickTimeLenLast)/4;
			sleep (_cycleTime*2-_tickTimeLenAvg);
			_tickTime=_tickTime+_tickTimeLenLast;
			_timePixel=(_speed-1)*(_tickTime-_tickTimeInitial)-_skipTime;
		};
	};
};
Link to comment
Share on other sites

time_control.sqf was updated with those two lines, to fix the remaining not so early time sycronization:

"infiSTAR_SetDate" addPublicVariableEventHandler {}; //NEW LINE!
"PVDZE_plr_SetDate" addPublicVariableEventHandler {}; //NEW LINE!
Edit:

Look the first post, to get the new time_control.sqf.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...