diff --git a/collab-vm-server-1.3/TurnQueue.cs b/collab-vm-server-1.3/TurnQueue.cs index 1744c06..8dc4b6d 100644 --- a/collab-vm-server-1.3/TurnQueue.cs +++ b/collab-vm-server-1.3/TurnQueue.cs @@ -56,6 +56,9 @@ public class TurnQueue if (!queue.TryPeek(out var u)) return; Utilities.Log(LogLevel.DEBUG, $"It is now {u.Username}'s turn"); currentTurnRemainingTime = turnTime; + } else { + timer.Stop(); + currentTurnRemainingTime = 0; } SendTurnUpdate(); } @@ -116,6 +119,7 @@ public class TurnQueue if (queue.Count == 0) { timer.Stop(); + currentTurnRemainingTime = 0; } SendTurnUpdate(); } diff --git a/collab-vm-server-1.3/User.cs b/collab-vm-server-1.3/User.cs index 017a457..ff1d195 100644 --- a/collab-vm-server-1.3/User.cs +++ b/collab-vm-server-1.3/User.cs @@ -166,7 +166,7 @@ public class User await this.vm.AddUser(this); List chatmsg = new(); chatmsg.Add("chat"); - foreach (ChatMessage msg in vm.ChatHistory) + foreach (ChatMessage msg in vm.ChatHistory.ToArray()) { chatmsg.Add(msg.Username); chatmsg.Add(msg.Message); diff --git a/collab-vm-server-1.3/VM.cs b/collab-vm-server-1.3/VM.cs index 6fd4d05..d6a2a00 100644 --- a/collab-vm-server-1.3/VM.cs +++ b/collab-vm-server-1.3/VM.cs @@ -160,7 +160,7 @@ public class VM else await u.SendChat(user.Username!, messageSanitized); } - ChatHistory.PushFront(new ChatMessage {Username = user.Username!, Message = messageSanitized}); + ChatHistory.PushBack(new ChatMessage {Username = user.Username!, Message = messageSanitized}); } public async Task SendMouse(int x, int y, int mask)