| | |
| | | import GameWorld
|
| | | import ChConfig
|
| | | import PlayerControl
|
| | | import ReadChConfig
|
| | | import OpenServerCampaign
|
| | | import MixServerCampaign
|
| | | import PlayerSuccess
|
| | | import GameFuncComm
|
| | | import EventReport
|
| | |
|
| | |
| | | return curPlayer.GetOperateInfo()
|
| | | return platform
|
| | |
|
| | | def GetBillboardJob(curPlayer): return curPlayer.GetJob() + PlayerControl.GetJobRank(curPlayer) * 10 #个位是job 十位百位是jobrank
|
| | | def GetBillboardJob(curPlayer): return curPlayer.GetJob()
|
| | |
|
| | | def UpdatePlayerBillboardOnLeaveServer(curPlayer, isAll=False):
|
| | | ##下线更新玩家排行榜
|
| | |
| | |
|
| | | if isAll:
|
| | | UpdateRuneTowerBillboard(curPlayer)
|
| | | |
| | | #UpdateTJGBillboard(curPlayer, minuteExp) 脱机效率可不更新
|
| | |
|
| | | return
|
| | |
| | | UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_TrialTower, passLV)
|
| | | return
|
| | |
|
| | |
|
| | | def UpdateTJGBillboard(curPlayer, minuteExp):
|
| | | ##脱机效率榜
|
| | | if not minuteExp:
|
| | |
| | | def BillboardOnLogin(curPlayer):
|
| | | # 上线默认同步排行榜
|
| | | UpdatePlayerBillboardOnLeaveServer(curPlayer) #排行榜已实时更新,故上线不再同步
|
| | | |
| | | curSign = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ClearBillboardSign)
|
| | | |
| | | playerSign = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ReUpdBillboardSign)
|
| | | |
| | | if playerSign == curSign:
|
| | | GameWorld.DebugLog("玩家登录检查是否重新同步排行榜!标记相同不同步curSign=%s" % curSign)
|
| | | return
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ReUpdBillboardSign, curSign)
|
| | | GameWorld.DebugLog("玩家登录重新同步排行榜!更新同步标记lastSign=%s,curSign=%s" % (playerSign, curSign))
|
| | | |
| | | # 如果是合服充值活动记录时机,则同步一次排行榜
|
| | | mixServerRechargeType = ShareDefine.Def_MixCampaign_Type_RechargeRank
|
| | | if MixServerCampaign.IsNeedSaveMixServerCampaignRecordData(mixServerRechargeType):
|
| | | mixRecordDataType = ShareDefine.Def_MixCampaign_Type_RechargeCnt
|
| | | mixRecordDataKey = ChConfig.Def_PDict_MixServerCampaign_RecordData % mixRecordDataType
|
| | | mixRecordData = curPlayer.NomalDictGetProperty(mixRecordDataKey, 0, ChConfig.Def_PDictType_OpenServerCampaign)
|
| | | UpdateMixServerRechargeRankBillboard(curPlayer, mixRecordData)
|
| | | else:
|
| | | GameWorld.DebugLog("非合服充值活动记录时机,不同步!")
|
| | | |
| | | # 特惠充值排行
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | actionNumKey = ShareDefine.Def_Notify_WorldKey_DayAction_RechargeRank
|
| | | actionNum = gameWorld.GetGameWorldDictByKey(actionNumKey)
|
| | | if actionNum:
|
| | | curTotalGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TeHui_RechargeRankTotalGold, 0,
|
| | | ChConfig.Def_PDictType_TeHuiAction)
|
| | | curTotalGold = max(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TeHui_RechargeRankTotalGoldEx, 0,
|
| | | ChConfig.Def_PDictType_TeHuiAction), curTotalGold)
|
| | | actionID = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DayAction_ID % actionNumKey)
|
| | | UpdateRechargeRankBillboard(curPlayer, actionID, actionNum, curTotalGold)
|
| | | else:
|
| | | GameWorld.DebugLog("非特惠充值排行活动时机,不同步!")
|
| | | |
| | | GameWorld.DebugLog("玩家登录重新同步排行榜!OK!")
|
| | | return
|
| | |
|
| | | ##合服首次上线强制更新一次排行榜
|
| | | # @param curPlayer 玩家实例
|
| | | # @param lastMixServerDay 合服时的开服天
|
| | | # @return
|
| | | def UpdBillboardOnMixServerFirstLogin(curPlayer, lastMixServerDay):
|
| | | |
| | | updBillboardDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MSFirstLogin_UpdBillboard)
|
| | | |
| | | if lastMixServerDay == updBillboardDay:
|
| | | GameWorld.DebugLog("合服首登同步排行榜已处理过!lastMixServerDay=%s,updBillboardDay=%s" |
| | | % (lastMixServerDay, updBillboardDay))
|
| | | return
|
| | | |
| | | GameWorld.DebugLog("合服首登同步排行榜...")
|
| | | UpdatePlayerBillboardOnLeaveServer(curPlayer)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MSFirstLogin_UpdBillboard, lastMixServerDay)
|
| | | GameWorld.DebugLog(" 合服首登同步排行榜OK!!!")
|
| | | return
|
| | |
|
| | | ## 更新当前镖车信息
|
| | |
| | | cmdList = [playerID, playerName, playerOpInfo, playerLV, truckLV, truckMapID]
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "UpdateBillboardPlayerTruck",
|
| | | '%s' % (cmdList), len(str(cmdList)))
|
| | | return
|
| | |
|
| | | ## 更新充值排行特惠排行榜
|
| | | # @param playerID: 玩家ID
|
| | | # @return: |
| | | def UpdateRechargeRankBillboard(curPlayer, actionID, actionNum, updateGold):
|
| | | # if GameWorld.IsGM(curPlayer):
|
| | | # #GM不上榜
|
| | | # return
|
| | | |
| | | #排行榜需要数据[玩家ID, 玩家名字, 玩家职业, 击杀数]
|
| | | playerID = curPlayer.GetID()
|
| | | playerName = curPlayer.GetName()
|
| | | playerOpInfo = curPlayer.GetOperateInfo()
|
| | | playerJob = curPlayer.GetJob()
|
| | | playerLV = curPlayer.GetLV()
|
| | | familyName = curPlayer.GetFamilyName()
|
| | | GameWorld.DebugLog("更新特惠充值排行榜: actionID=%s,actionNum=%s,updateGold=%s" |
| | | % (actionID, actionNum, updateGold), curPlayer.GetPlayerID())
|
| | | sendMsg = '%s' % ([playerID, playerName, playerOpInfo, playerJob, playerLV, familyName, actionID, actionNum, updateGold]) |
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'UpdRechargeRankBillboard', \
|
| | | sendMsg, len(sendMsg))
|
| | | return
|
| | |
|
| | | ## 更新消费排行特惠排行榜
|
| | | # @param playerID: 玩家ID
|
| | | # @return: |
| | | def UpdateCostRankBillboard(curPlayer, actionID, actionNum, updateGold):
|
| | | # if GameWorld.IsGM(curPlayer):
|
| | | # #GM不上榜
|
| | | # return
|
| | | |
| | | #排行榜需要数据[玩家ID, 玩家名字, 玩家职业, 击杀数]
|
| | | playerID = curPlayer.GetID()
|
| | | playerName = curPlayer.GetName()
|
| | | playerOpInfo = curPlayer.GetOperateInfo()
|
| | | playerJob = curPlayer.GetJob()
|
| | | playerLV = curPlayer.GetLV()
|
| | | familyName = curPlayer.GetFamilyName()
|
| | | GameWorld.DebugLog("更新特惠消费排行榜: actionID=%s,actionNum=%s,updateGold=%s" |
| | | % (actionID, actionNum, updateGold), curPlayer.GetPlayerID())
|
| | | sendMsg = '%s' % ([playerID, playerName, playerOpInfo, playerJob, playerLV, familyName, actionID, actionNum, updateGold]) |
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'UpdCostRankBillboard', \
|
| | | sendMsg, len(sendMsg))
|
| | | return
|
| | |
|
| | | ## 更新合服累计充值活动排行榜
|
| | | # @param playerID: 玩家ID
|
| | | # @return: |
| | | def UpdateMixServerRechargeRankBillboard(curPlayer, value):
|
| | | # if GameWorld.IsGM(curPlayer):
|
| | | # #GM不上榜
|
| | | # return
|
| | | |
| | | mixServerRechargeBillLimit = ReadChConfig.GetEvalChConfig("MixServerRechargeBillLimit")
|
| | | GameWorld.DebugLog(" 更新合服累计充值活动排行榜 value=%s,limit=%s" |
| | | % (value, mixServerRechargeBillLimit), curPlayer.GetPlayerID())
|
| | | # 未达到上榜条件
|
| | | if value < mixServerRechargeBillLimit:
|
| | | return
|
| | | |
| | | #排行榜需要数据[玩家ID, 玩家名字, 玩家职业, 击杀数]
|
| | | playerID = curPlayer.GetID()
|
| | | playerName = curPlayer.GetName()
|
| | | playerOpInfo = curPlayer.GetOperateInfo()
|
| | | playerJob = curPlayer.GetJob()
|
| | | fightPower = curPlayer.GetFightPower()
|
| | | familyName = curPlayer.GetFamilyName()
|
| | | sendMsg = '%s' % ([playerID, playerName, playerOpInfo, playerJob, fightPower, familyName, value]) |
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'UpdMSRechargeRankBillboard', \
|
| | | sendMsg, len(sendMsg))
|
| | | return
|
| | |
|
| | | ##更新玩家充值排行榜
|
| | |
| | | sendMsg, len(sendMsg))
|
| | | return
|
| | |
|
| | | ## 更新合服战盟击杀boss活动排行榜
|
| | | # @param playerID: 玩家ID
|
| | | # @return: |
| | | def UpdateMixServerFamilyKillBossBillboard(curPlayer, value):
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | if not familyID:
|
| | | return
|
| | | #排行榜需要数据[玩家ID]
|
| | | playerID = curPlayer.GetID()
|
| | | # playerName = curPlayer.GetName()
|
| | | # playerOpInfo = curPlayer.GetOperateInfo()
|
| | | # playerJob = curPlayer.GetJob()
|
| | | # fightPower = curPlayer.GetFightPower()
|
| | | # familyName = curPlayer.GetFamilyName()
|
| | | sendMsg = '%s' % ([value])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(playerID, 0, 0, 'UpdMSFamilyKillBossBillboard', \
|
| | | sendMsg, len(sendMsg))
|
| | | return
|