Skip to content

Commit da21b41

Browse files
Mod: remove unused namespace, add update heartbeat time api for Proxy
1 parent e6b3908 commit da21b41

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

‎SynapseServer/Server/Managers/GateManager.cs‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using System.Collections.Concurrent;
55
using System.Net;
66
using System.Net.Sockets;
7-
using System.Reflection;
8-
using System.Xml.Linq;
97

108
/// <summary>
119
/// Proxy represents a tcp connection between server and client
@@ -26,6 +24,11 @@ public class Proxy : ProxyCommon
2624
public Proxy(TcpClient client_) : base(client_) { }
2725

2826
protected override void OnStart()
27+
{
28+
UpdateHeartbeatTime();
29+
}
30+
31+
public void UpdateHeartbeatTime()
2932
{
3033
lastHeartbeatTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
3134
}
@@ -93,7 +96,7 @@ protected override void OnStart()
9396
/// <para> Hangle queue msg (inbox and outbox) </para>
9497
/// <para> Check validness of proxies </para>
9598
/// </summary>
96-
/// <param name="dt"></param>
99+
/// <param name="dt"> delta time (second) of this tick frame </param>
97100
protected override void DoUpdate(float dt)
98101
{
99102
if (!isActive) return;
@@ -432,8 +435,7 @@ private void CheckProxies()
432435
[Rpc(RpcConst.AnyClient)]
433436
public void PingHeartbeatRemote(Proxy proxy)
434437
{
435-
long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
436-
proxy.lastHeartbeatTime = now;
438+
proxy.UpdateHeartbeatTime();
437439
}
438440

439441
#endregion
@@ -459,9 +461,6 @@ private void InvokeRpc(Proxy proxy, Msg msg)
459461
var (owner, instance) = GetRpcOwnerAndInstance(msg.instanceId);
460462
if (owner == null || instance == null) return;
461463

462-
// check rpc type
463-
//if ((rpcMethodInfo.rpcType & RpcConst.OwnClient) != 0 && owner.id != proxy.proxyId) return;
464-
465464
// pack and invoke method
466465
try
467466
{

0 commit comments

Comments
 (0)