diff --git a/Subsurface/Source/GUI/GUIComponent.cs b/Subsurface/Source/GUI/GUIComponent.cs index b059c8267..6b5730af5 100644 --- a/Subsurface/Source/GUI/GUIComponent.cs +++ b/Subsurface/Source/GUI/GUIComponent.cs @@ -29,10 +29,18 @@ namespace Barotrauma if (ComponentsToUpdate.Contains(this)) return; ComponentsToUpdate.Add(this); - List fixedChildren = new List(children); - foreach (GUIComponent c in fixedChildren) + try { - c.AddToGUIUpdateList(); + List fixedChildren = new List(children); + foreach (GUIComponent c in fixedChildren) + { + c.AddToGUIUpdateList(); + } + } + catch (Exception e) + { + DebugConsole.NewMessage("Error in AddToGUIUPdateList! GUIComponent runtime type: "+this.GetType().ToString()+"; children count: "+children.Count.ToString(),Color.Red); + throw e; } } @@ -372,13 +380,21 @@ namespace Barotrauma }*/ - //use a fixed list since children can change their order in the main children list - //TODO: maybe find a more efficient way of handling changes in list order - List fixedChildren = new List(children); - foreach (GUIComponent c in fixedChildren) + try { - if (!c.Visible) continue; - c.Update(deltaTime); + //use a fixed list since children can change their order in the main children list + //TODO: maybe find a more efficient way of handling changes in list order + List fixedChildren = new List(children); + foreach (GUIComponent c in fixedChildren) + { + if (!c.Visible) continue; + c.Update(deltaTime); + } + } + catch (Exception e) + { + DebugConsole.NewMessage("Error in Update! GUIComponent runtime type: " + this.GetType().ToString() + "; children count: " + children.Count.ToString(), Color.Red); + throw e; } } diff --git a/Subsurface/Source/Networking/GameServerLogin.cs b/Subsurface/Source/Networking/GameServerLogin.cs index 130e104e8..0b4917dee 100644 --- a/Subsurface/Source/Networking/GameServerLogin.cs +++ b/Subsurface/Source/Networking/GameServerLogin.cs @@ -86,9 +86,7 @@ namespace Barotrauma.Networking inc.SenderConnection.Disconnect("Server full"); return; } - - DebugConsole.NewMessage("New player has joined the server", Color.White); - + byte userID; string version = "", packageName = "", packageHash = "", name = ""; try @@ -106,6 +104,8 @@ namespace Barotrauma.Networking return; } + DebugConsole.NewMessage("New player has joined the server (" + name + ", " + inc.SenderConnection.RemoteEndPoint.Address.ToString() + ")", Color.White); + #if !DEBUG if (string.IsNullOrWhiteSpace(name)) { diff --git a/Subsurface/Source/Program.cs b/Subsurface/Source/Program.cs index 201d399c6..f678a1114 100644 --- a/Subsurface/Source/Program.cs +++ b/Subsurface/Source/Program.cs @@ -157,7 +157,7 @@ namespace Barotrauma sb.AppendLine("\n"); sb.AppendLine("Last debug messages:"); - for (int i = DebugConsole.Messages.Count - 1; i > 0 && i > DebugConsole.Messages.Count - 10; i-- ) + for (int i = DebugConsole.Messages.Count - 1; i > 0 && i > DebugConsole.Messages.Count - 15; i-- ) { sb.AppendLine(" "+DebugConsole.Messages[i].Time+" - "+DebugConsole.Messages[i].Text); }