| | |
| | | import PyGameData
|
| | | import GameWorld
|
| | | import DBDataMgr
|
| | | import time
|
| | |
|
| | | ##################################################################
|
| | | ####### python逻辑入口 #######
|
| | |
| | | mylog.info('GM Tool Cmd->%s,orderId->%s'%(cmd, orderId))
|
| | | funcName = ''
|
| | | try:
|
| | | GameWorld.GetGameWorld().SetCurGameWorldIndex(0) # 需要设置,不然获取不到 GetMap 等虚拟分线相关接口
|
| | | |
| | | # 获得gm命令信息
|
| | | gmCmdDict = eval(cmd)
|
| | | funcName = gmCmdDict.get(GMCommon.Def_GMKey_Type, '')
|
| | |
| | | execType = GMCommon.Def_Unknow
|
| | | execInfo = ''
|
| | | if callFunc != None:
|
| | | if GameWorld.IsBattleServer():
|
| | | lastTime = PyGameData.g_batServerGMTTimeDict.get(self.funcName, 0)
|
| | | curTime = int(time.time())
|
| | | if lastTime and curTime - lastTime <= 60:
|
| | | GameWorld.Log("战斗服务器1分钟内不重复处理GMT命令! %s, lastTime=%s" % (self.funcName, GameWorld.ChangeTimeNumToStr(lastTime)))
|
| | | return
|
| | | PyGameData.g_batServerGMTTimeDict[self.funcName] = curTime
|
| | | ret = callFunc(self.gmCmdDict)
|
| | | if isinstance(ret, int):
|
| | | execType = ret
|
| | |
| | | resultMsg = json.dumps(resultDcit, ensure_ascii=False)
|
| | |
|
| | | mylog.info("gm result:%s"%resultMsg)
|
| | | SendToGMToolCommandResult(orderId, resultMsg)
|
| | | if GameWorld.IsBattleServer():
|
| | | mylog.info("战斗服务器暂时不回复GM命令处理结果")
|
| | | else:
|
| | | SendToGMToolCommandResult(orderId, resultMsg)
|
| | | return
|
| | |
|
| | |
|