| | |
| | | import GameWorld
|
| | | import ChConfig
|
| | | import ShareDefine
|
| | | import ReadChConfig
|
| | | import PlayerControl
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import PlayerDBGSEvent
|
| | | import NetPackCommon
|
| | | import DataRecordPack
|
| | | import PlayerFamily
|
| | |
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def __CheckFightPowerBillboard():
|
| | | ## 由于战力修改为支持超过20E,所以需要处理下战力相关榜单,原 cmpValue 值移动到 cmpValue2
|
| | | |
| | | eventKey = "FightPowerBillboardMoveValue"
|
| | | if PlayerDBGSEvent.GetDBGSTrig_ByKey(eventKey):
|
| | | return
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(eventKey, 1)
|
| | | GameWorld.Log("处理战力榜超过20E支持!")
|
| | | |
| | | billboardList = [ShareDefine.Def_BT_FightPower] + ShareDefine.JobFightPowerBillboardDict.values()
|
| | | for billboardType in billboardList:
|
| | | billboard = GameWorld.GetBillboard().FindBillboard(billboardType)
|
| | | if not billboard:
|
| | | continue
|
| | | GameWorld.Log(" billboardType=%s,count=%s" % (billboardType, billboard.GetCount()))
|
| | | for index in xrange(billboard.GetCount()):
|
| | | billBoardData = billboard.At(index)
|
| | | if not billBoardData:
|
| | | continue
|
| | | billBoardData.SetCmpValue2(billBoardData.GetCmpValue())
|
| | | billBoardData.SetCmpValue(0)
|
| | | |
| | | return
|
| | |
|
| | | def SortServerBillboard():
|
| | | ##排序所有排行榜
|
| | | billboardMgr = GameWorld.GetBillboard()
|
| | |
| | | billBoard = billboardMgr.FindBillboard(index)
|
| | | #排序一次排行榜
|
| | | billBoard.Sort()
|
| | |
|
| | | |
| | | __CheckFightPowerBillboard()
|
| | | return
|
| | |
|
| | | def CopyBillboard(newBillboardIndex, oldBillboardIndex):
|
| | |
| | | GameWorld.Log('billboardIndex %s clear.'%billboardIndex)
|
| | | return
|
| | |
|
| | | def UpdateBillboardMaxCount(billboardIndex, updMaxCount, isDelExtra=True):
|
| | | ''' 变更竞技场榜单最大数据数
|
| | | @param updMaxCount: 更新的最大数据排名
|
| | | @param isDelExtra: 是否删除原榜单排名数据超过更新后的最大排名,默认删除
|
| | | '''
|
| | | billBoard = GameWorld.GetBillboard().FindBillboard(billboardIndex)
|
| | | if not billBoard:
|
| | | return
|
| | | curCount = billBoard.GetCount()
|
| | | curMaxCount = billBoard.GetMaxCount()
|
| | | # 不超过程序内置配置的最大数量
|
| | | if billboardIndex in ChConfig.Def_BT_Cnt:
|
| | | updMaxCount = min(updMaxCount, ChConfig.Def_BT_Cnt[billboardIndex])
|
| | | if curMaxCount == updMaxCount:
|
| | | return
|
| | | billBoard.SetMaxCount(updMaxCount)
|
| | | GameWorld.Log(" 变更榜单最大数据数! billboardIndex=%s,curCount=%s,curMaxCount=%s,updMaxCount=%s" |
| | | % (billboardIndex, curCount, curMaxCount, updMaxCount))
|
| | | |
| | | # 清除多余榜单数据
|
| | | if isDelExtra and curCount > updMaxCount:
|
| | | for delIndex in xrange(curCount - 1, updMaxCount - 1, -1):
|
| | | if delIndex >= 0:
|
| | | GameWorld.Log(" DeleteByIndex: %s" % delIndex)
|
| | | billBoard.DeleteByIndex(delIndex)
|
| | | return
|
| | |
|
| | | ####################################################################################################
|
| | |
|
| | | #class IPY_GSetWatchBillboardState
|
| | |
| | |
|
| | | if packType in ChConfig.Def_InterdictLook_BT_Type:
|
| | | #不可通过此封包查看
|
| | | return
|
| | | if ChConfig.Def_BT_Cnt.get(packType, 0) > 100:
|
| | | GameWorld.DebugLog("该榜单最大名次较大,需使用分页查询! A9 A2 查看排行榜#tagCPYWatchBillboard")
|
| | | return
|
| | | if not __CheckWatchCD(curPlayer, packType, tick):
|
| | | return
|
| | |
| | | # 以下为榜单附加特殊处理
|
| | | if bType == ShareDefine.Def_BT_FightPower:
|
| | | playerID = bID
|
| | | fightPowerTotal = cmpValue
|
| | | fightPowerTotal = cmpValue * ChConfig.Def_PerPointValue + cmpValue2
|
| | | familyID = exInfo[0]
|
| | | playerJob = bType2
|
| | |
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if curPlayer:
|
| | | curPlayer.SetFightPower(fightPowerTotal)
|
| | | PlayerControl.SetFightPower(curPlayer, fightPowerTotal)
|
| | |
|
| | | #更新战盟成员战力
|
| | | PlayerFamily.UpdFamilyMemberFightPower(familyID, playerID, fightPowerTotal)
|
| | |
| | | job = playerJob % 10
|
| | | if job in ShareDefine.JobFightPowerBillboardDict:
|
| | | jobBType = ShareDefine.JobFightPowerBillboardDict[job]
|
| | | UpdatePlayerBillboard(bID, bName, bName2, jobBType, bType2, value1, value2, cmpValue, autoSort)
|
| | | UpdatePlayerBillboard(bID, bName, bName2, jobBType, bType2, value1, value2, cmpValue, autoSort, cmpValue2)
|
| | | gameWorld.SetDict(Def_Key_BillboardNeedSort % jobBType, 1)
|
| | | #__UpdateBillboardSortState(gameWorld, jobBType, autoSort, isUpd)
|
| | |
|
| | |
| | | def IsBillboardLVLimit(playerLV, billboardType):
|
| | | # 等级判断已由地图处理掉,这里不再做判断
|
| | | return True
|
| | | # BillBoardLimitInfo = ReadChConfig.GetEvalChConfig("BillBoardLimit")
|
| | | # defaultMinLV, limitLVDict = BillBoardLimitInfo
|
| | | # lvBillBoardMinLV = limitLVDict.get(billboardType, defaultMinLV)
|
| | | # if playerLV < lvBillBoardMinLV:
|
| | | # return True
|
| | | # |
| | | # return False
|
| | |
|
| | | def RedressBillboard(curPlayer):
|
| | | ## 纠正排行榜中的玩家名字记录
|