From 5b1820799e106489348f8b630208d0413d996256 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 25 二月 2026 18:17:35 +0800
Subject: [PATCH] 0312 登录的时候地图自己验证是否卡号了,卡号则直接进行下线逻辑

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py                   |    6 +++---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py |    9 ++++++++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index bb64b5f..fba04fb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -1904,7 +1904,8 @@
 #@return 返回值无意义
 #@remarks C++封包触发, 玩家下线
 def PlayerDisconnect(index, tick):
-    GameWorld.GetPsycoFunc(__Func_PlayerDisconnect)(index, tick)
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    PlayerDisconnectEx(curPlayer, tick)
     return
 
 ##C++封包触发, 玩家下线
@@ -1912,8 +1913,7 @@
 #@param tick 时间戳
 #@return 返回值无意义
 #@remarks C++封包触发, 玩家下线
-def __Func_PlayerDisconnect(index, tick):
-    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+def PlayerDisconnectEx(curPlayer, tick):
     try:
         # 避免因逻辑错误导致下线失败,可能导致回档的情况
         DoPlayerDisconnect(curPlayer, tick)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py
index ac345e7..03c88ac 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py
@@ -3048,7 +3048,14 @@
             
         #     self.sendOKString(CommonDefine.dgPlayerLogin, pack, accountRec.getBuffer())
         #     return True
-
+        curPlayer = GameWorld.GetPlayerManager().FindPlayerByAccID(authAccID)
+        if curPlayer:
+            # 因为一些不确定的情况 玩家没有登出
+            from Player import ChPlayer
+            mylog.warning('玩家异常未登出 accid = %s-%s...'%(authAccID, authPack.IDType))
+            ChPlayer.PlayerDisconnectEx(curPlayer, GameWorld.GetGameWorld().GetTick())
+            self.sendFailString(CommonDefine.dgPlayerLogin, pack, disKickRepeatPlayer)
+            return True
 
         mylog.debug('auth accid = %s-%s...'%(authAccID, authPack.IDType))
         

--
Gitblit v1.8.0