| | |
| | |
|
| | | def DoBillboardOpen(curPlayer):
|
| | | for campaignType, billBoardType in ShareDefine.Def_Campaign_Billboard_Dict.items():
|
| | | value = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSC_RecordData % campaignType)
|
| | | value = GetOSCRecordData(curPlayer, campaignType)
|
| | | GameWorld.DebugLog("排行榜开启,同步开服活动记录!campaignType=%s,billBoardType=%s,value=%s" % (campaignType, billBoardType, value))
|
| | | if CanUpdOSCBillboard(curPlayer, campaignType, value):
|
| | | PlayerBillboard.UpdatePlayerBillboard(curPlayer, billBoardType, value)
|
| | |
| | | def CanUpdOSCBillboard(curPlayer, campaignType, curValue): return __CanUpdOSCRecordData(campaignType, curValue)
|
| | | def IsNeedSaveOpenServerCampaignRecordData(campaignType): return __CanUpdOSCRecordData(campaignType)
|
| | |
|
| | | def GetOSCRecordData(curPlayer, campaignType):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSC_RecordData % campaignType) + \
|
| | | curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSC_RecordDataEx % campaignType) * ChConfig.Def_PerPointValue
|
| | | |
| | | def SetOSCRecordData(curPlayer, campaignType, updRecordData):
|
| | | recordData = updRecordData % ChConfig.Def_PerPointValue
|
| | | recordDataEx = updRecordData / ChConfig.Def_PerPointValue
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OSC_RecordData % campaignType, recordData)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OSC_RecordDataEx % campaignType, recordDataEx)
|
| | | return GetOSCRecordData(curPlayer, campaignType)
|
| | |
|
| | | def AddOpenServerCampaignRecordData(curPlayer, campaignType, addValue):
|
| | | ## 增加开服活动数据记录(外调函数)
|
| | | recordData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSC_RecordData % campaignType)
|
| | | recordData = GetOSCRecordData(curPlayer, campaignType)
|
| | |
|
| | | recordData += addValue
|
| | | UpdOpenServerCampaignRecordData(curPlayer, campaignType, recordData)
|
| | |
| | | #GameWorld.DebugLog(" 非开服活动记录数据时机, campaignType=%s" % campaignType)
|
| | | return
|
| | |
|
| | | recordData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSC_RecordData % campaignType)
|
| | | recordData = GetOSCRecordData(curPlayer, campaignType)
|
| | |
|
| | | if value == recordData:
|
| | | GameWorld.DebugLog(" 开服活动数据等于历史记录, 不更新 campaignType=%s,recordData=%s,updValue=%s"
|
| | |
| | | return
|
| | |
|
| | | # 更新开服活动时的记录数值
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OSC_RecordData % campaignType, value)
|
| | | value = SetOSCRecordData(curPlayer, campaignType, value)
|
| | | Sync_OpenServerCampaignAward(curPlayer, campaignType)
|
| | | GameWorld.DebugLog(" 更新开服活动数据记录 campaignType=%s,recordData=%s,updValue=%s"
|
| | | % (campaignType, recordData, value), curPlayer.GetPlayerID())
|
| | |
|
| | | canUpdOSCBill = CanUpdOSCBillboard(curPlayer, campaignType, value)
|
| | | if campaignType in ShareDefine.Def_Campaign_Billboard_Dict and (value <= recordData or canUpdOSCBill):
|
| | | cmpValue = value / ChConfig.Def_PerPointValue
|
| | | cmpValue2 = value % ChConfig.Def_PerPointValue
|
| | | if not canUpdOSCBill:
|
| | | value = -1
|
| | | cmpValue = -1
|
| | | cmpValue2 = 0
|
| | | GameWorld.DebugLog(" 不能上榜降数据的,设置该榜单数据为-1,删除该数据!", curPlayer.GetPlayerID())
|
| | | billBoardType = ShareDefine.Def_Campaign_Billboard_Dict[campaignType]
|
| | | PlayerBillboard.UpdatePlayerBillboard(curPlayer, billBoardType, value)
|
| | | PlayerBillboard.UpdatePlayerBillboard(curPlayer, billBoardType, cmpValue, cmpValue2)
|
| | | return
|
| | |
|
| | | ##==================================================================================================
|
| | |
| | | return
|
| | |
|
| | | condition = tagAwardIpyData.GetTagCondition()
|
| | | recordData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSC_RecordData % campaignType)
|
| | | recordData = GetOSCRecordData(curPlayer, campaignType)
|
| | | if recordData < condition:
|
| | | GameWorld.DebugLog(" 未达到该开服活动目标条件奖励!campaignType=%s,index=%s,recordData=%s < condition=%s"
|
| | | % (campaignType, index, recordData, condition), curPlayer.GetPlayerID())
|
| | |
| | | oscAward.BillAwardRecord = 1 if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSC_BillAwardRecord) & pow(2, syncOSCType) else 0
|
| | | oscAward.TagAwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSC_TagAwardRecord % syncOSCType)
|
| | | oscAward.RecordData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSC_RecordData % syncOSCType)
|
| | | oscAward.RecordDataEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSC_RecordDataEx % syncOSCType)
|
| | | oscAwardListPack.OSCAwardList.append(oscAward)
|
| | |
|
| | | oscAwardListPack.OSCAwardCnt = len(oscAwardListPack.OSCAwardList)
|