浏览代码

【优化】客户端ping包轮询

johnclot69 1 年之前
父节点
当前提交
b40a58a533
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      Unity/Assets/Scripts/Codes/Hotfix/Client/Ping/PingComponentSystem.cs

+ 1 - 2
Unity/Assets/Scripts/Codes/Hotfix/Client/Ping/PingComponentSystem.cs

@@ -29,6 +29,7 @@ namespace ET.Client
             protected override void Destroy(PingComponent self)
             protected override void Destroy(PingComponent self)
             {
             {
                 self.Ping = default;
                 self.Ping = default;
+                TimerComponent.Instance?.Remove(ref self.Timer);
             }
             }
         }
         }
 
 
@@ -56,8 +57,6 @@ namespace ET.Client
                 self.Ping = time2 - time1;
                 self.Ping = time2 - time1;
 
 
                 TimeInfo.Instance.ServerMinusClientTime = response.Time + (time2 - time1) / 2 - time2;
                 TimeInfo.Instance.ServerMinusClientTime = response.Time + (time2 - time1) / 2 - time2;
-
-                await TimerComponent.Instance.WaitAsync(2000);
             }
             }
             catch (RpcException e)
             catch (RpcException e)
             {
             {