Ensure time accel is disabled when world is fully loaded.

Part of #5
This commit is contained in:
zontreck 2025-05-03 14:02:17 -07:00
parent 12d10a9a3c
commit b00e56fdf7
2 changed files with 9 additions and 2 deletions

View file

@ -29,6 +29,7 @@ namespace AriasServerUtils
internal static Warps serverWarps = new Warps();
internal static Random rng = new Random((int)TimeUtil.GetUnixEpochTimestamp());
internal bool isFirstStart = true;
internal static string[] saveInvTypes = new string[] {
@ -322,6 +323,12 @@ namespace AriasServerUtils
private void OnCheckSleepingPlayers()
{
if (API.Side == EnumAppSide.Client) return; // This must only ever be called on the server!
if (isFirstStart)
{
API.World.Calendar.RemoveTimeSpeedModifier("asu_psp");
isFirstStart = false;
}
if (Sleeping)
{
API.Logger.Notification($"Game Hours: {API.World.Calendar.TotalHours}, Difference: {API.World.Calendar.TotalHours - Hours}");