|  |  |  | 
|---|
|  |  |  | import Commands | 
|---|
|  |  |  | import IPY_GameServer | 
|---|
|  |  |  | import MergeChildMsg | 
|---|
|  |  |  | import PyGameData | 
|---|
|  |  |  | import traceback | 
|---|
|  |  |  | import GMCommon | 
|---|
|  |  |  | import os | 
|---|
|  |  |  | 
|---|
|  |  |  | del alist[0] | 
|---|
|  |  |  | #把剩余参数转换为整型 | 
|---|
|  |  |  | for i in range(0, len(alist)): | 
|---|
|  |  |  | if not alist[i].isdigit(): | 
|---|
|  |  |  | continue | 
|---|
|  |  |  | value = GameWorld.ToIntDef(alist[i], None) | 
|---|
|  |  |  | if value == None: | 
|---|
|  |  |  | GameWorld.DebugAnswer(curPlayer, "参数错误, 参数%s必须为纯数字!" % (i + 1)) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | #GameWorld.DebugAnswer(curPlayer, "参数错误, 参数%s必须为纯数字!" % (i + 1)) | 
|---|
|  |  |  | continue | 
|---|
|  |  |  | alist[i] = value | 
|---|
|  |  |  |  | 
|---|
|  |  |  | callFunc(curPlayer,alist) | 
|---|
|  |  |  | 
|---|
|  |  |  | #只将实际参数传入 | 
|---|
|  |  |  | callFunc(cmdMsgList[1:], tick) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict): | 
|---|
|  |  |  | # 玩家不在线,先记录,等玩家上线后处理,开关服后无效 | 
|---|
|  |  |  | key = (queryType, playerFind) | 
|---|
|  |  |  | ctgInfoList = PyGameData.g_gmtOfflinePlayerInfo.get(key, []) | 
|---|
|  |  |  | ctgInfoList.append(gmCmdDict) | 
|---|
|  |  |  | PyGameData.g_gmtOfflinePlayerInfo[key] = ctgInfoList | 
|---|
|  |  |  | GameWorld.Log("离线玩家添加GMT: g_gmtOfflinePlayerInfo=%s" % str(PyGameData.g_gmtOfflinePlayerInfo)) | 
|---|
|  |  |  | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, "Player is off line.") | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def OnPlayerLogin(curPlayer): | 
|---|
|  |  |  | gmtList = [] | 
|---|
|  |  |  | nameKey = (ChConfig.queryType_sqtPlayerByName, curPlayer.GetName()) | 
|---|
|  |  |  | if nameKey in PyGameData.g_gmtOfflinePlayerInfo: | 
|---|
|  |  |  | gmtList += PyGameData.g_gmtOfflinePlayerInfo.pop(nameKey) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | accIDKey = (ChConfig.queryType_sqtPlayerByAccID, curPlayer.GetAccID()) | 
|---|
|  |  |  | if accIDKey in PyGameData.g_gmtOfflinePlayerInfo: | 
|---|
|  |  |  | gmtList += PyGameData.g_gmtOfflinePlayerInfo.pop(accIDKey) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if not gmtList: | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | tagMapID = curPlayer.GetRealMapID() | 
|---|
|  |  |  | GameWorld.Log("离线玩家上线GMT: tagMapID=%s, %s" % (tagMapID, gmtList), curPlayer.GetPlayerID()) | 
|---|
|  |  |  | if not tagMapID: | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for gmCmdDict in gmtList: | 
|---|
|  |  |  | pack_type = gmCmdDict.get("pack_type") | 
|---|
|  |  |  | if not pack_type: | 
|---|
|  |  |  | continue | 
|---|
|  |  |  |  | 
|---|
|  |  |  | callFunc = GameWorld.GetExecFunc(Commands, "%s.%s"%(pack_type, "OnOfflineCTGInfo")) | 
|---|
|  |  |  | if callFunc: | 
|---|
|  |  |  | GameWorld.Log("玩家上线执行GMT: %s, tagMapID=%s, %s" % (pack_type, tagMapID, gmCmdDict), curPlayer.GetPlayerID()) | 
|---|
|  |  |  | callFunc(curPlayer, tagMapID, gmCmdDict) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|