Release 1.11.4.1 (Winter Update)

This commit is contained in:
Markus Isberg
2025-12-08 14:56:47 +00:00
parent 21e34e5cd8
commit 598966f200
121 changed files with 1614 additions and 819 deletions
@@ -239,6 +239,13 @@ namespace Barotrauma.Networking
}
return;
}
//if we're still downloading mods, we're not ready to receive the campaign save
if (fileType == (byte)FileTransferType.CampaignSave && Screen.Selected is ModDownloadScreen)
{
GameMain.Client.CancelFileTransfer(transferId);
return;
}
if (!ValidateInitialData(fileType, fileName, fileSize, out string errorMsg))
{
@@ -562,6 +562,11 @@ namespace Barotrauma.Networking
{
SendLobbyUpdate();
}
if (Timing.TotalTime > LastMissingCampaignSubRequestTime)
{
TryRequestMissingCampaignSubs();
LastMissingCampaignSubRequestTime = Timing.TotalTime + MissingCampaignSubRequestInterval;
}
}
if (ServerSettings.VoiceChatEnabled)
@@ -2282,13 +2287,7 @@ namespace Barotrauma.Networking
if (GameMain.Client.IsServerOwner) { RequestSelectMode(modeIndex); }
}
if (GameMain.NetLobbyScreen.SelectedMode == GameModePreset.MultiPlayerCampaign)
{
foreach (SubmarineInfo sub in ServerSubmarines.Where(s => !ServerSettings.HiddenSubs.Contains(s.Name)))
{
GameMain.NetLobbyScreen.CheckIfCampaignSubMatches(sub, NetLobbyScreen.SubmarineDeliveryData.Campaign);
}
}
TryRequestMissingCampaignSubs();
GameMain.NetLobbyScreen.SetAllowSpectating(allowSpectating);
GameMain.NetLobbyScreen.SetAllowAFK(allowAFK);
@@ -2644,6 +2643,21 @@ namespace Barotrauma.Networking
ClientPeer?.Send(msg, DeliveryMethod.Reliable);
}
private double LastMissingCampaignSubRequestTime;
const double MissingCampaignSubRequestInterval = 10.0f;
private void TryRequestMissingCampaignSubs()
{
if (GameMain.NetLobbyScreen.SelectedMode == GameModePreset.MultiPlayerCampaign)
{
foreach (SubmarineInfo sub in ServerSubmarines.Where(s => !ServerSettings.HiddenSubs.Contains(s.Name)))
{
GameMain.NetLobbyScreen.CheckIfCampaignSubMatches(sub, NetLobbyScreen.SubmarineDeliveryData.Campaign);
}
}
}
public void RequestFile(FileTransferType fileType, string file, string fileHash)
{
DebugConsole.Log(
@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
@@ -91,7 +91,7 @@ namespace Barotrauma.Networking
});
initializationStep = ConnectionInitialization.AuthInfoAndVersion;
timeout = NetworkConnection.TimeoutThreshold;
timeout = NetworkConnection.TimeoutThresholdNotInGame;
heartbeatTimer = 1.0;
isActive = true;
@@ -139,7 +139,7 @@ namespace Barotrauma.Networking
timeout = Screen.Selected == GameMain.GameScreen
? NetworkConnection.TimeoutThresholdInGame
: NetworkConnection.TimeoutThreshold;
: NetworkConnection.TimeoutThresholdNotInGame;
var (_, packetHeader, initialization) = INetSerializableStruct.Read<PeerPacketHeaders>(inc);