| | |
| | | import ChConfig
|
| | | import GameWorld
|
| | | import PyGameData
|
| | | import GMShell
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | #---------------------------------------------------------------------
|
| | |
| | |
|
| | | if not tagPlayer:
|
| | | # 玩家不在线,先记录,等玩家上线后处理
|
| | | key = (queryType, playerFind)
|
| | | ctgInfoList = PyGameData.g_ctgOfflinePlayerInfo.get(key, [])
|
| | | ctgInfoList.append(gmCmdDict)
|
| | | PyGameData.g_ctgOfflinePlayerInfo[key] = ctgInfoList
|
| | | GameWorld.Log("离线CTG: g_ctgOfflinePlayerInfo=%s" % str(PyGameData.g_ctgOfflinePlayerInfo))
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success)
|
| | | GMShell.AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict)
|
| | | return
|
| | |
|
| | | GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind, gmCmdDict, 'GMTCTG', [orderId, value, appID, isAddBourseMoney, True], False)
|
| | | return
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | ctgList = []
|
| | | nameKey = (ChConfig.queryType_sqtPlayerByName, curPlayer.GetName())
|
| | | if nameKey in PyGameData.g_ctgOfflinePlayerInfo:
|
| | | ctgList += PyGameData.g_ctgOfflinePlayerInfo.pop(nameKey)
|
| | | def OnOfflineGMTInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | value = gmCmdDict.get('value', '')
|
| | | appID = gmCmdDict.get('appID', '')
|
| | | isAddBourseMoney = GameWorld.ToIntDef(gmCmdDict.get('isAddBourseMoney', ''), 0)
|
| | | cmdStr = str([orderId, value, appID, isAddBourseMoney, False])
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTCTG', |
| | | cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | |
|
| | | accIDKey = (ChConfig.queryType_sqtPlayerByAccID, curPlayer.GetAccID())
|
| | | if accIDKey in PyGameData.g_ctgOfflinePlayerInfo:
|
| | | ctgList += PyGameData.g_ctgOfflinePlayerInfo.pop(accIDKey)
|
| | | |
| | | if not ctgList:
|
| | | return
|
| | | |
| | | tagMapID = curPlayer.GetRealMapID()
|
| | | GameWorld.Log("离线玩家上线CTG: tagMapID=%s, %s" % (tagMapID, ctgList), curPlayer.GetPlayerID())
|
| | | if not tagMapID:
|
| | | return
|
| | | |
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for gmCmdDict in ctgList:
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | value = gmCmdDict.get('value', '')
|
| | | appID = gmCmdDict.get('appID', '')
|
| | | isAddBourseMoney = GameWorld.ToIntDef(gmCmdDict.get('isAddBourseMoney', ''), 0)
|
| | | cmdStr = str([orderId, value, appID, isAddBourseMoney, False])
|
| | | playerManager.MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTCTG', |
| | | cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | value = GameWorld.ToIntDef(gmCmdDict.get('value', ''), 0)
|
| | | isOnlineGMT = False # 是否是在线接收的GM工具命令
|
| | | cmdStr = str([orderId, value, isOnlineGMT])
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTAddPayCoin', cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
|