#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # #------------------------------------------------------------------------------- # ##@package Player.PlayerNewFairyCeremony # # @todo:ÐÂÏɽçÊ¢µä # @author xdh # @date 2018-07-23 16:50 # @version 1.0 # # # ÏêϸÃèÊö: ÐÂÏɽçÊ¢µä # #--------------------------------------------------------------------- """Version = 2018-07-23 16:50""" #--------------------------------------------------------------------- import ChPyNetSendPack import GameWorld import PlayerDBGSEvent import ShareDefine import NetPackCommon import PlayerBillboard import IpyGameDataPY import PlayerCompensation ( Def_FC_Recharge, #³äÖµ´óÀñ Def_FC_Fireworks, #ÑÌ»¨ Def_FC_Party, #È«ÃñÀ´àË Def_FC_RechargeRank, #¾ø°æ½µÁÙ ) = range(1, 5) def ResetNewFairyCeremony(): ##»î¶¯¿ªÊ¼ ÖØÖÃÅÅÐаñÐÅÏ¢ # Çå³ýÅÅÐаñ PlayerBillboard.ClearBillboardByIndex(ShareDefine.Def_BT_NewFCCostGold) return def OnNewFairyCeremonyEnd(): #»î¶¯½áÊø ¾ø°æ½µÁÙ¸ø½±Àø billBoard = GameWorld.GetBillboard().FindBillboard(ShareDefine.Def_BT_NewFCCostGold) if not billBoard: return worldLvNum = __GetFCWorldLVIndex(Def_FC_RechargeRank) billboardCnt = billBoard.GetCount() for index in range(0, billboardCnt): ipyData = IpyGameDataPY.GetIpyGameData('NewUniquenessArrive', worldLvNum, index + 1) if not ipyData: break objBillboard = billBoard.At(index) playerID = objBillboard.GetID() awardInfoDict = ipyData.GetAward() job = objBillboard.GetType2() % 10 if str(job) not in awardInfoDict: GameWorld.ErrLog(' ¾ø°æ½µÁÙ¸ø½±Àø UniquenessArrive δÅäÖøÃÖ°Òµ job=%s' % job, playerID) continue awardList = awardInfoDict[str(job)] PlayerCompensation.SendMailByKey('NewCeremonyRank', [playerID], awardList, [objBillboard.GetName1(), index + 1]) GameWorld.DebugLog(' »î¶¯½áÊø ¾ø°æ½µÁÙ¸ø½±Àø worldLvNum=%s, billboardCnt=%s' % (worldLvNum, billboardCnt)) return def __GetFCWorldLVIndex(fcType): #»ñÈ¡»î¶¯ÊÀ½çµÈ¼¶µµ playerFCWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % ShareDefine.OperationActionName_NewFairyCeremony) fcWorldlvDict = IpyGameDataPY.GetFuncEvalCfg('NewCeremonyWorldLv', 1, {}) if str(fcType) not in fcWorldlvDict: return 0 worldLVIndex = 0 worldlvList = fcWorldlvDict[str(fcType)] for index, lvinfo in enumerate(worldlvList): minlv, maxlv = lvinfo if minlv <= playerFCWorldLV <= maxlv: worldLVIndex = index break return worldLVIndex def Sync_OperationAction_NewFairyCeremony(ipyData, curPlayer=None): ## ֪ͨÐÂÏɽçÊ¢µä»î¶¯ÐÅÏ¢ if not ipyData: return startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData) NewFairyCeremonyInfo = ChPyNetSendPack.tagGCNewFairyCeremonyInfo() NewFairyCeremonyInfo.Clear() NewFairyCeremonyInfo.StartDate = startDateStr NewFairyCeremonyInfo.EndtDate = endDateStr NewFairyCeremonyInfo.WorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % ShareDefine.OperationActionName_NewFairyCeremony) NewFairyCeremonyInfo.LimitLV = ipyData.GetLVLimit() NewFairyCeremonyInfo.ResetType = ipyData.GetResetType() if not curPlayer: # È«·þ¹ã²¥ÔÚÏßÍæ¼Ò playerManager = GameWorld.GetPlayerManager() for i in xrange(playerManager.GetPlayerCount()): curPlayer = playerManager.GetPlayerByIndex(i) if curPlayer == None or not curPlayer.GetInitOK(): continue NetPackCommon.SendFakePack(curPlayer, NewFairyCeremonyInfo) else: NetPackCommon.SendFakePack(curPlayer, NewFairyCeremonyInfo) return