fix: Adds idle cpu config and forces on in debug (#790)

* Adds `core.enableIdleCPU` to modernuo.json
* Forces idle CPU on in DEBUG
* Reverts idle detection back to CPS
This commit is contained in:
Kamron Batman 2021-09-17 00:15:16 -07:00 committed by GitHub
parent b6641c4853
commit 56c348ac68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 52 additions and 80 deletions

View file

@ -45,23 +45,19 @@ namespace Server
}
}
public static int Slice(long tickCount)
public static void Slice(long tickCount)
{
var deltaSinceTurn = tickCount - _lastTickTurned;
var events = 0;
while (deltaSinceTurn >= _tickRate)
{
deltaSinceTurn -= _tickRate;
_lastTickTurned += _tickRate;
events += Turn() ? 1 : 0;
Turn();
}
return events;
}
private static bool Turn()
private static void Turn()
{
bool events = false;
_timerWheelExecuting = true;
var turnNextWheel = false;
@ -97,8 +93,6 @@ namespace Server
continue;
}
events = true;
do
{
var next = timer._nextTimer;
@ -124,8 +118,6 @@ namespace Server
}
_timerWheelExecuting = false;
return events;
}
private static void Execute(Timer timer)