From 7dfa5fbeb21542ca15f61d5979caaacccab63450 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 02 三月 2026 20:03:46 +0800
Subject: [PATCH] 519 硬核渠道对接(增加登录失败debug输出明细;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py | 64 ++++++++++++++++++++++++++++++++
1 files changed, 64 insertions(+), 0 deletions(-)
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 9b649b2..8c47919 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
@@ -471,6 +471,7 @@
return dbPlayer.adoUpdateC(col)
def requestLogicProcess(self, pack):
+ GameWorld.GetGameWorld().SetCurGameWorldIndex(0) # 需要设置,不然获取不到 GetMap 等虚拟分线相关接口
db = self.db
if self.IsMergeServer():
# 每X分钟清除已下线的玩家跨服数据, 离线超过3分钟玩家直接返回子服
@@ -3150,6 +3151,69 @@
self.loginHeap += 1
else:
self.loginStartTime = nowTime
+ self.loginHeap = 0
+
+ elif appType == CommonDefine.gitGaore:
+ #读取旧数据, 用到扩展字段
+ accountRec.adoLoadC(collection)
+
+ accountRec.AppID = authPack.AppID.strip(chr(0))
+ accountRec.AccountID = authPack.AccountID
+ accountRec.TokenExpire = authPack.TokenExpire.strip(chr(0))
+ accountRec.Phone = authPack.Phone
+ accountRec.Psw = "1" # token太长 放在Extra
+ accountRec.Adult = authPack.Adult
+ accountRec.RegIP = authPack.IP.strip(chr(0)) # RegIP 当做登录IP用 2018-03-03
+
+ # quick游戏token太长,第一位是spid,第二位是deviceFlag, 第三位是token
+ extraList = authPack.Extra.split("|")
+ if len(extraList) < redefineIndex + 2:
+ self.sendLoginFail(CommonDefine.dgPlayerLogin, authPack, disPswCheckError)
+ return True
+ token = extraList[redefineIndex]
+ uid = extraList[redefineIndex + 1] #原始的uid,含大小写
+
+ # 极速游戏,远程验证
+ if accountRec.RegIP == "127.0.0.1":
+ #debug内部服务器不验证token, 脱机挂玩家不验证
+ mylog.debug('iner no check')
+ else:
+ # url的访问没有多线程 有可能导致登录堆积卡顿的现象
+ if self.loginHeap < 5:
+ # 10秒内前X个玩家验证,后面不验证
+ loginkey = CommFunc.GetLoginKey(authAccID, accountRec.AppID)
+ userID = uid
+ game_sign = "ryzj"
+ game_id = 9134
+ curTime = int(time())
+ sign = md5.md5("%s%s%s%s%s%s" % (userID, game_id, game_sign, token, time, loginkey)).hexdigest()
+ values = {'userID' : userID,
+ 'game_sign' : game_sign,
+ 'game_id' : game_id,
+ 'token' : token,
+ 'time' : curTime,
+ 'sign' : sign,
+ }
+ try:
+ data = urllib.urlencode(values)
+ # 节省配置复杂度 写死地址
+ req = urllib2.Request("https://apisdk.gaore.com/user/verifyAccount/state.php", data)
+ response = urllib2.urlopen(req, timeout=1)
+ the_page = response.read()
+ # 返回结果:(JSON格式): { state: 1 //(登录认证成功);其他失败 }
+ retDict = eval(the_page)
+ if retDict.get("state") != 1:
+ mylog.debug('checktoken fail: req:%s, ret:%s'%(values, the_page))
+ self.sendLoginFail(CommonDefine.dgPlayerLogin, authPack, disPswCheckError)
+ return True
+ except:
+ pass
+
+ nowTime = time()
+ if nowTime - self.loginStartTime < 10:
+ self.loginHeap += 1
+ else:
+ self.loginStartTime = nowTime
self.loginHeap = 0
elif appType == CommonDefine.gitHYGame:
#读取旧数据, 用到扩展字段
--
Gitblit v1.8.0