| | |
| | | self.__billboardDict[key] = billboardObj
|
| | | return billboardObj
|
| | |
|
| | | def RemoveBillboard(self, billboardType):
|
| | | ## 移除某个类型的榜单所有数据
|
| | | for key in self.__billboardDict.keys():
|
| | | if key[0] == billboardType:
|
| | | self.__billboardDict.pop(key)
|
| | | return
|
| | | |
| | | # 保存数据 存数据库和realtimebackup
|
| | | def GetSaveData(self):
|
| | | savaData = ""
|
| | |
| | | for billboardType, groupValue1, groupValue2 in groupList:
|
| | | billboardObj = billboardMgr.GetCrossBillboard(billboardType, groupValue1, groupValue2)
|
| | | billboardObj.SaveDRData()
|
| | | return
|
| | |
|
| | | def CopyBillboard(fromBillboardType, toBillboardType):
|
| | | ## 将某个类型的榜单完全拷贝到其他榜单 - 一般用于备份、转移数据
|
| | | |
| | | billboardMgr = PyDataManager.GetCrossBillboardManager()
|
| | | billboardMgr.RemoveBillboard(toBillboardType) # 默认清空目标榜单
|
| | | |
| | | groupList = billboardMgr.GetBillboardGroupList(fromBillboardType)
|
| | | for billboardType, groupValue1, groupValue2 in groupList:
|
| | | frbillboardObj = billboardMgr.GetCrossBillboard(billboardType, groupValue1, groupValue2)
|
| | | toBillboardObj = billboardMgr.GetCrossBillboard(toBillboardType, groupValue1, groupValue2)
|
| | | GameWorld.Log("CopyCrossBillboard: billboardType=%s,toBillboardType=%s,groupValue1=%s,groupValue2=%s" |
| | | % (billboardType, 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.CmpValue = frbillboardData.CmpValue
|
| | | tobillboardData.CmpValue2 = frbillboardData.CmpValue2
|
| | | tobillboardData.CmpValue3 = frbillboardData.CmpValue3
|
| | | toBillboardObj.AddBillboardData(tobillboardData)
|
| | | |
| | | return
|
| | |
|
| | | #// C0 04 查看跨服排行榜 #tagCGViewCrossBillboard
|
| | |
| | | return
|
| | |
|
| | | def UpdCrossBillboard(billboardType, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue,
|
| | | cmpValue2=0, cmpValue3=0, groupValue2=0, id2=0, autoSort=True):
|
| | | cmpValue2=0, cmpValue3=0, groupValue2=0, id2=0, autoSort=True, noSortAndSync=False):
|
| | | ''' 更新跨服排行榜
|
| | | @param billboardType: 排行榜索引类型,同个榜单类型可以有多个分组榜单数据,独立排序
|
| | | @param groupValue1: 榜单分组1
|
| | |
| | | @param groupValue1: 榜单分组2
|
| | | @param id2: 扩展数据ID2
|
| | | @param autoSort: 是否排序,默认True
|
| | | @param noSortAndSync: 不排序及同步子服,默认False; 一般用于批量更新数据时设置为True,减少排序及同步频率,但是一定要在设置完数据或最后一条数据后手动调用一次排序SortData
|
| | | @return: 是否上榜更新榜单
|
| | | '''
|
| | | if not GameWorld.IsCrossServer():
|
| | |
| | | % (billboardType, groupValue1, groupValue2, dataID, isNewData, cmpValueChange,
|
| | | type2, value1, value2, cmpValue, cmpValue2, cmpValue3), dataID)
|
| | |
|
| | | if noSortAndSync:
|
| | | return True
|
| | | if autoSort and cmpValueChange:
|
| | | billboardObj.SortData()
|
| | | else:
|