From 7dd00b0936d4ba606de8c815ce0951e271236a1d Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Mon, 18 Dec 2023 12:46:21 +0800 Subject: [PATCH] fix --- Simple/ServerCore/Manager/ClientManager.cs | 7 ++++++- Simple/ServerCore/Manager/ServerManager.cs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Simple/ServerCore/Manager/ClientManager.cs b/Simple/ServerCore/Manager/ClientManager.cs index 8b1f56e..49fef66 100644 --- a/Simple/ServerCore/Manager/ClientManager.cs +++ b/Simple/ServerCore/Manager/ClientManager.cs @@ -22,10 +22,15 @@ namespace ServerCore.Manager private System.Timers.Timer _ClientCheckTimer; private long _RemoveOfflineCacheMin; + /// + /// 初始化并指定检查时间 + /// + /// tick检查毫秒数 + /// 清理掉线分钟数 public void Init(long ticktime, long RemoveOfflineCacheMin) { //换算成毫秒 - _RemoveOfflineCacheMin = RemoveOfflineCacheMin * 1000; + _RemoveOfflineCacheMin = RemoveOfflineCacheMin; _ClientCheckTimer = new System.Timers.Timer(); _ClientCheckTimer.Interval = ticktime; _ClientCheckTimer.AutoReset = true; diff --git a/Simple/ServerCore/Manager/ServerManager.cs b/Simple/ServerCore/Manager/ServerManager.cs index 51b7b55..a1d47b6 100644 --- a/Simple/ServerCore/Manager/ServerManager.cs +++ b/Simple/ServerCore/Manager/ServerManager.cs @@ -14,6 +14,7 @@ namespace ServerCore.Manager public static void InitServer(int port) { g_ClientMgr = new ClientManager(); + g_ClientMgr.Init(45000, 120); g_Log = new LogManager(); g_Login = new LoginManager(); g_Chat = new ChatManager();