10185 【越南】【港台】【主干】BOSS凭证修改(优化凭证榜单奖励结算;优化榜单备份;)
| | |
| | | if billType != None:
|
| | | billBoardType = billType
|
| | |
|
| | | topNum = GameWorld.ToIntDef(gmCmdDict.get('topNum', ''), 10)
|
| | | queryCount = GameWorld.ToIntDef(gmCmdDict.get('queryCount', ''), 10)
|
| | | startRank = GameWorld.ToIntDef(gmCmdDict.get('startRank', ''), 1)
|
| | | startRank = max(1, startRank)
|
| | |
|
| | | if billBoardType == None:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_TypeNumErr)
|
| | |
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_TypeNumErr)
|
| | | return False
|
| | |
|
| | | dataTotal = billBoard.GetCount()
|
| | | fromIndex = startRank - 1
|
| | | toIndex = fromIndex + queryCount
|
| | | billBoardInfo = []
|
| | | |
| | | for index in range(0, billBoard.GetCount()):
|
| | | |
| | | if index >= topNum:
|
| | | for index in xrange(fromIndex, toIndex):
|
| | | if index >= dataTotal:
|
| | | break
|
| | |
|
| | | billBoardData = billBoard.At(index)
|
| | | if not billBoardData:
|
| | | continue
|
| | |
|
| | | rank = index + 1
|
| | | billBoardDict = {
|
| | | "Rank":rank,
|
| | | "ID":billBoardData.GetID(),
|
| | | "ID2":billBoardData.GetID2(),
|
| | | "Name1":billBoardData.GetName1(),
|
| | |
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_MaxLimit)
|
| | | return
|
| | |
|
| | | backMsg = {"BillBoardType":billBoardType, "BillBoardInfo":billBoardInfo}
|
| | | backMsg = {"BillBoardType":billBoardType, "BillBoardInfo":billBoardInfo, "dataTotal":dataTotal}
|
| | | #执行成功
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, backMsg)
|
| | | return
|
| | |
| | | drDict = {"BillboardType":self.__billboardType, "GroupValue1":self.__groupValue1, "GroupValue2":self.__groupValue2,
|
| | | "DataCount":len(self.__billboardList)}
|
| | | DataRecordPack.SendEventPack(eventTypeName, drDict)
|
| | | for billboardData in self.__billboardList:
|
| | | for index, billboardData in enumerate(self.__billboardList):
|
| | | dataDict = {"BillboardType":billboardData.BillboardType, "GroupValue1":billboardData.GroupValue1,
|
| | | "GroupValue2":billboardData.GroupValue2, "Type2":billboardData.Type2,
|
| | | "ID":billboardData.ID, "ID2":billboardData.ID2,
|
| | | "ID":billboardData.ID, "ID2":billboardData.ID2, "Place":index, |
| | | "Name1":billboardData.Name1, "Name2":billboardData.Name2,
|
| | | "Value1":billboardData.Value1, "Value2":billboardData.Value2,
|
| | | "Value3":billboardData.Value3, "Value4":billboardData.Value4,
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def CopyBillboardEx(fromBillboardType, toBillboardType, groupValue1, groupValue2=0):
|
| | | ## 将某个类型的榜单完全拷贝到其他榜单 - 一般用于备份、转移数据
|
| | | |
| | | billboardMgr = PyDataManager.GetCrossBillboardManager()
|
| | | frbillboardObj = billboardMgr.GetCrossBillboard(fromBillboardType, groupValue1, groupValue2)
|
| | | toBillboardObj = billboardMgr.GetCrossBillboard(toBillboardType, groupValue1, groupValue2)
|
| | | toBillboardObj.ClearData()
|
| | | GameWorld.Log("CopyBillboardEx: fromBillboardType=%s,toBillboardType=%s,groupValue1=%s,groupValue2=%s" |
| | | % (fromBillboardType, toBillboardType, groupValue1, groupValue2))
|
| | | for frbillboardData in frbillboardObj.GetBillboardDataList():
|
| | | tobillboardData = PyGameDataStruct.tagDBCrossBillboard()
|
| | | tobillboardData.GroupValue1 = groupValue1
|
| | | tobillboardData.GroupValue2 = groupValue2
|
| | | tobillboardData.BillboardType = toBillboardType
|
| | | tobillboardData.ID = frbillboardData.ID
|
| | | tobillboardData.ID2 = frbillboardData.ID2
|
| | | tobillboardData.Name1 = frbillboardData.Name1
|
| | | tobillboardData.Name2 = frbillboardData.Name2
|
| | | tobillboardData.Type2 = frbillboardData.Type2
|
| | | tobillboardData.Value1 = frbillboardData.Value1
|
| | | tobillboardData.Value2 = frbillboardData.Value2
|
| | | tobillboardData.Value3 = frbillboardData.Value3
|
| | | tobillboardData.Value4 = frbillboardData.Value4
|
| | | tobillboardData.Value5 = frbillboardData.Value5
|
| | | tobillboardData.Value6 = frbillboardData.Value6
|
| | | tobillboardData.Value7 = frbillboardData.Value7
|
| | | tobillboardData.Value8 = frbillboardData.Value8
|
| | | tobillboardData.UserData = frbillboardData.UserData
|
| | | tobillboardData.DataLen = len(tobillboardData.UserData)
|
| | | tobillboardData.CmpValue = frbillboardData.CmpValue
|
| | | tobillboardData.CmpValue2 = frbillboardData.CmpValue2
|
| | | tobillboardData.CmpValue3 = frbillboardData.CmpValue3
|
| | | toBillboardObj.AddBillboardData(tobillboardData)
|
| | | |
| | | return
|
| | |
|
| | | #// C0 04 查看跨服排行榜 #tagCGViewCrossBillboard
|
| | | #
|
| | | #struct tagCGViewCrossBillboard
|
| | |
| | | if not cfgID: |
| | | return |
| | | BillboardType = ShareDefine.Def_BT_BossTrialSubmit |
| | | billBoard = GameWorld.GetBillboard().FindBillboard(BillboardType) |
| | | templateID = GameWorld.GetTemplateID(ipyData, cfgID, dayIndex) |
| | | __OnEndAward_Personal(templateID, BillboardType) |
| | | |
| | | DataRecordPack.DR_BillboardData(BillboardType, "BossTrial", {"actNum":actNum, "cfgID":cfgID, "dayIndex":dayIndex, "templateID":templateID}) |
| | | PlayerBillboard.CopyBillboard(ShareDefine.Def_BT_BossTrialSubmitBak, BillboardType) |
| | | PlayerBillboard.ClearBillboardByIndex(BillboardType) |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | | def __OnEndAward_Personal(templateID, billboardType): |
| | | billBoard = GameWorld.GetBillboard().FindBillboard(billboardType) |
| | | if not billBoard: |
| | | return |
| | | templateID = GameWorld.GetTemplateID(ipyData, cfgID, dayIndex) |
| | | if not templateID: |
| | | GameWorld.Log("本次活动没有个人榜奖励!") |
| | | return |
| | |
| | | |
| | | PlayerCompensation.SendMailByKey("BossTrialMail10", [playerID], awardItemList, [rank]) |
| | | |
| | | DataRecordPack.DR_BillboardData(BillboardType, "BossTrial", {"actNum":actNum, "cfgID":cfgID, "dayIndex":dayIndex, "templateID":templateID}) |
| | | PlayerBillboard.CopyBillboard(ShareDefine.Def_BT_BossTrialSubmitBak, BillboardType) |
| | | PlayerBillboard.ClearBillboardByIndex(BillboardType) |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | | def OnGiveFamilyOrderAwawrd(actNum, ipyData, dayIndex): |
| | |
| | | if not cfgID: |
| | | return |
| | | BillboardType = ShareDefine.Def_BT_BossTrialSubmitFamily |
| | | billBoard = GameWorld.GetBillboard().FindBillboard(BillboardType) |
| | | templateID = GameWorld.GetTemplateIDByList(ipyData.GetFamilyTemplateIDList(), dayIndex) |
| | | __OnEndAward_Family(templateID, BillboardType) |
| | | |
| | | DataRecordPack.DR_BillboardData(BillboardType, "BossTrial", {"actNum":actNum, "cfgID":cfgID, "dayIndex":dayIndex, "templateID":templateID}) |
| | | PlayerBillboard.CopyBillboard(ShareDefine.Def_BT_BossTrialSubmitFamilyBak, BillboardType) |
| | | PlayerBillboard.ClearBillboardByIndex(BillboardType) |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | | def __OnEndAward_Family(templateID, billboardType): |
| | | billBoard = GameWorld.GetBillboard().FindBillboard(billboardType) |
| | | if not billBoard: |
| | | return |
| | | templateIDList = ipyData.GetFamilyTemplateIDList() |
| | | templateID = GameWorld.GetTemplateIDByList(templateIDList, dayIndex) |
| | | if not templateID: |
| | | GameWorld.Log("本次活动没有仙盟榜奖励!") |
| | | return |
| | |
| | | |
| | | familyActionData = GetFamilyBossTrialSubmitActionData(familyID, False) |
| | | if not familyActionData: |
| | | GameWorld.ErrLog("该仙盟没有提交凭证ActionData! familyID=%s" % familyID) |
| | | continue |
| | | awardState = GetFamilyAwardState(familyActionData) |
| | | awardIndex = 0 # 本服奖励状态索引 |
| | |
| | | GameWorld.Log("发放boss历练活动仙盟榜单奖励本服: familyID=%s,名次=%s,总提交个数=%s,updAwardState=%s,awardMemIDList=%s,memSubCountDict=%s" |
| | | % (familyID, familyRank, cmpValue, updAwardState, awardMemIDList, memSubCountDict)) |
| | | |
| | | DataRecordPack.DR_BillboardData(BillboardType, "BossTrial", {"actNum":actNum, "cfgID":cfgID, "dayIndex":dayIndex, "templateID":templateID}) |
| | | PlayerBillboard.CopyBillboard(ShareDefine.Def_BT_BossTrialSubmitFamilyBak, BillboardType) |
| | | PlayerBillboard.ClearBillboardByIndex(BillboardType) |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | | def MapServer_BossTrial(curPlayer, msgList): |
| | |
| | | |
| | | familyActionData = GetFamilyBossTrialSubmitActionData(familyID, False) |
| | | if not familyActionData: |
| | | GameWorld.ErrLog("该仙盟没有提交凭证ActionData! familyID=%s" % familyID) |
| | | continue |
| | | awardState = GetFamilyAwardState(familyActionData) |
| | | awardIndex = 1 #跨服奖励状态索引 |
| | |
| | | PersonalTemplateID = ipyData.GetPersonalTemplateID() |
| | | FamilyTemplateID = ipyData.GetFamilyTemplateID() |
| | | |
| | | if PersonalTemplateID: |
| | | __GiveCrossOrderAwardPersonal(cfgID, zoneID, PersonalTemplateID) |
| | | |
| | | if FamilyTemplateID: |
| | | __GiveCrossOrderAwardFamily(cfgID, zoneID, FamilyTemplateID) |
| | | __GiveCrossOrderAwardPersonal(cfgID, zoneID, PersonalTemplateID, ShareDefine.Def_CBT_BossTrialSubmit) |
| | | __GiveCrossOrderAwardFamily(cfgID, zoneID, FamilyTemplateID, ShareDefine.Def_CBT_BossTrialSubmitFamily) |
| | | |
| | | # 如果有新活动,处理新活动 |
| | | if not state: |
| | |
| | | |
| | | return |
| | | |
| | | def __GiveCrossOrderAwardPersonal(cfgID, zoneID, templateID): |
| | | def __GiveCrossOrderAwardPersonal(cfgID, zoneID, templateID, billboardType): |
| | | |
| | | groupValue1 = zoneID |
| | | billboardType = ShareDefine.Def_CBT_BossTrialSubmit |
| | | #billboardType = ShareDefine.Def_CBT_BossTrialSubmit #榜单类型改为参数传入,异常情况下可特殊处理用备份榜单发奖励 |
| | | billboardMgr = PyDataManager.GetCrossBillboardManager() |
| | | billboardObj = billboardMgr.GetCrossBillboard(billboardType, groupValue1) |
| | | billboardDataCount = billboardObj.GetCount() |
| | | if not billboardDataCount: |
| | | GameWorld.Log("跨服Boss凭证个人排行数据为空! billboardType=%s,cfgID=%s,zoneID=%s,templateID=%s" % (billboardType, cfgID, zoneID, templateID)) |
| | | GameWorld.Log("跨服Boss凭证个人排行数据为空! billboardType=%s,zoneID=%s,cfgID=%s,templateID=%s" % (billboardType, zoneID, cfgID, templateID)) |
| | | return |
| | | |
| | | # 结算时排序并保存榜单数据流向 |
| | | billboardObj.SortData() |
| | | |
| | | GameWorld.Log("结算跨服Boss凭证个人排行奖励: billboardType=%s,cfgID=%s,zoneID=%s,templateID=%s,billboardDataCount=%s" |
| | | % (billboardType, cfgID, zoneID, templateID, billboardDataCount)) |
| | | GameWorld.Log("结算跨服Boss凭证个人排行奖励: billboardType=%s,zoneID=%s,cfgID=%s,templateID=%s,billboardDataCount=%s" |
| | | % (billboardType, zoneID, cfgID, templateID, billboardDataCount)) |
| | | |
| | | orderIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", templateID) |
| | | if not orderIpyDataList: |
| | | return |
| | | |
| | | if orderIpyDataList: |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | |
| | | billboardIndex += 1 |
| | | |
| | | # 结算完备份、清除榜单数据 |
| | | CrossBillboard.CopyBillboard(billboardType, ShareDefine.Def_CBT_BossTrialSubmitBak) |
| | | if billboardType == ShareDefine.Def_CBT_BossTrialSubmit: |
| | | CrossBillboard.CopyBillboardEx(billboardType, ShareDefine.Def_CBT_BossTrialSubmitBak, groupValue1) |
| | | billboardObj.ClearData() |
| | | return |
| | | |
| | | def __GiveCrossOrderAwardFamily(cfgID, zoneID, templateID): |
| | | def __GiveCrossOrderAwardFamily(cfgID, zoneID, templateID, billboardType): |
| | | |
| | | groupValue1 = zoneID |
| | | billboardType = ShareDefine.Def_CBT_BossTrialSubmitFamily |
| | | #billboardType = ShareDefine.Def_CBT_BossTrialSubmitFamily |
| | | billboardMgr = PyDataManager.GetCrossBillboardManager() |
| | | billboardObj = billboardMgr.GetCrossBillboard(billboardType, groupValue1) |
| | | billboardDataCount = billboardObj.GetCount() |
| | | if not billboardDataCount: |
| | | GameWorld.Log("跨服Boss凭证仙盟排行数据为空! billboardType=%s,cfgID=%s,zoneID=%s,templateID=%s" % (billboardType, cfgID, zoneID, templateID)) |
| | | GameWorld.Log("跨服Boss凭证仙盟排行数据为空! billboardType=%s,zoneID=%s,cfgID=%s,templateID=%s" % (billboardType, zoneID, cfgID, templateID)) |
| | | return |
| | | |
| | | # 结算时排序并保存榜单数据流向 |
| | | billboardObj.SortData() |
| | | |
| | | GameWorld.Log("结算跨服Boss凭证仙盟排行奖励: billboardType=%s,cfgID=%s,zoneID=%s,templateID=%s,billboardDataCount=%s" |
| | | % (billboardType, cfgID, zoneID, templateID, billboardDataCount)) |
| | | GameWorld.Log("结算跨服Boss凭证仙盟排行奖励: billboardType=%s,zoneID=%s,cfgID=%s,templateID=%s,billboardDataCount=%s" |
| | | % (billboardType, zoneID, cfgID, templateID, billboardDataCount)) |
| | | |
| | | orderIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", templateID) |
| | | if not orderIpyDataList: |
| | | return |
| | | |
| | | if orderIpyDataList: |
| | | awardFamilyList = [] |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | |
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_CrossBossTrialFamilyAward, sendMsg) |
| | | |
| | | # 结算完备份、清除榜单数据 |
| | | CrossBillboard.CopyBillboard(billboardType, ShareDefine.Def_CBT_BossTrialSubmitFamilyBak) |
| | | if billboardType == ShareDefine.Def_CBT_BossTrialSubmitFamily: |
| | | CrossBillboard.CopyBillboardEx(billboardType, ShareDefine.Def_CBT_BossTrialSubmitFamilyBak, groupValue1) |
| | | billboardObj.ClearData() |
| | | return |
| | | |