| | |
| | | import CrossBillboard |
| | | import PlayerFamily |
| | | import PyDataManager |
| | | import GameXiangong |
| | | import GameWorship |
| | | |
| | | def OnActStart(actNum): |
| | | ## 活动开启 |
| | |
| | | |
| | | __OnEndAward(actNum, ipyData, dayIndex) # 兼容活动没有配置参与时间段的在活动结束补触发结算奖励 |
| | | |
| | | DataRecordPack.DR_BillboardData(ShareDefine.Def_BT_BossTrialSubmitFamily, "BossTrial", {"actNum":actNum, "cfgID":cfgID, "dayIndex":dayIndex}) |
| | | PlayerBillboard.CopyBillboard(ShareDefine.Def_BT_BossTrialSubmitFamilyBak, ShareDefine.Def_BT_BossTrialSubmitFamily) |
| | | |
| | | DataRecordPack.DR_BillboardData(ShareDefine.Def_BT_BossTrialSubmit, "BossTrial", {"actNum":actNum, "cfgID":cfgID, "dayIndex":dayIndex}) |
| | | PlayerBillboard.CopyBillboard(ShareDefine.Def_BT_BossTrialSubmitBak, ShareDefine.Def_BT_BossTrialSubmit) |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | | def OnActInStateRefresh(actNum, ipyData, dayIndex): |
| | | ## 活动中刷新,每次都需要刷新的逻辑,包含重读配置等 |
| | | if not ipyData: |
| | | return |
| | | cfgID = ipyData.GetCfgID() |
| | | templateID = GameWorld.GetTemplateID(ipyData, cfgID, dayIndex) |
| | | familyTemplateID = GameWorld.GetTemplateIDByList(ipyData.GetFamilyTemplateIDList(), dayIndex) |
| | | |
| | | billboardMgr = PlayerBillboard.GetBillboardMgr() |
| | | if templateID: |
| | | orderRuleList = GetOrderRuleList(templateID) |
| | | billboardObj = billboardMgr.GetBillboardObj(ShareDefine.Def_BT_BossTrialSubmit) |
| | | billboardObj.SetOrderRuleList(orderRuleList) |
| | | |
| | | if familyTemplateID: |
| | | orderRuleList = GetOrderRuleList(familyTemplateID) |
| | | billboardObj = billboardMgr.GetBillboardObj(ShareDefine.Def_BT_BossTrialSubmitFamily) |
| | | billboardObj.SetOrderRuleList(orderRuleList) |
| | | return |
| | | |
| | | def OnActJoinEnd(actNum, ipyData, dayIndex): |
| | |
| | | |
| | | templateID = GameWorld.GetTemplateID(ipyData, cfgID, dayIndex) |
| | | __OnEndAward_Personal(templateID, ShareDefine.Def_BT_BossTrialSubmit) |
| | | |
| | | # 流向备份 |
| | | DataRecordPack.DR_BillboardData(ShareDefine.Def_BT_BossTrialSubmitFamily, "BossTrial", {"actNum":actNum, "cfgID":cfgID, "dayIndex":dayIndex}) |
| | | DataRecordPack.DR_BillboardData(ShareDefine.Def_BT_BossTrialSubmit, "BossTrial", {"actNum":actNum, "cfgID":cfgID, "dayIndex":dayIndex}) |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | |
| | | if not templateID: |
| | | GameWorld.Log("本次活动没有个人榜奖励!") |
| | | return |
| | | tempIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", templateID) |
| | | if not tempIpyDataList: |
| | | billboardDataCount = billBoard.GetCount() |
| | | billBoard.Sort() |
| | | |
| | | GameWorld.Log("结算个人榜单奖励: billboardType=%s,templateID=%s,billboardDataCount=%s" % (billboardType, templateID, billboardDataCount)) |
| | | |
| | | orderIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", templateID) |
| | | if not orderIpyDataList: |
| | | return |
| | | |
| | | rankAwardDict = {} |
| | | for tempIpyData in tempIpyDataList: |
| | | rankAwardDict[tempIpyData.GetRank()] = tempIpyData.GetAwardItemList() |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | | rank = ipyData.GetRank() |
| | | needScore = ipyData.GetNeedScore() |
| | | scoreAwardEx = ipyData.GetScoreAwardEx() |
| | | scoreAwardExList = scoreAwardEx.keys() |
| | | scoreAwardExList.sort() |
| | | awardItemList = ipyData.GetAwardItemList() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | | |
| | | GameWorld.Log("结算个人榜单奖励: templateID=%s,rankAwardDict=%s" % (templateID, rankAwardDict)) |
| | | billBoard.Sort() |
| | | for index in xrange(billBoard.GetCount()): |
| | | billBoardData = billBoard.At(index) |
| | | if not billBoardData: |
| | | continue |
| | | |
| | | rank = index + 1 |
| | | |
| | | awardItemList = GameWorld.GetOrderValueByDict(rankAwardDict, rank, False) |
| | | if not awardItemList: |
| | | break |
| | | |
| | | playerID = billBoardData.GetID() |
| | | name2 = billBoardData.GetName2() |
| | | cmpValue = billBoardData.GetCmpValue() |
| | | |
| | | GameWorld.Log(" 发放boss历练个人榜单奖励: rank=%s,playerID=%s,cmpValue=%s,awardItemList=%s, %s" |
| | | % (rank, playerID, cmpValue, awardItemList, name2)) |
| | | |
| | | PlayerCompensation.SendMailByKey("BossTrialMail10", [playerID], awardItemList, [rank]) |
| | | for index in xrange(billboardIndex, billboardDataCount): |
| | | if orderCountTotal <= 0: |
| | | break |
| | | |
| | | billBoardData = billBoard.At(index) |
| | | playerID = billBoardData.GetID() |
| | | name2 = billBoardData.GetName2() |
| | | cmpValue = billBoardData.GetCmpValue() |
| | | |
| | | if cmpValue < needScore: |
| | | GameWorld.Log(" 积分不足该榜单所需积分,跳过该名次: index=%s,rank=%s,playerID=%s,cmpValue=%s < %s" % (index, rank, playerID, cmpValue, needScore)) |
| | | break |
| | | |
| | | awardItemExList = [] |
| | | for scoreEx in scoreAwardExList: |
| | | if cmpValue < scoreEx: |
| | | break |
| | | awardItemExList = scoreAwardEx[scoreEx] # 取最大满足条件的一档 |
| | | finalAwardItemList = awardItemList + awardItemExList |
| | | |
| | | playerRank = rank - orderCountTotal + 1 |
| | | GameWorld.Log(" 发放boss历练个人榜单奖励: index=%s,rank=%s,playerRank=%s,playerID=%s,cmpValue=%s,awardItemList=%s,scoreAwardEx=%s,finalAwardItemList=%s, %s" |
| | | % (index, rank, playerRank, playerID, cmpValue, awardItemList, scoreAwardEx, finalAwardItemList, name2)) |
| | | PlayerCompensation.SendMailByKey("BossTrialMail10", [playerID], finalAwardItemList, [playerRank]) |
| | | |
| | | orderCountTotal -= 1 |
| | | billboardIndex += 1 |
| | | |
| | | return |
| | | |
| | |
| | | if not familyTemplateID: |
| | | GameWorld.Log("本次活动没有仙盟榜奖励!") |
| | | return |
| | | tempIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", familyTemplateID) |
| | | if not tempIpyDataList: |
| | | return |
| | | |
| | | rankAwardDict = {} |
| | | for tempIpyData in tempIpyDataList: |
| | | rankAwardDict[tempIpyData.GetRank()] = [tempIpyData.GetAwardItemList(), tempIpyData.GetMemAwardItemList()] |
| | | |
| | | GameWorld.Log("结算仙盟榜单奖励: familyTemplateID=%s,rankAwardDict=%s" % (familyTemplateID, rankAwardDict)) |
| | | billboardDataCount = billBoard.GetCount() |
| | | billBoard.Sort() |
| | | |
| | | GameWorld.Log("结算仙盟榜单奖励: billboardType=%s,familyTemplateID=%s,billboardDataCount=%s" % (billboardType, familyTemplateID, billboardDataCount)) |
| | | |
| | | orderIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", familyTemplateID) |
| | | if not orderIpyDataList: |
| | | return |
| | | |
| | | familyManager = GameWorld.GetFamilyManager() |
| | | for index in xrange(billBoard.GetCount()): |
| | | billBoardData = billBoard.At(index) |
| | | if not billBoardData: |
| | | continue |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | | rank = ipyData.GetRank() |
| | | needScore = ipyData.GetNeedScore() |
| | | leaderAwardItemList = ipyData.GetAwardItemList() |
| | | memAwardItemList = ipyData.GetMemAwardItemList() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | | |
| | | familyRank = index + 1 |
| | | awardInfo = GameWorld.GetOrderValueByDict(rankAwardDict, familyRank, False) |
| | | if not awardInfo: |
| | | break |
| | | leaderAwardItemList, memAwardItemList = awardInfo |
| | | |
| | | familyID = billBoardData.GetID() |
| | | cmpValue = billBoardData.GetCmpValue() |
| | | |
| | | family = familyManager.FindFamily(familyID) |
| | | if not family: |
| | | continue |
| | | |
| | | familyActionData = GetFamilyBossTrialSubmitActionData(familyID, False) |
| | | if not familyActionData: |
| | | GameWorld.ErrLog("该仙盟没有提交凭证ActionData! familyID=%s" % familyID) |
| | | continue |
| | | awardState = GetFamilyAwardState(familyActionData) |
| | | awardIndex = 0 # 本服奖励状态索引 |
| | | if awardState&pow(2, awardIndex): |
| | | GameWorld.ErrLog("该仙盟本服榜奖励已发放! familyID=%s" % familyID) |
| | | continue |
| | | updAwardState = awardState|pow(2, awardIndex) |
| | | SetFamilyAwardState(familyActionData, updAwardState) |
| | | |
| | | memSubCountDict = GetFamilyMemSubCountDict(familyActionData) |
| | | |
| | | leaderID = family.GetLeaderID() |
| | | awardMemIDList = [] |
| | | for index in xrange(family.GetCount()): |
| | | member = family.GetAt(index) |
| | | memPlayerID = member.GetPlayerID() |
| | | if memPlayerID == leaderID: |
| | | for index in xrange(billboardIndex, billboardDataCount): |
| | | if orderCountTotal <= 0: |
| | | break |
| | | |
| | | billBoardData = billBoard.At(index) |
| | | familyID = billBoardData.GetID() |
| | | cmpValue = billBoardData.GetCmpValue() |
| | | |
| | | if cmpValue < needScore: |
| | | GameWorld.Log(" 不足该榜单所需提交数,跳过该名次: index=%s,rank=%s,familyID=%s,cmpValue=%s < %s" % (index, rank, familyID, cmpValue, needScore)) |
| | | break |
| | | |
| | | familyRank = rank - orderCountTotal + 1 |
| | | orderCountTotal -= 1 |
| | | billboardIndex += 1 |
| | | |
| | | family = familyManager.FindFamily(familyID) |
| | | if not family: |
| | | continue |
| | | awardMemIDList.append(memPlayerID) |
| | | |
| | | paramList = [familyRank] |
| | | if not leaderAwardItemList: |
| | | awardMemIDList.append(leaderID) |
| | | else: |
| | | PlayerCompensation.SendMailByKey("BossTrialFamilyLeader", [leaderID], leaderAwardItemList, paramList) |
| | | familyActionData = GetFamilyBossTrialSubmitActionData(familyID, False) |
| | | if not familyActionData: |
| | | GameWorld.ErrLog("该仙盟没有提交凭证ActionData! familyID=%s" % familyID) |
| | | continue |
| | | awardState = GetFamilyAwardState(familyActionData) |
| | | awardIndex = 0 # 本服奖励状态索引 |
| | | if awardState&pow(2, awardIndex): |
| | | GameWorld.ErrLog("该仙盟本服榜奖励已发放! familyID=%s" % familyID) |
| | | continue |
| | | updAwardState = awardState|pow(2, awardIndex) |
| | | SetFamilyAwardState(familyActionData, updAwardState) |
| | | |
| | | PlayerCompensation.SendMailByKey("BossTrialFamilyMember", awardMemIDList, memAwardItemList, paramList) |
| | | GameWorld.Log("发放boss历练活动仙盟榜单奖励本服: familyID=%s,名次=%s,总提交个数=%s,updAwardState=%s,awardMemIDList=%s,memSubCountDict=%s" |
| | | % (familyID, familyRank, cmpValue, updAwardState, awardMemIDList, memSubCountDict)) |
| | | |
| | | memSubCountDict = GetFamilyMemSubCountDict(familyActionData) |
| | | |
| | | leaderID = family.GetLeaderID() |
| | | awardMemIDList = [] |
| | | for index in xrange(family.GetCount()): |
| | | member = family.GetAt(index) |
| | | memPlayerID = member.GetPlayerID() |
| | | if memPlayerID == leaderID: |
| | | continue |
| | | awardMemIDList.append(memPlayerID) |
| | | |
| | | paramList = [familyRank] |
| | | if not leaderAwardItemList: |
| | | awardMemIDList.append(leaderID) |
| | | else: |
| | | PlayerCompensation.SendMailByKey("BossTrialFamilyLeader", [leaderID], leaderAwardItemList, paramList) |
| | | |
| | | PlayerCompensation.SendMailByKey("BossTrialFamilyMember", awardMemIDList, memAwardItemList, paramList) |
| | | GameWorld.Log("发放boss历练活动仙盟榜单奖励本服: index=%s,rank=%s,familyID=%s,名次=%s,总提交个数=%s,updAwardState=%s,awardMemIDList=%s,memSubCountDict=%s" |
| | | % (index, rank, familyID, familyRank, cmpValue, updAwardState, awardMemIDList, memSubCountDict)) |
| | | |
| | | return |
| | | |
| | | def MapServer_BossTrial(curPlayer, msgList): |
| | |
| | | accID = curPlayer.GetAccID() |
| | | playerName = curPlayer.GetName() |
| | | job = curPlayer.GetJob() |
| | | face = curPlayer.GetFace() |
| | | facePic = curPlayer.GetFacePic() |
| | | realmLV = curPlayer.GetOfficialRank() |
| | | familyID = curPlayer.GetFamilyID() |
| | | submitCount, updSubmitCount = dataMsg |
| | |
| | | |
| | | #同步跨服 |
| | | playerInfo = {"playerID":playerID, "playerName":playerName, "accID":accID, "job":job, "realmLV":realmLV, |
| | | "playerSubmitTotal":updSubmitCount} |
| | | "playerSubmitTotal":updSubmitCount, "face":face, "facePic":facePic} |
| | | SyncBossTrialSubmitToCrossServer(curPlayer, playerInfo, familyBillInfo) |
| | | return |
| | | |
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("CrossActBossTrial", cfgID) |
| | | if not ipyData: |
| | | return |
| | | personlLimit, familyLimit = ipyData.GetRankLimitList() |
| | | |
| | | personlLimit, familyLimit = 0, 0 |
| | | |
| | | PersonalTemplateID = ipyData.GetPersonalTemplateID() |
| | | pRankIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", PersonalTemplateID) if PersonalTemplateID else None |
| | | if pRankIpyDataList: |
| | | lastRankIpyData = pRankIpyDataList[-1] # 取最后一个为最低上榜积分限制 |
| | | personlLimit = lastRankIpyData.GetNeedScore() |
| | | |
| | | FamilyTemplateID = ipyData.GetFamilyTemplateID() |
| | | fRankIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", FamilyTemplateID) if FamilyTemplateID else None |
| | | if fRankIpyDataList: |
| | | lastRankIpyData = fRankIpyDataList[-1] # 取最后一个为最低上榜积分限制 |
| | | familyLimit = lastRankIpyData.GetNeedScore() |
| | | |
| | | playerID = playerInfo["playerID"] |
| | | playerName = playerInfo["playerName"] |
| | | job = playerInfo["job"] |
| | | accID = playerInfo["accID"] |
| | | realmLV = playerInfo["realmLV"] |
| | | playerSubmitTotal = playerInfo["playerSubmitTotal"] |
| | | face = playerInfo.get("face", 0) |
| | | facePic = playerInfo.get("facePic", 0) |
| | | |
| | | groupValue1 = zoneID |
| | | |
| | | if playerSubmitTotal >= personlLimit: |
| | | name2, type2, value1, value2 = accID, job, realmLV, 0 |
| | | CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_BossTrialSubmit, groupValue1, playerID, playerName, |
| | | name2, type2, value1, value2, playerSubmitTotal) |
| | | name2, type2, value1, value2, playerSubmitTotal, value3=face, value4=facePic) |
| | | |
| | | if familyInfo and familyInfo.get("familySubmitTotal", 0) >= familyLimit: |
| | | familySubmitTotal = familyInfo["familySubmitTotal"] |
| | |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | | def OnCrossActInStateRefresh(cfgID, zoneID, ipyData): |
| | | ## 活动中刷新,每次都需要刷新的逻辑,包含重读配置等 |
| | | if not ipyData: |
| | | return |
| | | PersonalTemplateID = ipyData.GetPersonalTemplateID() |
| | | FamilyTemplateID = ipyData.GetFamilyTemplateID() |
| | | orderRuleList = GetOrderRuleList(PersonalTemplateID) |
| | | orderRuleListFamily = GetOrderRuleList(FamilyTemplateID) |
| | | |
| | | groupValue1 = zoneID |
| | | billboardMgr = PyDataManager.GetCrossBillboardManager() |
| | | billboardObj = billboardMgr.GetCrossBillboard(ShareDefine.Def_CBT_BossTrialSubmit, groupValue1) |
| | | billboardObj.SetOrderRuleList(orderRuleList) |
| | | |
| | | billboardObj = billboardMgr.GetCrossBillboard(ShareDefine.Def_CBT_BossTrialSubmitFamily, groupValue1) |
| | | billboardObj.SetOrderRuleList(orderRuleListFamily) |
| | | return |
| | | |
| | | def GetOrderRuleList(templateID): |
| | | orderIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", templateID) |
| | | if not orderIpyDataList: |
| | | return |
| | | orderRuleList = [] |
| | | for ipyData in orderIpyDataList: |
| | | orderRuleList.append([ipyData.GetRank(), ipyData.GetNeedScore()]) |
| | | return orderRuleList |
| | | |
| | | def OnCrossActJoinEnd(cfgID, zoneID, ipyData): |
| | | ## 跨服活动参与结束 |
| | | __OnCrossEndAward(cfgID, zoneID, ipyData) |
| | |
| | | |
| | | PersonalTemplateID = ipyData.GetPersonalTemplateID() |
| | | FamilyTemplateID = ipyData.GetFamilyTemplateID() |
| | | serverIDRangeList = ipyData.GetServerIDRangeList() |
| | | |
| | | __GiveCrossOrderAwardPersonal(cfgID, zoneID, PersonalTemplateID, ShareDefine.Def_CBT_BossTrialSubmit) |
| | | __GiveCrossOrderAwardPersonal(cfgID, zoneID, PersonalTemplateID, ShareDefine.Def_CBT_BossTrialSubmit, serverIDRangeList) |
| | | __GiveCrossOrderAwardFamily(cfgID, zoneID, FamilyTemplateID, ShareDefine.Def_CBT_BossTrialSubmitFamily) |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | | def __GiveCrossOrderAwardPersonal(cfgID, zoneID, templateID, billboardType): |
| | | def __GiveCrossOrderAwardPersonal(cfgID, zoneID, templateID, billboardType, serverIDRangeList): |
| | | |
| | | groupValue1 = zoneID |
| | | #billboardType = ShareDefine.Def_CBT_BossTrialSubmit #榜单类型改为参数传入,异常情况下可特殊处理用备份榜单发奖励 |
| | |
| | | |
| | | # 结算时排序并保存榜单数据流向 |
| | | billboardObj.SortData() |
| | | billboardObj.SaveDRData() |
| | | billboardObj.SaveDRData("BossTrial", {"cfgID":cfgID, "zoneID":zoneID}) |
| | | |
| | | GameWorld.Log("结算跨服Boss凭证个人排行奖励: billboardType=%s,zoneID=%s,cfgID=%s,templateID=%s,billboardDataCount=%s" |
| | | % (billboardType, zoneID, cfgID, templateID, billboardDataCount)) |
| | | |
| | | orderIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", templateID) |
| | | if orderIpyDataList: |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | | rank = ipyData.GetRank() |
| | | awardItemList = ipyData.GetAwardItemList() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | | orderCount = 0 |
| | | if not orderIpyDataList: |
| | | return |
| | | |
| | | worshipType = ShareDefine.Def_WorshipType_CrossBossTrial |
| | | syncNewWorshipList = [] |
| | | syncNewXiangongDict = {} |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | | rank = ipyData.GetRank() |
| | | needScore = ipyData.GetNeedScore() |
| | | scoreAwardEx = ipyData.GetScoreAwardEx() |
| | | scoreAwardExList = scoreAwardEx.keys() |
| | | scoreAwardExList.sort() |
| | | awardItemList = ipyData.GetAwardItemList() |
| | | xiangongID = ipyData.GetXiangongID() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | | |
| | | for index in xrange(billboardIndex, billboardDataCount): |
| | | if orderCountTotal <= 0: |
| | | break |
| | | |
| | | for index in xrange(billboardIndex, billboardDataCount): |
| | | if orderCount >= orderCountTotal: |
| | | billboardData = billboardObj.At(index) |
| | | playerID = billboardData.ID |
| | | name2 = billboardData.Name2 |
| | | cmpValue = billboardData.CmpValue |
| | | if cmpValue < needScore: |
| | | GameWorld.Log(" 积分不足该榜单所需积分,跳过该名次: index=%s,rank=%s,playerID=%s,cmpValue=%s < %s" % (index, rank, playerID, cmpValue, needScore)) |
| | | break |
| | | |
| | | awardItemExList = [] |
| | | for scoreEx in scoreAwardExList: |
| | | if cmpValue < scoreEx: |
| | | break |
| | | |
| | | billboardData = billboardObj.At(index) |
| | | playerID = billboardData.ID |
| | | name2 = billboardData.Name2 |
| | | cmpValue = billboardData.CmpValue |
| | | |
| | | playerRank = index + 1 |
| | | GameWorld.Log(" 发放boss历练个人榜单奖励: rank=%s,playerID=%s,cmpValue=%s,awardItemList=%s, %s" |
| | | % (rank, playerID, cmpValue, awardItemList, name2)) |
| | | PlayerCompensation.SendMailByKey("BossTrialCrossPlayer", [playerID], awardItemList, [playerRank], crossMail=True) |
| | | |
| | | orderCount += 1 |
| | | billboardIndex += 1 |
| | | |
| | | awardItemExList = scoreAwardEx[scoreEx] # 取最大满足条件的一档 |
| | | finalAwardItemList = awardItemList + awardItemExList |
| | | |
| | | playerRank = rank - orderCountTotal + 1 |
| | | GameWorld.Log(" 发放boss历练个人榜单奖励: index=%s,rank=%s,playerRank=%s,playerID=%s,cmpValue=%s,awardItemList=%s,scoreAwardEx=%s,finalAwardItemList=%s, %s" |
| | | % (index, rank, playerRank, playerID, cmpValue, awardItemList, scoreAwardEx, finalAwardItemList, name2)) |
| | | PlayerCompensation.SendMailByKey("BossTrialCrossPlayer", [playerID], finalAwardItemList, [playerRank], crossMail=True) |
| | | |
| | | orderCountTotal -= 1 |
| | | billboardIndex += 1 |
| | | |
| | | GameXiangong.AddXiangongPlayer(xiangongID, playerID, serverIDRangeList, playerRank, syncNewXiangongDict) |
| | | GameWorship.AddWorshipPlayer(worshipType, playerRank, playerID, serverIDRangeList, syncList=syncNewWorshipList) |
| | | GameWorship.SendNewWorshipPlayer(syncNewWorshipList) |
| | | GameXiangong.SendNewXiangongPlayerToClientServer(syncNewXiangongDict) |
| | | return |
| | | |
| | | def __GiveCrossOrderAwardFamily(cfgID, zoneID, templateID, billboardType): |
| | |
| | | |
| | | # 结算时排序并保存榜单数据流向 |
| | | billboardObj.SortData() |
| | | billboardObj.SaveDRData() |
| | | billboardObj.SaveDRData("BossTrial", {"cfgID":cfgID, "zoneID":zoneID}) |
| | | |
| | | GameWorld.Log("结算跨服Boss凭证仙盟排行奖励: billboardType=%s,zoneID=%s,cfgID=%s,templateID=%s,billboardDataCount=%s" |
| | | % (billboardType, zoneID, cfgID, templateID, billboardDataCount)) |
| | | |
| | | orderIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", templateID) |
| | | if orderIpyDataList: |
| | | awardFamilyList = [] |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | | rank = ipyData.GetRank() |
| | | leaderAwardItemList = ipyData.GetAwardItemList() |
| | | memAwardItemList = ipyData.GetMemAwardItemList() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | | orderCount = 0 |
| | | |
| | | for index in xrange(billboardIndex, billboardDataCount): |
| | | if orderCount >= orderCountTotal: |
| | | break |
| | | |
| | | billboardData = billboardObj.At(index) |
| | | familyID = billboardData.ID |
| | | familySubmitTotal = billboardData.CmpValue |
| | | |
| | | familyRank = index + 1 |
| | | GameWorld.Log(" familyID=%s,名次=%s,总提交个数=%s" % (familyID, familyRank, familySubmitTotal)) |
| | | awardFamilyList.append([familyID, familyRank, familySubmitTotal, leaderAwardItemList, memAwardItemList]) |
| | | orderCount += 1 |
| | | billboardIndex += 1 |
| | | |
| | | # 广播子服发放奖励 |
| | | sendMsg = {"cfgID":cfgID, "zoneID":zoneID, "templateID":templateID, "awardFamilyList":awardFamilyList} |
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_CrossBossTrialFamilyAward, sendMsg) |
| | | if not orderIpyDataList: |
| | | return |
| | | |
| | | awardFamilyList = [] |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | | rank = ipyData.GetRank() |
| | | needScore = ipyData.GetNeedScore() |
| | | leaderAwardItemList = ipyData.GetAwardItemList() |
| | | memAwardItemList = ipyData.GetMemAwardItemList() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | | |
| | | for index in xrange(billboardIndex, billboardDataCount): |
| | | if orderCountTotal <= 0: |
| | | break |
| | | |
| | | billboardData = billboardObj.At(index) |
| | | familyID = billboardData.ID |
| | | familySubmitTotal = billboardData.CmpValue |
| | | |
| | | if familySubmitTotal < needScore: |
| | | GameWorld.Log(" 不足该榜单所需提交数,跳过该名次: index=%s,rank=%s,familyID=%s,familySubmitTotal=%s < %s" % (index, rank, familyID, familySubmitTotal, needScore)) |
| | | break |
| | | |
| | | familyRank = rank - orderCountTotal + 1 |
| | | GameWorld.Log(" index=%s,rank=%s,familyID=%s,名次=%s,总提交个数=%s" % (index, rank, familyID, familyRank, familySubmitTotal)) |
| | | awardFamilyList.append([familyID, familyRank, familySubmitTotal, leaderAwardItemList, memAwardItemList]) |
| | | |
| | | orderCountTotal -= 1 |
| | | billboardIndex += 1 |
| | | |
| | | # 广播子服发放奖励 |
| | | sendMsg = {"cfgID":cfgID, "zoneID":zoneID, "templateID":templateID, "awardFamilyList":awardFamilyList} |
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_CrossBossTrialFamilyAward, sendMsg) |
| | | return |
| | | |