hxp
2019-07-10 1f8acf4823f6d7c2e19f0db8bd11d3b07d168a5c
7954 【主干】【后端】跨服PVP匹配机器人规则优化
5个文件已修改
87 ■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmMsg.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmMsg.py
@@ -68,6 +68,9 @@
        if msgType == ShareDefine.ClientServerMsg_PKMatch:
            CrossRealmPK.ClientServerMsg_PKMatch(serverGroupID, msgData, tick)
            
        elif msgType == ShareDefine.ClientServerMsg_PKScore:
            CrossRealmPK.ClientServerMsg_PKScore(serverGroupID, msgData, tick)
        elif msgType == ShareDefine.ClientServerMsg_PKCancel:
            CrossRealmPK.ClientServerMsg_PKCancel(msgData, tick)
            
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py
@@ -241,10 +241,12 @@
        return
    maxCount = min(2000, maxCount)
    upBillboardList = []
    if winner:
    if winner.danLV >= danLVLimit:
        upBillboardList.append(winner)
    else:
        GameWorld.DebugLog("    段位不足,无法上榜! winnerDanLV=%s < danLVLimit=%s" % (winner.danLV, danLVLimit), winner.playerID)
    if loser:
    if loser.danLV >= danLVLimit:
        upBillboardList.append(loser)
    else:
@@ -315,6 +317,40 @@
            
    return
def ClientServerMsg_PKScore(serverGroupID, playerInfoDict, tick):
    ## 收到子服同步的PK积分信息,子服可能直接更新积分,比如与机器人PK等
    if not GameWorld.IsCrossServer():
        GameWorld.ErrLog("非跨服服务器不处理跨服PK匹配请求!")
        return
    seasonID = playerInfoDict["seasonID"] # 赛季ID
    pkZoneID = playerInfoDict["pkZoneID"] # 所属赛区
    accID = playerInfoDict["accID"] # 角色账号
    playerID = playerInfoDict["playerID"] # 角色ID
    playerName = playerInfoDict["playerName"] # 玩家名
    job = playerInfoDict["playerJob"] # ְҵ
    fightPower = playerInfoDict["fightPower"] # 战斗力
    realmLV = playerInfoDict["realmLV"] # 境界
    pkScore = playerInfoDict["pkScore"] # 当前积分
    danLV = playerInfoDict["danLV"] # 当前段位
    pkPlayer = CrossPKPlayer()
    pkPlayer.accID = accID
    pkPlayer.playerID = playerID
    pkPlayer.playerName = playerName
    pkPlayer.playerJob = job
    pkPlayer.pkScore = pkScore
    pkPlayer.danLV = danLV
    pkPlayer.fightPower = fightPower
    pkPlayer.realmLV = realmLV
    pkPlayer.serverGroupID = serverGroupID
    pkPlayer.pkZoneID = pkZoneID
    pkPlayer.seasonID = seasonID
    UpdateCrossPKBillboard(pkZoneID, seasonID, pkPlayer, None)
    return
#// C0 01 查看跨服竞技场赛季排行榜 #tagCGViewCrossPKBillboard
#
#struct    tagCGViewCrossPKBillboard
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -1207,6 +1207,7 @@
ClientServerMsg_GMCMD = "GMCMD"                         # GM命令
ClientServerMsg_ViewPlayerCache = "ViewPlayerCache"     # 查看跨服玩家信息
ClientServerMsg_PKMatch = "PKMatch"                     # 跨服PK匹配
ClientServerMsg_PKScore = "PKScore"                     # 跨服PK同步积分到跨服服务器(某些情况会在本服加积分,如与机器人PK)
ClientServerMsg_PKCancel = "PKCancel"                   # 跨服PK取消匹配
ClientServerMsg_PKPrepareOK = "PKPrepareOK"             # 跨服PK准备完毕
ClientServerMsg_PKBillboard = "PKBillboard"             # 跨服PK排行榜
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py
@@ -412,6 +412,16 @@
    danLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_DanLV)
    cWinCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_CWinCount)
    
    if GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonState) != 1:
        GameWorld.Log("OnCrossRealmPKRobotOver 跨服赛季未开启,不可进行机器人结算!", playerID)
        overPack = ChPyNetSendPack.tagGCCrossRealmPKOverInfo()
        overPack.AddScore = 0
        overPack.Score = pkScore
        overPack.DanLV = danLV
        overPack.CWinCnt = cWinCount
        NetPackCommon.SendFakePack(curPlayer, overPack)
        return
    ondayScore = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_OnDayScore)
    dayScore = max(0, pkScore - ondayScore) # 今日已获得积分,正积分
    
@@ -452,29 +462,23 @@
    overPack.CWinCnt = cWinCount
    NetPackCommon.SendFakePack(curPlayer, overPack)
    
    # 通知跨服更新榜单积分数据
    # 如果能上榜的,则通知跨服更新榜单积分数据
    billboardCfg = IpyGameDataPY.GetFuncEvalCfg("CrossRealmPKCfg", 1, [])
    if billboardCfg and len(billboardCfg) > 1 or danLV >= billboardCfg[1]:
        pass
#        dataMsg = {
#                   "seasonID":seasonID,
#                   "pkZoneID":zoneID,
#                   "accID":curPlayer.GetAccID(),
#                   "playerID":playerID,
#                   "playerName":CrossRealmPlayer.GetCrossPlayerName(curPlayer),
#                   "playerJob":curPlayer.GetJob(),
#                   "playerLV":curPlayer.GetLV(),
#                   "maxHP":curPlayer.GetMaxHP(),
#                   "maxProDef":PlayerControl.GetMaxProDef(curPlayer),
#                   "fightPower":curPlayer.GetFightPower(),
#                   "realmLV":curPlayer.GetOfficialRank(),
#                   "pkScore":pkScore,
#                   "danLV":danLV,
#                   "cWinCount":cWinCount,
#                   "ondayScore":curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_OnDayScore), # 过天时的积分
#                   }
#        GameWorld.SendMsgToCrossServer(ShareDefine.ClientServerMsg_PKMatch, dataMsg)
#        GameWorld.Log("    更新积分到跨服服务器 dataMsg=%s" % str(dataMsg), playerID)
        dataMsg = {
                   "seasonID":seasonID,
                   "pkZoneID":zoneID,
                   "accID":curPlayer.GetAccID(),
                   "playerID":playerID,
                   "playerName":CrossRealmPlayer.GetCrossPlayerName(curPlayer),
                   "playerJob":curPlayer.GetJob(),
                   "fightPower":curPlayer.GetFightPower(),
                   "realmLV":curPlayer.GetOfficialRank(),
                   "pkScore":pkScore,
                   "danLV":danLV,
                   }
        GameWorld.SendMsgToCrossServer(ShareDefine.ClientServerMsg_PKScore, dataMsg)
        GameWorld.Log("    更新积分到跨服服务器 dataMsg=%s" % str(dataMsg), playerID)
        
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -1207,6 +1207,7 @@
ClientServerMsg_GMCMD = "GMCMD"                         # GM命令
ClientServerMsg_ViewPlayerCache = "ViewPlayerCache"     # 查看跨服玩家信息
ClientServerMsg_PKMatch = "PKMatch"                     # 跨服PK匹配
ClientServerMsg_PKScore = "PKScore"                     # 跨服PK同步积分到跨服服务器(某些情况会在本服加积分,如与机器人PK)
ClientServerMsg_PKCancel = "PKCancel"                   # 跨服PK取消匹配
ClientServerMsg_PKPrepareOK = "PKPrepareOK"             # 跨服PK准备完毕
ClientServerMsg_PKBillboard = "PKBillboard"             # 跨服PK排行榜