ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBillboard.py
@@ -115,6 +115,7 @@
        self.__clientServerDataVer = 0 # 子服榜单数据版本
        self.__billboardList = [] # [tagDBCrossBillboard, ...] 
        self.__idOrderDict = {} # {id:名次, ...}
        self.__orderRuleList = None
        self.__sortDelay = False # 是否需要延迟排序
        return
    
@@ -223,9 +224,36 @@
        ## 获取ID对应名次字典
        # @return: {ID:名次, ...}  名次从1开始
        if not self.__idOrderDict:
            if self.__orderRuleList:
                billboardDataCount = self.GetCount()
                rankPre = 0
                billboardIndex = 0
                for rank, needCmpValue in self.__orderRuleList:
                    orderCountTotal = rank - rankPre # 奖励名次数量
                    rankPre = rank
                    for index in xrange(billboardIndex, billboardDataCount):
                        if orderCountTotal <= 0:
                            break
                        billboardData = self.At(index)
                        if billboardData.CmpValue < needCmpValue:
                            break
                        orderReal = rank - orderCountTotal + 1
                        self.__idOrderDict[billboardData.ID] = orderReal
                        orderCountTotal -= 1
                        billboardIndex += 1
            else:
            for order, billboardData in enumerate(self.__billboardList, 1):
                self.__idOrderDict[billboardData.ID] = order
        return self.__idOrderDict
    def SetOrderRuleList(self, orderRuleList):
        ## 排名所需值规则列表
        # @param orderRuleList: 排名所需值规则列表 [[order, needCmpValue], ...]
        self.__orderRuleList = orderRuleList
        self.__idOrderDict = {} # 设置后需重置,可能配置规则变化了导致实际排名可能变化
        GameWorld.Log("设置排名所需值规则列表: billboardType=%s,groupValue1=%s,groupValue2=%s, %s"
                      % (self.__billboardType, self.__groupValue1, self.__groupValue2, orderRuleList))
        return
    
    def GetCount(self): return len(self.__billboardList)
    def GetMaxCount(self): return self.__maxCount
@@ -449,6 +477,7 @@
    billboardMgr = PyDataManager.GetCrossBillboardManager()
    billboardObj = billboardMgr.GetCrossBillboard(billboardType, groupValue1, groupValue2)
    billboardObj.DoDelaySort()
    idOrderDict = billboardObj.GetIDOrderDict()
    crossServerDataVer = billboardObj.GetCrossServerDataVer()
    msgData = {"BillboardType":billboardType, "GroupValue1":groupValue1, "GroupValue2":groupValue2,
               "QueryData":queryData, "CrossServerDataVer":crossServerDataVer}
@@ -505,7 +534,8 @@
            CmpValue = billboardData.CmpValue
            CmpValue2 = billboardData.CmpValue2
            CmpValue3 = billboardData.CmpValue3
            syncBillboardList.append([index, ID, ID2, Name1, Name2, Type2, Value1, Value2, CmpValue, CmpValue2, CmpValue3, Value3, Value4, Value5, Value6, Value7, Value8, UserData])
            orderIndex = idOrderDict.get(ID, index + 1) - 1
            syncBillboardList.append([orderIndex, ID, ID2, Name1, Name2, Type2, Value1, Value2, CmpValue, CmpValue2, CmpValue3, Value3, Value4, Value5, Value6, Value7, Value8, UserData])
        msgData["BillboardDataList"] = syncBillboardList
        
    CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_SyncBillboard, msgData, serverGroupIDList)
@@ -559,9 +589,9 @@
    billboardInfo.WatchID = watchID
    billboardInfo.CrossBillboardDataList = []
    for dataInfo in billboardList:
        index, ID, ID2, Name1, Name2, Type2, Value1, Value2, CmpValue, CmpValue2, CmpValue3, Value3, Value4, Value5, Value6, Value7, Value8, UserData = dataInfo
        orderIndex, ID, ID2, Name1, Name2, Type2, Value1, Value2, CmpValue, CmpValue2, CmpValue3, Value3, Value4, Value5, Value6, Value7, Value8, UserData = dataInfo
        billboardInfoData = ChPyNetSendPack.tagGCCrossBillboardData()
        billboardInfoData.OrderIndex = index
        billboardInfoData.OrderIndex = orderIndex
        billboardInfoData.ID = ID
        billboardInfoData.ID2 = ID2
        billboardInfoData.Name1 = Name1