v1.6.17.0 (Unto the Breach update)

This commit is contained in:
Regalis11
2024-10-22 17:29:04 +03:00
parent e74b3cdb17
commit 6e6c17e100
417 changed files with 17166 additions and 5870 deletions
@@ -20,6 +20,8 @@ namespace Barotrauma.Networking
public bool AllowModDownloads { get; private set; } = true;
public string AutomaticallyAttemptedPassword = string.Empty;
public readonly record struct Callbacks(
Callbacks.MessageCallback OnMessageReceived,
Callbacks.DisconnectCallback OnDisconnect,
@@ -102,8 +104,9 @@ namespace Barotrauma.Networking
TaskPool.Add($"{GetType().Name}.{nameof(GetAccountId)}", GetAccountId(), t =>
{
if (GameMain.Client?.ClientPeer is null) { return; }
// FIXME what to do with this?
//if (GameMain.Client?.ClientPeer is null) { return; }
if (!t.TryGetResult(out Option<AccountId> accountId))
{
Close(PeerDisconnectPacket.WithReason(DisconnectReason.AuthenticationFailed));
@@ -118,7 +121,7 @@ namespace Barotrauma.Networking
var body = new ClientAuthTicketAndVersionPacket
{
Name = GameMain.Client.Name,
Name = GameMain.Client?.Name ?? "Unknown",
OwnerKey = ownerKey,
AccountId = accountId,
AuthTicket = authTicket,
@@ -177,10 +180,16 @@ namespace Barotrauma.Networking
var passwordPacket = INetSerializableStruct.Read<ServerPeerPasswordPacket>(inc.Message);
if (WaitingForPassword) { return; }
passwordPacket.Salt.TryUnwrap(out passwordSalt);
passwordPacket.RetriesLeft.TryUnwrap(out var retries);
if (!string.IsNullOrWhiteSpace(AutomaticallyAttemptedPassword))
{
SendPassword(AutomaticallyAttemptedPassword);
return;
}
LocalizedString pwMsg = TextManager.Get("PasswordRequired");
passwordMsgBox?.Close();
@@ -224,10 +224,13 @@ namespace Barotrauma.Networking
ToolBox.ThrowIfNull(netPeerConfiguration);
#if DEBUG
netPeerConfiguration.SimulatedDuplicatesChance = GameMain.Client.SimulatedDuplicatesChance;
netPeerConfiguration.SimulatedMinimumLatency = GameMain.Client.SimulatedMinimumLatency;
netPeerConfiguration.SimulatedRandomLatency = GameMain.Client.SimulatedRandomLatency;
netPeerConfiguration.SimulatedLoss = GameMain.Client.SimulatedLoss;
if (GameMain.Client != null)
{
netPeerConfiguration.SimulatedDuplicatesChance = GameMain.Client.SimulatedDuplicatesChance;
netPeerConfiguration.SimulatedMinimumLatency = GameMain.Client.SimulatedMinimumLatency;
netPeerConfiguration.SimulatedRandomLatency = GameMain.Client.SimulatedRandomLatency;
netPeerConfiguration.SimulatedLoss = GameMain.Client.SimulatedLoss;
}
#endif
byte[] bufAux = msg.PrepareForSending(compressPastThreshold, out bool isCompressed, out _);