| | |
| | | import CrossBillboard |
| | | import PyDataManager |
| | | import CrossRealmMsg |
| | | import GameXiangong |
| | | import GameWorship |
| | | import GameWorld |
| | | |
| | | def OnActStart(actNum, ipyData): |
| | |
| | | __OnEndAward(actNum, ipyData, dayIndex) # 兼容活动没有配置参与时间段的在活动结束补触发结算奖励 |
| | | |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | | def OnActInStateRefresh(actNum, ipyData): |
| | | ## 活动中刷新,每次都需要刷新的逻辑,包含重读配置等 |
| | | if not ipyData: |
| | | return |
| | | personalTemplateID = ipyData.GetPersonalTemplateID() |
| | | if not personalTemplateID: |
| | | return |
| | | orderRuleList = GetOrderRuleList(personalTemplateID) |
| | | |
| | | billboardMgr = PlayerBillboard.GetBillboardMgr() |
| | | billboardObj = billboardMgr.GetBillboardObj(ShareDefine.Def_BT_HorsePetTrainScore) |
| | | billboardObj.SetOrderRuleList(orderRuleList) |
| | | return |
| | | |
| | | def OnActJoinEnd(actNum, ipyData, dayIndex): |
| | |
| | | needScore = ipyData.GetNeedScore() |
| | | scoreAwardEx = ipyData.GetScoreAwardEx() |
| | | scoreAwardExList = scoreAwardEx.keys() |
| | | scoreAwardExList.sort() |
| | | awardItemList = ipyData.GetAwardItemList() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | |
| | | accID = curPlayer.GetAccID() |
| | | playerName = curPlayer.GetName() |
| | | job = curPlayer.GetJob() |
| | | face = curPlayer.GetFace() |
| | | facePic = curPlayer.GetFacePic() |
| | | realmLV = curPlayer.GetOfficialRank() |
| | | _, updScore, isRelationCrossAct = dataMsg |
| | | |
| | |
| | | if isRelationCrossAct: |
| | | #同步跨服 |
| | | playerInfo = {"playerID":playerID, "playerName":playerName, "accID":accID, "job":job, "realmLV":realmLV, |
| | | "playerScore":updScore} |
| | | "playerScore":updScore, "face":face, "facePic":facePic} |
| | | SyncHorsePetTrainToCrossServer(curPlayer, playerInfo) |
| | | return |
| | | |
| | |
| | | accID = playerInfo["accID"] |
| | | realmLV = playerInfo["realmLV"] |
| | | playerScore = playerInfo["playerScore"] |
| | | face = playerInfo.get("face", 0) |
| | | facePic = playerInfo.get("facePic", 0) |
| | | |
| | | groupValue1 = zoneID |
| | | |
| | | if playerScore >= personlLimit: |
| | | name2, type2, value1, value2 = accID, job, realmLV, 0 |
| | | CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_HorsePetTrainScore, groupValue1, playerID, playerName, |
| | | name2, type2, value1, value2, playerScore, autoSort=False) |
| | | name2, type2, value1, value2, playerScore, autoSort=False, value3=face, value4=facePic) |
| | | return |
| | | |
| | | def OnCrossActIDChange(cfgID, zoneID, ipyData, state): |
| | |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | | def OnCrossActInStateRefresh(cfgID, zoneID, ipyData): |
| | | ## 活动中刷新,每次都需要刷新的逻辑,包含重读配置等 |
| | | if not ipyData: |
| | | return |
| | | PersonalTemplateID = ipyData.GetPersonalTemplateID() |
| | | orderRuleList = GetOrderRuleList(PersonalTemplateID) |
| | | |
| | | groupValue1 = zoneID |
| | | billboardMgr = PyDataManager.GetCrossBillboardManager() |
| | | billboardObj = billboardMgr.GetCrossBillboard(ShareDefine.Def_CBT_HorsePetTrainScore, groupValue1) |
| | | billboardObj.SetOrderRuleList(orderRuleList) |
| | | return |
| | | |
| | | def GetOrderRuleList(templateID): |
| | | orderIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActHorsePetTrainBillTemp", templateID) |
| | | if not orderIpyDataList: |
| | | return |
| | | orderRuleList = [] |
| | | for ipyData in orderIpyDataList: |
| | | orderRuleList.append([ipyData.GetRank(), ipyData.GetNeedScore()]) |
| | | return orderRuleList |
| | | |
| | | def OnCrossActJoinEnd(cfgID, zoneID, ipyData): |
| | | ## 跨服活动参与结束 |
| | | __OnCrossEndAward(cfgID, zoneID, ipyData) |
| | |
| | | GameWorld.Log("=== 跨服骑宠养成活动发放榜单奖励! === cfgID=%s,zoneID=%s" % (cfgID, zoneID)) |
| | | |
| | | PersonalTemplateID = ipyData.GetPersonalTemplateID() |
| | | serverIDRangeList = ipyData.GetServerIDRangeList() |
| | | |
| | | __GiveCrossOrderAwardPersonal(cfgID, zoneID, PersonalTemplateID, ShareDefine.Def_CBT_HorsePetTrainScore) |
| | | __GiveCrossOrderAwardPersonal(cfgID, zoneID, PersonalTemplateID, ShareDefine.Def_CBT_HorsePetTrainScore, serverIDRangeList) |
| | | GameWorld.Log("=================================================================================") |
| | | return |
| | | |
| | | def __GiveCrossOrderAwardPersonal(cfgID, zoneID, templateID, billboardType): |
| | | def __GiveCrossOrderAwardPersonal(cfgID, zoneID, templateID, billboardType, serverIDRangeList): |
| | | |
| | | groupValue1 = zoneID |
| | | billboardMgr = PyDataManager.GetCrossBillboardManager() |
| | |
| | | if not orderIpyDataList: |
| | | return |
| | | |
| | | worshipType = ShareDefine.Def_WorshipType_CrossHorsePetTrain |
| | | syncNewWorshipList = [] |
| | | syncNewXiangongDict = {} |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | |
| | | needScore = ipyData.GetNeedScore() |
| | | scoreAwardEx = ipyData.GetScoreAwardEx() |
| | | scoreAwardExList = scoreAwardEx.keys() |
| | | scoreAwardExList.sort() |
| | | awardItemList = ipyData.GetAwardItemList() |
| | | xiangongID = ipyData.GetXiangongID() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | | |
| | |
| | | |
| | | orderCountTotal -= 1 |
| | | billboardIndex += 1 |
| | | |
| | | |
| | | GameXiangong.AddXiangongPlayer(xiangongID, playerID, serverIDRangeList, playerRank, syncNewXiangongDict) |
| | | GameWorship.AddWorshipPlayer(worshipType, playerRank, playerID, serverIDRangeList, syncList=syncNewWorshipList) |
| | | GameWorship.SendNewWorshipPlayer(syncNewWorshipList) |
| | | GameXiangong.SendNewXiangongPlayerToClientServer(syncNewXiangongDict) |
| | | return |
| | | |