New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package GM.Commands.GMT_MagicWeaponExp
|
| | | #
|
| | | # @todo:法宝灵魂
|
| | | # @author hxp
|
| | | # @date 2018-09-29
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 法宝灵魂
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2018-09-29 00:00:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | #导入
|
| | | import GMCommon
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import GMShell
|
| | |
|
| | |
|
| | | ## 执行逻辑
|
| | | # @param curPlayer 当前玩家
|
| | | # @param gmCmdDict: 命令字典
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(orderId, gmCmdDict):
|
| | | queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
|
| | | playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '')
|
| | | mwID = GameWorld.ToIntDef(gmCmdDict.get('mwID', ''), 0)
|
| | | mwExp = GameWorld.ToIntDef(gmCmdDict.get('mwExp', ''), 0)
|
| | | |
| | | tagPlayer = None
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | |
| | | if queryType == GMCommon.Def_GMKey_PlayerAccID:
|
| | | queryType = ChConfig.queryType_sqtPlayerByAccID
|
| | | tagPlayer = playerManager.FindPlayerByAccID(str(playerFind))
|
| | | |
| | | elif queryType == GMCommon.Def_GMKey_PlayerName:
|
| | | queryType = ChConfig.queryType_sqtPlayerByName
|
| | | tagPlayer = playerManager.FindPlayerByName(str(playerFind))
|
| | | |
| | | else:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
|
| | | return
|
| | | |
| | | if not tagPlayer:
|
| | | # 玩家不在线,先记录,等玩家上线后处理
|
| | | GMShell.AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict)
|
| | | return
|
| | | |
| | | isOnlineGMT = True # 是否是在线接收的GM工具命令
|
| | | GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind, gmCmdDict, "GMTMagicWeaponExp", [orderId, mwID, mwExp, isOnlineGMT], False)
|
| | | return
|
| | |
|
| | | def OnOfflineCTGInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | mwID = GameWorld.ToIntDef(gmCmdDict.get('mwID', ''), 0)
|
| | | mwExp = GameWorld.ToIntDef(gmCmdDict.get('mwExp', ''), 0)
|
| | | isOnlineGMT = False # 是否是在线接收的GM工具命令
|
| | | cmdStr = str([orderId, mwID, mwExp, isOnlineGMT])
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTMagicWeaponExp', |
| | | cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
|
| | |
|
| | |
| | | import Commands
|
| | | import IPY_GameServer
|
| | | import MergeChildMsg
|
| | | import PyGameData
|
| | | import traceback
|
| | | import GMCommon
|
| | | import os
|
| | |
| | | #只将实际参数传入
|
| | | 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
|
| | |
|
| | |
| | | import GameWorldActionControl
|
| | | import GMT_CTG
|
| | | import PyGameData
|
| | | import GMShell
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | #玩家等级记录
|
| | | PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV()
|
| | |
|
| | | GMShell.OnPlayerLogin(curPlayer)
|
| | | GMT_CTG.OnPlayerLogin(curPlayer)
|
| | |
|
| | | #通知地图服务器自己初始化成功
|
| | |
| | | g_yesterdayPlayerLVDict = {} #昨日玩家等级字典{playerID:lv,..}
|
| | |
|
| | | g_ctgOfflinePlayerInfo = {} # {playerID:[[ctgInfo], ...], ...} # 离线玩家CTG信息缓存
|
| | | g_gmtOfflinePlayerInfo = {} # {(queryType, playerFind):[gmtInfo, ...], ...} # 离线玩家GMT信息缓存
|
| | |
|
| | | g_questionIDHistory = {}#出过的题记录 {familyid:[出过的题id,..]}
|
| | | g_familyAnswerDict = {} #仙盟答题数量 {familyid:[答题数量,tick],..}
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Player.RemoteQuery.GY_Query_GMTMagicWeaponExp
|
| | | #
|
| | | # @todo:法宝灵魂
|
| | | # @author hxp
|
| | | # @date 2018-09-29
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 法宝灵魂
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2018-09-29 00:00:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import DataRecordPack
|
| | | import PlayerMagicWeapon
|
| | | import PlayerControl
|
| | | import ChConfig
|
| | | import GMCommon
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | #---------------------------------------------------------------------
|
| | | #---------------------------------------------------------------------
|
| | | #逻辑实现 |
| | | ## 请求逻辑 |
| | | # @param query_Type 请求类型
|
| | | # @param query_ID 玩家ID
|
| | | # @param packCMDList 发包命令 |
| | | # @param tick 当前时间
|
| | | # @return "True" or "False" or ""
|
| | | # @remarks 函数详细说明.
|
| | | def DoLogic(query_Type, query_ID, packCMDList, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)
|
| | | |
| | | if not curPlayer or curPlayer.IsEmpty():
|
| | | return
|
| | | |
| | | Result = GMCommon.Def_Success
|
| | | orderId, mwID, mwExp, isOnlineGMT = packCMDList
|
| | | |
| | | errorMsg = ""
|
| | | ipyData = PlayerMagicWeapon.GetWMIpyData(mwID)
|
| | | if not ipyData:
|
| | | errorMsg = "Error: magic weapon id(%s) is not exist." % mwID
|
| | | elif mwExp > ChConfig.Def_UpperLimit_DWord:
|
| | | errorMsg = "Error: set exp value(%s) is error." % mwExp
|
| | | |
| | | if errorMsg:
|
| | | GameWorld.Log("GMT_MagicWeaponExp, errorMsg=%s" % errorMsg, curPlayer.GetPlayerID())
|
| | | resultMsg = str([orderId, errorMsg, 'GMT_MagicWeaponExp', GMCommon.Def_ParamErr])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'GMToolResult', resultMsg, len(resultMsg))
|
| | | return
|
| | | |
| | | curExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MagicWeaponUpExp % mwID)
|
| | | if mwExp != curExp:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MagicWeaponUpExp % mwID, mwExp)
|
| | | PlayerMagicWeapon.Sycn_MagicWeaponLV(curPlayer, mwID)
|
| | | |
| | | resultDict = {"mwID":mwID, "mwExp":mwExp, "curExp":curExp, "isOnlineGMT":isOnlineGMT}
|
| | | GameWorld.Log("GMT_MagicWeaponExp, isOnlineGMT=%s,resultDict=%s" % (isOnlineGMT, resultDict), curPlayer.GetPlayerID())
|
| | | #流向 记录
|
| | | DataRecordPack.DR_ToolGMOperate(query_ID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), 'GMT_MagicWeaponExp', resultDict)
|
| | | |
| | | if isOnlineGMT:
|
| | | resultMsg = str([orderId, resultDict, 'GMT_MagicWeaponExp', Result])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'GMToolResult', resultMsg, len(resultMsg))
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #执行结果
|
| | | ## 执行结果
|
| | | # @param curPlayer 发出请求的玩家
|
| | | # @param callFunName 功能名称
|
| | | # @param funResult 查询的结果
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def DoResult(curPlayer, callFunName, funResult, tick):
|
| | | return
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|