Merge branch 'master' of https://github.com/Regalis11/Barotrauma
This commit is contained in:
@@ -2426,7 +2426,8 @@ namespace Barotrauma.Networking
|
||||
settingsBytes = outmsg.LengthBytes - settingsBytes;
|
||||
|
||||
int campaignBytes = outmsg.LengthBytes;
|
||||
if (outmsg.LengthBytes < MsgConstants.MTU - 500 &&
|
||||
bool hasSpaceForCampaignData = outmsg.LengthBytes < MsgConstants.MTU - 500;
|
||||
if (hasSpaceForCampaignData &&
|
||||
GameMain.GameSession?.GameMode is MultiPlayerCampaign campaign && campaign.Preset == GameMain.NetLobbyScreen.SelectedMode)
|
||||
{
|
||||
outmsg.WriteBoolean(true);
|
||||
@@ -2437,6 +2438,10 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
outmsg.WriteBoolean(false);
|
||||
outmsg.WritePadBits();
|
||||
if (!hasSpaceForCampaignData)
|
||||
{
|
||||
DebugConsole.Log($"Not enough space to fit campaign data in the lobby update (length {outmsg.LengthBytes} bytes), omitting...");
|
||||
}
|
||||
}
|
||||
campaignBytes = outmsg.LengthBytes - campaignBytes;
|
||||
|
||||
@@ -2447,6 +2452,10 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
WriteClientList(segmentTable, c, outmsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugConsole.Log($"Not enough space to fit client list in the lobby update (length {outmsg.LengthBytes} bytes), omitting...");
|
||||
}
|
||||
clientListBytes = outmsg.LengthBytes - clientListBytes;
|
||||
|
||||
int chatMessageBytes = outmsg.LengthBytes;
|
||||
|
||||
Reference in New Issue
Block a user