#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # #------------------------------------------------------------------------------- # ##@package GM.Commands.GMT_QueryBillboard # # @todo:²éѯÅÅÐаñ # @author hxp # @date 2015-5-25 # @version 1.0 # # @change: "2015-06-23 10:30" hxp Ôö¼Ó·µ»ØType2ÐÅÏ¢ # # ÏêϸÃèÊö: ²éѯÅÅÐаñ # #--------------------------------------------------------------------- """Version = 2015-06-23 10:30""" #--------------------------------------------------------------------- #µ¼Èë import ShareDefine import GMCommon import GameWorld #Âß¼­ÊµÏÖ(ÕâÀïcurPlayer = None) ## Ö´ÐÐÂß¼­ # @param curPlayer µ±Ç°Íæ¼Ò # @param gmList [cmdIndex gmAccID forbidAcc] # @return None # @remarks º¯ÊýÏêϸ˵Ã÷. def OnExec(orderId, gmCmdDict): billBoardType = GameWorld.ToIntDef(gmCmdDict.get('billboardType', ''), None) billType = GameWorld.ToIntDef(gmCmdDict.get('billType', ''), None) # ÆäËûÖ¸¶¨ÀàÐÍ if billType != None: billBoardType = billType topNum = GameWorld.ToIntDef(gmCmdDict.get('topNum', ''), 10) if billBoardType == None: GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_TypeNumErr) return if billBoardType < 0 or billBoardType >= ShareDefine.Def_BT_Max: GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_TypeNumErr) return billBoard = GameWorld.GetBillboard().FindBillboard(billBoardType) if not billBoard: GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_TypeNumErr) return False billBoardInfo = [] for index in range(0, billBoard.GetCount()): if index >= topNum: break billBoardData = billBoard.At(index) if not billBoardData: continue billBoardDict = { "ID":billBoardData.GetID(), "ID2":billBoardData.GetID2(), "Name1":billBoardData.GetName1(), "Name2":billBoardData.GetName2(), "Type2":billBoardData.GetType2(), "Value1":billBoardData.GetValue1(), "Value2":billBoardData.GetValue2(), "CmpValue":billBoardData.GetCmpValue(), "CmpValue2":billBoardData.GetCmpValue2(), "CmpValue3":billBoardData.GetCmpValue3(), } billBoardInfo.append(billBoardDict) if len(billBoardInfo) > pow(2, 14): #Êý¾Ý¹ý´ó GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_MaxLimit) return #Ö´Ðгɹ¦ GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, billBoardInfo) return