hxp
2020-03-02 7a58a47083cb8c7920733c8378ca41964e9330e4
8389 【后端开发】天星塔挑战榜
9个文件已修改
3个文件已添加
233 ■■■■■ 已修改文件
PyNetPack @ 5d2c94 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldSkyTower.py 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetSkyTower.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SkyTower.py 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_SkyTower.py 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PyNetPack
New file
@@ -1 +1 @@
Subproject commit 0000000000000000000000000000000000000000
Subproject commit 5d2c941bb636d7725df79f71f03afb2375bb2db8
ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
@@ -568,6 +568,7 @@
            ShareDefine.Def_BT_FightPower_Horse         : 100,           #坐骑战斗力总榜
            ShareDefine.Def_BT_FightPower_Pet           : 100,           #宠物总战力榜
            ShareDefine.Def_BT_TrialTower               : 100,           #天神之塔榜
            ShareDefine.Def_BT_SkyTower                 : 100,           #天星塔榜
            ShareDefine.Def_BT_OffLineEfficient         : 100,           #脱机效率榜
            ShareDefine.Def_BT_Realm                    : 100,           #境界榜
            ShareDefine.Def_BT_TotalRecharge            : 100,           #充值榜
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldSkyTower.py
New file
@@ -0,0 +1,84 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GameWorldSkyTower
#
# @todo:天星塔
# @author hxp
# @date 2020年03月02日
# @version 1.0
#
# 详细描述: 天星塔
#
#-------------------------------------------------------------------------------
#"""Version = 2020年03月02日 20:00"""
#-------------------------------------------------------------------------------
import GameWorld
import ShareDefine
import PlayerUniversalGameRec
import time
def OnPlayerLogin(curPlayer):
    PlayerUniversalGameRec.SendUniversalGameRecInfo(curPlayer, ShareDefine.Def_UniversalGameRecType_SkyTowerPassPlayer)
    return
def __GetPassPlayerRecDataByFloorID(floorID):
    ## 获取过关层记录数据
    recTypeListData = GameWorld.GetUniversalRecMgr().GetTypeList(ShareDefine.Def_UniversalGameRecType_SkyTowerPassPlayer)
    recData = None
    for index in xrange(recTypeListData.Count()):
        universalRecData = recTypeListData.At(index)
        if universalRecData.GetValue1() == floorID:
            recData = universalRecData
            break
    return recData
def MapServer_SkyTowerInfo(msgList):
    ## 天星塔过关
    msgType, msgData = msgList
    # 过关
    if msgType == "ServerChallengePass":
        __OnServerChallengePass(msgData)
        return
    # 领奖
    if msgType == "ServerChallengeReward":
        floorID = msgData[0]
        recData = __GetPassPlayerRecDataByFloorID(floorID)
        isPass = 1 if recData else 0
        return msgList + [isPass]
    return
def __OnServerChallengePass(msgData):
    ## 全服挑战层过关
    floorID, playerID, playerName, job, playerLV, realmLV = msgData
    recData = __GetPassPlayerRecDataByFloorID(floorID)
    if recData:
        GameWorld.DebugLog("该天星塔已经有人先过关了,不处理!floorID=%s" % floorID, playerID)
        return
    GameWorld.DebugLog("新增天星塔全服挑战层过关记录!floorID=%s" % floorID, playerID)
    recTypeListData = GameWorld.GetUniversalRecMgr().GetTypeList(ShareDefine.Def_UniversalGameRecType_SkyTowerPassPlayer)
    recData = recTypeListData.AddRec()
    recData.SetTime(int(time.time()))
    recData.SetValue1(floorID)
    recData.SetValue2(playerID)
    recData.SetValue3(playerLV)
    recData.SetValue4(job)
    recData.SetValue5(realmLV)
    recData.SetStrValue1(playerName)
    # 广播单条数据
    PlayerUniversalGameRec.SendUniversalGameRecSingle(None, recData)
    return
ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
@@ -56,6 +56,7 @@
import GameWorldActionControl
import GameWorldFamilyWar
import PlayerFBHelpBattle
import GameWorldSkyTower
import GMT_CTG
import PyGameData
import GMShell
@@ -190,6 +191,8 @@
        PlayerHorsePetBoss.OnLogin(curPlayer)
        #协助
        PlayerAssist.OnPlayerLogin(curPlayer, False)
        #天星塔
        GameWorldSkyTower.OnPlayerLogin(curPlayer)
        GMT_CTG.OnPlayerLogin(curPlayer)
        
    else:
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
@@ -73,6 +73,7 @@
import NetPackCommon
import AuctionHouse
import PlayerFairyDomain
import GameWorldSkyTower
import GameWorldItem
import PlayerAssist
@@ -927,6 +928,13 @@
        if ret == None:
            return
        resultName = '%s' % ret
    # 天星塔
    if callName == "SkyTower":
        ret = GameWorldSkyTower.MapServer_SkyTowerInfo(eval(resultName))
        if ret == None:
            return
        resultName = '%s' % ret
        
#    # 战盟仓库
#    if callName == "FamilyStore":
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -653,8 +653,10 @@
    Def_BT_Campaign_StarLV,                   #升星等级(开服活动榜) 25
    Def_BT_Campaign_Wash,                     #洗练战力(开服活动榜)
    
    Def_BT_SkyTower,                          #天星塔榜
    Def_BT_Max,                               #排行榜最大类型
) = range(0, 26 + 2)
) = range(0, 27 + 2)
    
#职业对应战力排行榜类型
JobFightPowerBillboardDict = {
@@ -666,6 +668,7 @@
#排行榜Value1存储境界信息的榜单列表
BTValue1_OfficialRankList = [Def_BT_FightPower, Def_BT_FightPower_Warrior, Def_BT_FightPower_Wizard, Def_BT_FightPower_Assassin, 
                             Def_BT_LV, Def_BT_FightPower_Horse, Def_BT_FightPower_Pet, Def_BT_TrialTower, Def_BT_OffLineEfficient,
                             Def_BT_SkyTower,
                             ]
##---比率---
@@ -1045,7 +1048,7 @@
                                Def_UniversalGameRecType_YesterdayPlayerLVInfo,#昨日活跃玩家等级信息7
                                Def_UniversalGameRecType_StoreServerCntRecord,  #商店全服购买记录 8,
                                Def_UniversalGameRecType_FBHelpBattleCheckInPlayer, #助战玩家登记记录9
                                Def_UniversalGameRecType_10,
                                Def_UniversalGameRecType_SkyTowerPassPlayer, #天星塔过关玩家记录10
                                Def_UniversalGameRecType_ZhuXianBossRecord, #诛仙BOSS结算记录11
                                Def_UniversalGameRecType_LuckyTreasure, #幸运鉴宝大奖记录12
                                Def_UniversalGameRecType_FairyDomain, #缥缈仙域事件次数记录13
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3635,6 +3635,7 @@
Def_Player_Dict_TrialTower_LastDayPassLV = "Tower_LastDayPassLV"  # 试炼之塔昨日通关层数
#天星塔
Def_Player_Dict_SkyTowerFloor = "SkyTowerFloor"  # 天星塔已通关层数
Def_Player_Dict_SkyTowerChallengeRewardRecord = "SkyTowerChallengeRewardRecord"  # 天星塔全服挑战层领奖记录,按奖励记录位二进制存储
#古神禁地
Def_Player_Dict_GodArea_Anger = "GodArea_Anger"  # 古神禁地怒气值
@@ -5298,7 +5299,8 @@
Def_RewardType_HistoryChargeAward, #历史累计充值领取28
Def_RewardType_DayFreeGoldGift, #每日免费直购礼包29
Def_RewardType_ActivityPlace, #活跃放置奖励30
)= range(31)
Def_RewardType_SkyTowerServerChallengeReward, #天星塔全服挑战层领奖31
)= range(32)
#boss复活相关活动定义
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetSkyTower.py
@@ -32,6 +32,7 @@
#  @return None
def OnExec(curPlayer, cmdList):
    if len(cmdList) != 1:
        GameWorld.DebugAnswer(curPlayer, "SetSkyTower 层")
        return
    fbLevel = cmdList[0]
    GameLogic_SkyTower.SetSkyTowerCurfloorID(curPlayer, fbLevel)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SkyTower.py
@@ -30,6 +30,7 @@
import ChConfig
import ChPlayer
import PlayerActivity
import PlayerBillboard
g_runeTypeDict = {}
@@ -74,6 +75,7 @@
    ttInfo = ChPyNetSendPack.tagMCSkyTowerInfo()
    ttInfo.Clear()
    ttInfo.Floor = __GetSkyTowerCurFloor(curPlayer)
    ttInfo.ServerRewardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_SkyTowerChallengeRewardRecord)
    NetPackCommon.SendFakePack(curPlayer, ttInfo)
    return
@@ -321,7 +323,6 @@
    if not ipyData:
        return
    
    if ipyData.GetIsNotify():
        #IPY_Data = IpyGameDataPY.IPY_Data()
        #maxLevel = IPY_Data.GetRuneTowerByIndex(IPY_Data.GetRuneTowerCount()-1).GetID()
@@ -339,6 +340,21 @@
    
    SyncSkyTowerInfo(curPlayer) # 同步最新关卡信息
    __SetFBToFreeTime(tick)
    if floorID >= 10:
        PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_SkyTower, floorID)
    # 全服目标
    ipyDataServer = IpyGameDataPY.GetIpyGameDataNotLog("SkyTowerServerChallenge", floorID)
    if ipyDataServer:
        playerID = curPlayer.GetPlayerID()
        playerName = curPlayer.GetPlayerName()
        job = curPlayer.GetJob()
        playerLV = curPlayer.GetLV()
        realmLV = curPlayer.GetOfficialRank()
        msgInfo = str(["ServerChallengePass", [floorID, playerID, playerName, job, playerLV, realmLV]])
        GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(playerID, 0, 0, "SkyTower", msgInfo, len(msgInfo))
    return
@@ -422,3 +438,47 @@
    StartfloorID(curPlayer, floorID, tick)
    return
def OnGetSkyTowerServerChallengeReward(curPlayer, floorID):
    ## 领取全服挑战层奖励
    playerID = curPlayer.GetPlayerID()
    ipyData = IpyGameDataPY.GetIpyGameData("SkyTowerServerChallenge", floorID)
    if not ipyData:
        return
    recordIndex = ipyData.GetRewardRecordIndex()
    rewardInfo = ipyData.GetReward()
    rewardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_SkyTowerChallengeRewardRecord)
    if rewardRecord & pow(2, recordIndex):
        GameWorld.DebugLog("天星塔全服挑战层已领奖!floorID=%s,recordIndex=%s,rewardRecord=%s" % (floorID, recordIndex, rewardRecord))
        return
    ipyData.GetRewardRecordIndex()
    msgInfo = str(["ServerChallengeReward", [floorID, recordIndex, rewardInfo]])
    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(playerID, 0, 0, "SkyTower", msgInfo, len(msgInfo))
    return
def GameServer_SkyTowerInfo(curPlayer, resultList):
    ## GameServer 返回信息
    msgType, msgData = resultList[:2]
    if msgType == "ServerChallengeReward":
        isPass = resultList[2]
        floorID, recordIndex, rewardInfo = msgData
        if not isPass:
            return
        rewardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_SkyTowerChallengeRewardRecord)
        if rewardRecord & pow(2, recordIndex):
            GameWorld.DebugLog("返回时天星塔全服挑战层已领奖!floorID=%s,recordIndex=%s,rewardRecord=%s" % (floorID, recordIndex, rewardRecord))
            return
        updRewardRecord = rewardRecord | pow(2, recordIndex)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_SkyTowerChallengeRewardRecord, updRewardRecord)
        SyncSkyTowerInfo(curPlayer)
        giveItemList = [[itemID, itemCnt, 0] for itemID, itemCnt in rewardInfo.items()]
        event = ["SKYTowerServerChallengeReward", False, {"floorID":floorID}]
        ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList, None, event)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -67,6 +67,7 @@
import PlayerFreeGoods
import PlayerRecover
import GameLogic_IceLode
import GameLogic_SkyTower
import PlayerEquipDecompose
import PlayerGreatMaster
import PlayerGatherSoul
@@ -5374,6 +5375,9 @@
    #历史累计充值领取
    elif rewardType == ChConfig.Def_RewardType_HistoryChargeAward:
        PlayerGoldGift.OnGetHistoryRechargeAward(curPlayer, dataEx)
    #天星塔全服挑战层领奖
    elif rewardType == ChConfig.Def_RewardType_SkyTowerServerChallengeReward:
        GameLogic_SkyTower.OnGetSkyTowerServerChallengeReward(curPlayer, dataEx)
    return
    
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_SkyTower.py
New file
@@ -0,0 +1,50 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Player.RemoteQuery.GY_Query_SkyTower
#
# @todo:天星塔
# @author hxp
# @date 2020年03月02日
# @version 1.0
#
# 详细描述: 天星塔
#
#-------------------------------------------------------------------------------
#"""Version = 2020年03月02日 20:00"""
#-------------------------------------------------------------------------------
import GameWorld
import GameLogic_SkyTower
#---------------------------------------------------------------------
#逻辑实现
## 请求逻辑
#  @param query_Type 请求类型
#  @param query_ID 请求的玩家ID
#  @param packCMDList 发包命令 [ ]
#  @param tick 当前时间
#  @return "True" or "False" or ""
#  @remarks 函数详细说明.
def DoLogic(query_Type, query_ID, packCMDList, tick):
    return ""
#---------------------------------------------------------------------
#执行结果
## 执行结果
#  @param curPlayer 发出请求的玩家
#  @param callFunName 功能名称
#  @param funResult 查询的结果
#  @param tick 当前时间
#  @return None
#  @remarks 函数详细说明.
def DoResult(curPlayer, callFunName, funResult, tick):
    GameWorld.DebugLog("GY_Query_SkyTower funResult=%s" % str(funResult))
    if funResult == "":
        return
    GameLogic_SkyTower.GameServer_SkyTowerInfo(curPlayer, eval(funResult))
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -653,8 +653,10 @@
    Def_BT_Campaign_StarLV,                   #升星等级(开服活动榜) 25
    Def_BT_Campaign_Wash,                     #洗练战力(开服活动榜)
    
    Def_BT_SkyTower,                          #天星塔榜
    Def_BT_Max,                               #排行榜最大类型
) = range(0, 26 + 2)
) = range(0, 27 + 2)
    
#职业对应战力排行榜类型
JobFightPowerBillboardDict = {
@@ -666,6 +668,7 @@
#排行榜Value1存储境界信息的榜单列表
BTValue1_OfficialRankList = [Def_BT_FightPower, Def_BT_FightPower_Warrior, Def_BT_FightPower_Wizard, Def_BT_FightPower_Assassin, 
                             Def_BT_LV, Def_BT_FightPower_Horse, Def_BT_FightPower_Pet, Def_BT_TrialTower, Def_BT_OffLineEfficient,
                             Def_BT_SkyTower,
                             ]
##---比率---
@@ -1045,7 +1048,7 @@
                                Def_UniversalGameRecType_YesterdayPlayerLVInfo,#昨日活跃玩家等级信息7
                                Def_UniversalGameRecType_StoreServerCntRecord,  #商店全服购买记录 8,
                                Def_UniversalGameRecType_FBHelpBattleCheckInPlayer, #助战玩家登记记录9
                                Def_UniversalGameRecType_10,
                                Def_UniversalGameRecType_SkyTowerPassPlayer, #天星塔过关玩家记录10
                                Def_UniversalGameRecType_ZhuXianBossRecord, #诛仙BOSS结算记录11
                                Def_UniversalGameRecType_LuckyTreasure, #幸运鉴宝大奖记录12
                                Def_UniversalGameRecType_FairyDomain, #缥缈仙域事件次数记录13