| | |
| | | try:
|
| | | gmCmd = IPY_GameServer.IPY_GGMCmd()
|
| | | inputStr = gmCmd.GetMsg()
|
| | | list = inputStr.split()
|
| | | if len(list) == 0:
|
| | | alist = inputStr.split()
|
| | | if len(alist) == 0:
|
| | | return
|
| | |
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | |
|
| | | callFunName = list[0]
|
| | | callFunName = alist[0]
|
| | | # 特殊的命令不验证GM等级,在MapServer已验证账号
|
| | | if callFunName.startswith("@"):
|
| | | callFunName = "GMS_%s" % (callFunName[1:].capitalize())
|
| | |
| | | callFunc = GameWorld.GetExecFunc(Commands, "%s.%s"%(callFunName, "OnGetMergeParam"))
|
| | | if callFunc != None:
|
| | | extendParamList = callFunc(curPlayer)
|
| | | list.extend(extendParamList)
|
| | | MergeChildMsg.SendMergerChildToCenterStringData(ChConfig.Def_SendGMCMD, list)
|
| | | alist.extend(extendParamList)
|
| | | MergeChildMsg.SendMergerChildToCenterStringData(ChConfig.Def_SendGMCMD, alist)
|
| | | return
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(Commands, "%s.%s"%(callFunName, "OnExec"))
|
| | |
| | | return
|
| | |
|
| | | #删除命令,只将参数传入
|
| | | del list[0]
|
| | | del alist[0]
|
| | | #把剩余参数转换为整型
|
| | | for i in range(0, len(list)):
|
| | | if i == 0 and callFunName in ["testMail", "SetPlayerDBGSEvent"]:
|
| | | continue
|
| | | value = GameWorld.ToIntDef(list[i], None)
|
| | | for i in range(0, len(alist)):
|
| | | value = GameWorld.ToIntDef(alist[i], None)
|
| | | if value == None:
|
| | | GameWorld.DebugAnswer(curPlayer, "参数错误, 参数%s必须为纯数字!" % (i + 1))
|
| | | return
|
| | | list[i] = value
|
| | | #GameWorld.DebugAnswer(curPlayer, "参数错误, 参数%s必须为纯数字!" % (i + 1))
|
| | | continue
|
| | | alist[i] = value
|
| | |
|
| | | callFunc(curPlayer,list)
|
| | | callFunc(curPlayer,alist)
|
| | |
|
| | | except BaseException:
|
| | | GameWorld.DebugAnswer(curPlayer, "执行GM命令错误, 请查看GameServer日志!")
|
| | | errorMsg = str(traceback.format_exc())
|
| | | GameWorld.ErrLog('GM命令错误 - > %s'%(errorMsg) , curPlayer.GetPlayerID())
|
| | | if GameWorld.GetGameWorld().GetDebugLevel():
|
| | | raise BaseException(errorMsg)
|
| | | #=======================================================================
|
| | | # if GameWorld.GetGameWorld().GetDebugLevel():
|
| | | # raise BaseException(errorMsg)
|
| | | #=======================================================================
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | | #===============================================================================
|