From a476e04e32f59b6ea9ead5c9de1b11b61dd15be6 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 7 Jul 2015 00:32:10 -0600 Subject: [PATCH] Reduce time spent on chunk loading Not sure why this is so slow. Will find out at some point. --- TrueCraft/MultiplayerServer.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/TrueCraft/MultiplayerServer.cs b/TrueCraft/MultiplayerServer.cs index 7ef14ae..93a8cc7 100644 --- a/TrueCraft/MultiplayerServer.cs +++ b/TrueCraft/MultiplayerServer.cs @@ -378,16 +378,9 @@ namespace TrueCraft { } } - if (ChunksToSchedule.Count != 0) - { - int attempts = 50; - while (attempts-- > 0) - { - Tuple t; - if (ChunksToSchedule.TryTake(out t)) - ScheduleUpdatesForChunk(t.Item1, t.Item2); - } - } + Tuple t; + if (ChunksToSchedule.TryTake(out t)) + ScheduleUpdatesForChunk(t.Item1, t.Item2); EnvironmentWorker.Change(1000 / 20, 0); }