mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-17 09:10:27 +03:00
Replace sleep with uiSleep
see the below links for more info. uiSleep is based off of a more accurate method of tracking time, whereas sleep can fluctuate depending on application performance since it is based on framerate. https://community.bistudio.com/wiki/uiSleep https://community.bistudio.com/wiki/sleep_vs_uiSleep https://community.bistudio.com/wiki/sleep
This commit is contained in:
@@ -60,11 +60,11 @@ if (_characterID != "0") then {
|
||||
|
||||
//Check if update is requested
|
||||
if (_isNewPos || _force) then {
|
||||
//diag_log ("position..." + str(_isNewPos) + " / " + str(_force)); sleep 0.05;
|
||||
//diag_log ("position..." + str(_isNewPos) + " / " + str(_force)); uiSleep 0.05;
|
||||
if (((_charPos select 0) == 0) && ((_charPos select 1) == 0)) then {
|
||||
//Zero Position
|
||||
} else {
|
||||
//diag_log ("getting position..."); sleep 0.05;
|
||||
//diag_log ("getting position..."); uiSleep 0.05;
|
||||
_playerPos = [round(direction _character),_charPos];
|
||||
_lastPos = _character getVariable["lastPos",_charPos];
|
||||
if (count _lastPos > 2 && count _charPos > 2) then {
|
||||
@@ -76,12 +76,12 @@ if (_characterID != "0") then {
|
||||
if (count _charPos < 3) then {
|
||||
_playerPos = [];
|
||||
};
|
||||
//diag_log ("position = " + str(_playerPos)); sleep 0.05;
|
||||
//diag_log ("position = " + str(_playerPos)); uiSleep 0.05;
|
||||
};
|
||||
_character setVariable ["posForceUpdate",false,true];
|
||||
};
|
||||
if (_isNewGear || _forceGear) then {
|
||||
//diag_log ("gear..."); sleep 0.05;
|
||||
//diag_log ("gear..."); uiSleep 0.05;
|
||||
_playerGear = [weapons _character,_magazines];
|
||||
//diag_log ("playerGear: " +str(_playerGear));
|
||||
_backpack = unitBackpack _character;
|
||||
@@ -93,11 +93,11 @@ if (_characterID != "0") then {
|
||||
};
|
||||
};
|
||||
if (_isNewMed || _force) then {
|
||||
//diag_log ("medical..."); sleep 0.05;
|
||||
//diag_log ("medical..."); uiSleep 0.05;
|
||||
if (!(_character getVariable["USEC_isDead",false])) then {
|
||||
//diag_log ("medical check..."); sleep 0.05;
|
||||
//diag_log ("medical check..."); uiSleep 0.05;
|
||||
_medical = _character call player_sumMedical;
|
||||
//diag_log ("medical result..." + str(_medical)); sleep 0.05;
|
||||
//diag_log ("medical result..." + str(_medical)); uiSleep 0.05;
|
||||
};
|
||||
_character setVariable ["medForceUpdate",false,true];
|
||||
};
|
||||
|
||||
@@ -75,7 +75,7 @@ PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object];
|
||||
// TODO: Needs major overhaul
|
||||
while {_retry < 10} do {
|
||||
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
// GET DB ID
|
||||
_key = format["CHILD:388:%1:",_uid];
|
||||
diag_log ("HIVE: WRITE: "+ str(_key));
|
||||
|
||||
@@ -53,7 +53,7 @@ _key call server_hiveWrite;
|
||||
// TODO: Needs major overhaul for 1.1
|
||||
while {_retry < 10} do {
|
||||
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
// GET DB ID
|
||||
_key = format["CHILD:388:%1:",_uid];
|
||||
diag_log ("HIVE: WRITE: "+ str(_key));
|
||||
@@ -103,7 +103,7 @@ _key call server_hiveWrite;
|
||||
|
||||
if(DZE_TRADER_SPAWNMODE) then {
|
||||
_object attachTo [_object_para, [0,0,-1.6]];
|
||||
sleep 1.0;
|
||||
uiSleep 1;
|
||||
WaitUntil{(([_object] call FNC_GetPos) select 2) < 0.1};
|
||||
detach _object;
|
||||
deleteVehicle _object_para;
|
||||
|
||||
@@ -44,7 +44,7 @@ _key call server_hiveWrite;
|
||||
// TODO: Needs major overhaul for 1.1
|
||||
while {_retry < 10} do {
|
||||
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
// GET DB ID
|
||||
_key = format["CHILD:388:%1:",_uid];
|
||||
diag_log ("HIVE: WRITE: "+ str(_key));
|
||||
|
||||
@@ -40,9 +40,7 @@ while {1 == 1} do {
|
||||
diag_log(format["CRASHSPAWNER: %1%2 chance to spawn '%3' with loot table '%4' in %5 seconds", round(_spawnChance * 100), '%', _crashName, _lootTable, _timeToSpawn]);
|
||||
|
||||
// Apprehensive about using one giant long sleep here given server time variances over the life of the server daemon
|
||||
while {time < _timeToSpawn} do {
|
||||
sleep 5;
|
||||
};
|
||||
waituntil {time > _timeToSpawn};
|
||||
|
||||
_spawnRoll = random 1;
|
||||
|
||||
|
||||
@@ -57,5 +57,5 @@ while {1 == 1} do {
|
||||
} count EpochEvents;
|
||||
};
|
||||
};
|
||||
sleep 10;
|
||||
uiSleep 10;
|
||||
};
|
||||
Reference in New Issue
Block a user