Release 1.11.4.1 (Winter Update)
This commit is contained in:
@@ -1845,6 +1845,9 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
else
|
||||
{
|
||||
//client presumably isn't afk if they clicked to start a round
|
||||
sender.AFK = false;
|
||||
|
||||
bool continueCampaign = inc.ReadBoolean();
|
||||
if (mpCampaign != null && mpCampaign.GameOver || continueCampaign)
|
||||
{
|
||||
@@ -2030,7 +2033,8 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
}
|
||||
|
||||
if (!FileSender.ActiveTransfers.Any(t => t.Connection == c.Connection && t.FileType == FileTransferType.CampaignSave))
|
||||
//don't send the campaign save if there's any other transfers running (client waiting for subs, mods, or already transferring the campaign save)
|
||||
if (FileSender.ActiveTransfers.None(t => t.Connection == c.Connection))
|
||||
{
|
||||
FileSender.StartTransfer(c.Connection, FileTransferType.CampaignSave, GameMain.GameSession.DataPath.SavePath);
|
||||
c.LastCampaignSaveSendTime = (campaign.LastSaveID, (float)NetTime.Now);
|
||||
@@ -3057,7 +3061,7 @@ namespace Barotrauma.Networking
|
||||
WayPoint jobItemSpawnPoint = mainSubWaypoints != null ? mainSubWaypoints[i] : spawnWaypoints[i];
|
||||
|
||||
Character spawnedCharacter = Character.Create(teamClients[i].CharacterInfo, spawnWaypoints[i].WorldPosition, teamClients[i].CharacterInfo.Name, isRemotePlayer: true, hasAi: false);
|
||||
spawnedCharacter.AnimController.Frozen = true;
|
||||
//spawnedCharacter.AnimController.Frozen = true;
|
||||
spawnedCharacter.TeamID = teamID;
|
||||
teamClients[i].Character = spawnedCharacter;
|
||||
var characterData = campaign?.GetClientCharacterData(teamClients[i]);
|
||||
@@ -4302,7 +4306,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
public void SetClientCharacter(Client client, Character newCharacter)
|
||||
{
|
||||
if (client == null) return;
|
||||
if (client == null) { return; }
|
||||
|
||||
//the client's previous character is no longer a remote player
|
||||
if (client.Character != null)
|
||||
@@ -4328,13 +4332,14 @@ namespace Barotrauma.Networking
|
||||
newCharacter.LastNetworkUpdateID = client.Character.LastNetworkUpdateID;
|
||||
}
|
||||
|
||||
if (newCharacter.Info != null && newCharacter.Info.Character == null)
|
||||
if (newCharacter.Info is { Character: null })
|
||||
{
|
||||
newCharacter.Info.Character = newCharacter;
|
||||
}
|
||||
|
||||
newCharacter.SetOwnerClient(client);
|
||||
newCharacter.Enabled = true;
|
||||
newCharacter.AnimController.Frozen = false;
|
||||
client.Character = newCharacter;
|
||||
client.CharacterInfo = newCharacter.Info;
|
||||
CreateEntityEvent(newCharacter, new Character.ControlEventData(client));
|
||||
|
||||
+5
-5
@@ -128,11 +128,11 @@ namespace Barotrauma.Networking
|
||||
//remove old events that have been sent to all clients, they are redundant now
|
||||
// keep at least one event in the list (lastSentToAll == e.ID) so we can use it to keep track of the latest ID
|
||||
// and events less than 15 seconds old to give disconnected clients a bit of time to reconnect without getting desynced
|
||||
if (GameMain.GameSession.RoundDuration > NetConfig.RoundStartSyncDuration)
|
||||
if (GameMain.GameSession.RoundDuration > server.ServerSettings.RoundStartSyncDuration)
|
||||
{
|
||||
events.RemoveAll(e =>
|
||||
(NetIdUtils.IdMoreRecent(lastSentToAll, e.ID) || !inGameClientsPresent) &&
|
||||
e.CreateTime < Timing.TotalTime - NetConfig.EventRemovalTime);
|
||||
e.CreateTime < Timing.TotalTime - server.ServerSettings.EventRemovalTime);
|
||||
}
|
||||
|
||||
for (int i = events.Count - 1; i >= 0; i--)
|
||||
@@ -226,7 +226,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
if (Timing.TotalTime - lastWarningTime > 5.0 &&
|
||||
Timing.TotalTime - lastSentToAnyoneTime > 10.0 &&
|
||||
GameMain.GameSession.RoundDuration > NetConfig.RoundStartSyncDuration)
|
||||
GameMain.GameSession.RoundDuration > server.ServerSettings.RoundStartSyncDuration)
|
||||
{
|
||||
lastWarningTime = Timing.TotalTime;
|
||||
string warningMsg = $"WARNING: ServerEntityEventManager is lagging behind! Last sent id: {lastSentToAnyone}, latest create id: {ID}";
|
||||
@@ -240,8 +240,8 @@ namespace Barotrauma.Networking
|
||||
|
||||
ServerEntityEvent firstEventToResend = events.Find(e => e.ID == (ushort)(lastSentToAll + 1));
|
||||
if (firstEventToResend != null &&
|
||||
GameMain.GameSession.RoundDuration > NetConfig.RoundStartSyncDuration &&
|
||||
((lastSentToAnyoneTime - firstEventToResend.CreateTime) > NetConfig.OldReceivedEventKickTime || (Timing.TotalTime - firstEventToResend.CreateTime) > NetConfig.OldEventKickTime))
|
||||
GameMain.GameSession.RoundDuration > server.ServerSettings.RoundStartSyncDuration &&
|
||||
((lastSentToAnyoneTime - firstEventToResend.CreateTime) > server.ServerSettings.OldReceivedEventKickTime || (Timing.TotalTime - firstEventToResend.CreateTime) > server.ServerSettings.OldEventKickTime))
|
||||
{
|
||||
// This event is 10 seconds older than the last one we've successfully sent,
|
||||
// kick everyone that hasn't received it yet, this is way too old
|
||||
|
||||
+3
-3
@@ -55,13 +55,13 @@ namespace Barotrauma.Networking
|
||||
PasswordRetries = 0;
|
||||
PasswordSalt = null;
|
||||
UpdateTime = Timing.TotalTime + Timing.Step * 3.0;
|
||||
TimeOut = NetworkConnection.TimeoutThreshold;
|
||||
TimeOut = NetworkConnection.TimeoutThresholdNotInGame;
|
||||
AuthSessionStarted = false;
|
||||
}
|
||||
|
||||
public void Heartbeat()
|
||||
{
|
||||
TimeOut = NetworkConnection.TimeoutThreshold;
|
||||
TimeOut = NetworkConnection.TimeoutThresholdNotInGame;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
protected void ReadConnectionInitializationStep(PendingClient pendingClient, IReadMessage inc, ConnectionInitialization initializationStep)
|
||||
{
|
||||
pendingClient.TimeOut = NetworkConnection.TimeoutThreshold;
|
||||
pendingClient.TimeOut = NetworkConnection.TimeoutThresholdNotInGame;
|
||||
|
||||
if (pendingClient.InitializationStep != initializationStep) { return; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user