limit how many errors can be sent per second (prevents message queue from overflowing and stopping all commands from working) and removed useless semicolons that i added for some reason here
This commit is contained in:
@@ -36,6 +36,10 @@ namespace Barotrauma
|
||||
|
||||
public LuaScriptLoader luaScriptLoader;
|
||||
|
||||
private double minErrorTime = 0.05f;
|
||||
|
||||
private double lastSentError = 0;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
hook?.Update();
|
||||
@@ -61,6 +65,8 @@ namespace Barotrauma
|
||||
|
||||
public void PrintError(object message)
|
||||
{
|
||||
if (Timing.TotalTime - lastSentError < minErrorTime) return;
|
||||
|
||||
if (message == null) { message = "nil"; }
|
||||
string str = message.ToString();
|
||||
|
||||
@@ -85,6 +91,8 @@ namespace Barotrauma
|
||||
GameServer.Log(errorMsg, ServerLog.MessageType.Error);
|
||||
}
|
||||
#endif
|
||||
|
||||
lastSentError = Timing.TotalTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user