From 68ac3de0bd7d7808a0a78862444ee0da94ec98c2 Mon Sep 17 00:00:00 2001 From: linmeideli <2558527373@qq.com> Date: Mon, 17 Aug 2026 10:26:21 +0800 Subject: [PATCH] Relaxation of the Disconnection Threshold --- src/Empostor.Api/Config/TimeoutConfig.cs | 2 +- src/Empostor.Server/Net/State/Game.Outgoing.cs | 2 +- src/Empostor.Server/config.json | 2 +- .../Next.Hazel/Udp/UdpConnection.KeepAlive.cs | 2 +- .../Next.Hazel/Udp/UdpConnection.Reliable.cs | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Empostor.Api/Config/TimeoutConfig.cs b/src/Empostor.Api/Config/TimeoutConfig.cs index 60cef70..0d42646 100644 --- a/src/Empostor.Api/Config/TimeoutConfig.cs +++ b/src/Empostor.Api/Config/TimeoutConfig.cs @@ -4,7 +4,7 @@ namespace Empostor.Api.Config { public const string Section = "Timeout"; - public int SpawnTimeout { get; set; } = 2500; + public int SpawnTimeout { get; set; } = 5000; public int ConnectionTimeout { get; set; } = 2500; } diff --git a/src/Empostor.Server/Net/State/Game.Outgoing.cs b/src/Empostor.Server/Net/State/Game.Outgoing.cs index 40a1a74..ad2b6c4 100644 --- a/src/Empostor.Server/Net/State/Game.Outgoing.cs +++ b/src/Empostor.Server/Net/State/Game.Outgoing.cs @@ -118,7 +118,7 @@ namespace Empostor.Server.Net.State writer.WritePacked(components.Count); foreach (var component in components) { - writer.WritePacked(obj.NetId); + writer.WritePacked(component.NetId); writer.StartMessage(1); await component.SerializeAsync(writer, true); writer.EndMessage(); diff --git a/src/Empostor.Server/config.json b/src/Empostor.Server/config.json index a54b874..c145828 100644 --- a/src/Empostor.Server/config.json +++ b/src/Empostor.Server/config.json @@ -30,7 +30,7 @@ "PacketSizeLimit": 1203 }, "Timeout": { - "SpawnTimeout": 2500, + "SpawnTimeout": 5000, "ConnectionTimeout": 2500 }, "Compatibility": { diff --git a/src/NextFast.Hazel-New/Next.Hazel/Udp/UdpConnection.KeepAlive.cs b/src/NextFast.Hazel-New/Next.Hazel/Udp/UdpConnection.KeepAlive.cs index 8f713e7..621ff7e 100644 --- a/src/NextFast.Hazel-New/Next.Hazel/Udp/UdpConnection.KeepAlive.cs +++ b/src/NextFast.Hazel-New/Next.Hazel/Udp/UdpConnection.KeepAlive.cs @@ -9,7 +9,7 @@ namespace Next.Hazel.Udp; partial class UdpConnection { internal ConcurrentDictionary activePingPackets = new(); - private int keepAliveInterval = 1500; + private int keepAliveInterval = 1000; /// /// The timer creating keepalive pulses. diff --git a/src/NextFast.Hazel-New/Next.Hazel/Udp/UdpConnection.Reliable.cs b/src/NextFast.Hazel-New/Next.Hazel/Udp/UdpConnection.Reliable.cs index b0c07c4..9ff13fd 100644 --- a/src/NextFast.Hazel-New/Next.Hazel/Udp/UdpConnection.Reliable.cs +++ b/src/NextFast.Hazel-New/Next.Hazel/Udp/UdpConnection.Reliable.cs @@ -35,7 +35,7 @@ partial class UdpConnection /// connection will be marked as disconnected and the Disconnected event /// will be invoked. /// - public volatile int DisconnectTimeout = 5000; + public volatile int DisconnectTimeout = 7500; /// /// Holds the last ID allocated. @@ -61,7 +61,7 @@ partial class UdpConnection /// A compounding multiplier to back off resend timeout. /// Applied to ping before first timeout when ResendTimeout == 0. /// - public volatile float ResendPingMultiplier = 2; + public volatile float ResendPingMultiplier = 1.2f; /// /// The starting timeout, in miliseconds, at which data will be resent.