hxp
18 小时以前 f2bbfcf7317caf5c0fb356a4f7ec560c6568fd69
585 趣动海外渠道对接(登录)
2个文件已修改
50 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/DBCommon/CommonDefine.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/DBCommon/CommonDefine.py
@@ -470,5 +470,6 @@
gitMLGTGameJF = 18  # 18-绝峰港台
gitHYYNGame = 19  # 19-欢游越南
gitGaore = 20  # 20-高热 - 硬核渠道
gitFunshine = 21  # 21-趣动
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py
@@ -3215,6 +3215,55 @@
                else:
                    self.loginStartTime = nowTime
                    self.loginHeap = 0    
        elif appType == CommonDefine.gitFunshine:
            #读取旧数据, 用到扩展字段
            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个玩家验证,后面不验证
                    try:
                        # 节省配置复杂度  写死地址
                        req = urllib2.Request("https://api.funshine-game.com/v3/auth/token?token=%s" % token)
                        response = urllib2.urlopen(req, timeout=1)
                        the_page = response.read()
                        # 返回结果:(JSON格式): { "status": 1, "message":描述信息, "data":{"user_id":用户ID} }  // 1 为成功,0 为失败
                        retDict = eval(the_page)
                        if retDict.get("status") != 1:
                            mylog.debug('checktoken fail:%s-%s'%(token, 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:
            #读取旧数据, 用到扩展字段
            accountRec.adoLoadC(collection)