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
@@ -113,7 +113,7 @@ namespace Barotrauma.Networking
Task<int> readTask = readStream?.ReadAsync(readTempBytes, 0, readTempBytes.Length, readCancellationToken.Token);
if (readTask is null) { return Option<int>.None(); }
int timeOutMilliseconds = 100;
int timeOutMilliseconds = 150;
for (int i = 0; i < 150; i++)
{
if (status is StatusEnum.ShutDown)
@@ -94,6 +94,10 @@ namespace Barotrauma
}
}
}
if (Inventory.Owner is Character { DisabledByEvent: true })
{
spawnedItem.IsActive = false;
}
}
else
{
@@ -363,7 +367,10 @@ namespace Barotrauma
if (GameMain.Server != null)
{
Client client = GameMain.Server.ConnectedClients.Find(c => c.Character == character);
if (client != null) GameMain.Server.SetClientCharacter(client, null);
if (client != null)
{
GameMain.Server.SetClientCharacter(client, null);
}
}
#endif
}
@@ -39,26 +39,6 @@ namespace Barotrauma.Networking
public const int MaxEventPacketsPerUpdate = 4;
/// <summary>
/// How long the server waits for the clients to get in sync after the round has started before kicking them
/// </summary>
public const float RoundStartSyncDuration = 60.0f;
/// <summary>
/// How long the server keeps events that everyone currently synced has received
/// </summary>
public const float EventRemovalTime = 15.0f;
/// <summary>
/// If a client hasn't received an event that has been succesfully sent to someone within this time, they get kicked
/// </summary>
public const float OldReceivedEventKickTime = 10.0f;
/// <summary>
/// If a client hasn't received an event after this time, they get kicked
/// </summary>
public const float OldEventKickTime = 30.0f;
/// <summary>
/// Interpolates the positional error of a physics body towards zero.
/// </summary>
@@ -17,8 +17,8 @@ namespace Barotrauma.Networking
abstract class NetworkConnection
{
public const double TimeoutThreshold = 60.0; //full minute for timeout because loading screens can take quite a while
public const double TimeoutThresholdInGame = 10.0;
public static double TimeoutThresholdNotInGame => GameMain.NetworkMember?.ServerSettings?.TimeoutThresholdNotInGame ?? 60.0; //full minute for timeout because loading screens can take quite a while
public static double TimeoutThresholdInGame => GameMain.NetworkMember?.ServerSettings?.TimeoutThresholdInGame ?? 10.0;
public AccountInfo AccountInfo { get; private set; } = AccountInfo.None;
@@ -25,6 +25,6 @@ abstract class P2PConnection : NetworkConnection<P2PEndpoint>
public void Heartbeat()
{
Timeout = TimeoutThreshold;
Timeout = TimeoutThresholdNotInGame;
}
}
@@ -1041,12 +1041,77 @@ namespace Barotrauma.Networking
private set;
}
[Serialize(10.0f, IsPropertySaveable.Yes)]
//note: the following properties are autoinitialized because it's important for them to have sensible (non-zero) default values,
//and non-admin clients don't know the values set by the server
[Serialize(30.0f, IsPropertySaveable.Yes)]
public float MinimumMidRoundSyncTimeout
{
get;
private set;
}
} = 30.0f;
/// <summary>
/// How long the server waits for the clients to get in sync after the round has started before kicking them
/// </summary>
[Serialize(120.0f, IsPropertySaveable.Yes)]
public float RoundStartSyncDuration
{
get;
private set;
} = 120.0f;
/// <summary>
/// How long the server keeps events that everyone currently synced has received
/// </summary>
[Serialize(15.0f, IsPropertySaveable.Yes)]
public float EventRemovalTime
{
get;
private set;
} = 15.0f;
/// <summary>
/// If a client hasn't received an event that has been succesfully sent to someone within this time, they get kicked
/// </summary>
[Serialize(20.0f, IsPropertySaveable.Yes)]
public float OldReceivedEventKickTime
{
get;
private set;
} = 20.0f;
/// <summary>
/// If a client hasn't received an event after this time, they get kicked
/// </summary>
[Serialize(40.0f, IsPropertySaveable.Yes)]
public float OldEventKickTime
{
get;
private set;
} = 40.0f;
/// <summary>
/// Amount of seconds before connections between the server and the clients time out (i.e. if the client fails to receive messages from the server for this amount of time or vice versa, they get disconnected).
/// Used when a round is not currently running, i.e. in the lobby or in loading screens.
/// </summary>
[Serialize(60.0f, IsPropertySaveable.Yes)]
public float TimeoutThresholdNotInGame
{
get;
private set;
} = 60.0f;
/// <summary>
/// Amount of seconds before connections between the server and the clients time out (i.e. if the client fails to receive messages from the server for this amount of time or vice versa, they get disconnected).
/// Used when a round is running.
/// </summary>
[Serialize(10.0f, IsPropertySaveable.Yes)]
public float TimeoutThresholdInGame
{
get;
private set;
} = 10.0f;
private bool karmaEnabled;
[Serialize(false, IsPropertySaveable.Yes)]