added restrictMessageSize

This commit is contained in:
Evil Factory
2021-12-25 18:25:34 -03:00
parent d39d4c8297
commit d033a43fc7
2 changed files with 3 additions and 1 deletions
@@ -700,7 +700,7 @@ namespace Barotrauma
{ {
var tempBuffer = new ReadWriteMessage(); var tempBuffer = new ReadWriteMessage();
WriteStatus(tempBuffer); WriteStatus(tempBuffer);
if (msg.LengthBytes + tempBuffer.LengthBytes >= 255 && restrictMessageSize) if (msg.LengthBytes + tempBuffer.LengthBytes >= 255 && restrictMessageSize && GameMain.Lua.networking.restrictMessageSize)
{ {
msg.Write(false); msg.Write(false);
DebugConsole.ThrowError($"Error when writing character spawn data: status data caused the length of the message to exceed 255 bytes ({msg.LengthBytes} + {tempBuffer.LengthBytes})"); DebugConsole.ThrowError($"Error when writing character spawn data: status data caused the length of the message to exceed 255 bytes ({msg.LengthBytes} + {tempBuffer.LengthBytes})");
@@ -628,6 +628,8 @@ namespace Barotrauma
{ {
public LuaSetup env; public LuaSetup env;
public bool restrictMessageSize = true;
public LuaNetworking(LuaSetup e) public LuaNetworking(LuaSetup e)
{ {
env = e; env = e;