From 7f73fceed35b6b716da40c183812fd34ffb19e72 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 05 七月 2019 15:51:51 +0800
Subject: [PATCH] 7874 【主干】【后端】跨服匹配机器人段位限制变更(去除上榜条件限制)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py | 49 +++++++++++++++++++++++++++++--------------------
1 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py
index 8590cf6..a840f60 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py
@@ -238,17 +238,9 @@
# 进行匹配
if requestType == 1:
- dayFreeMatchCountMax = IpyGameDataPY.GetFuncCfg("CrossRealmPKMatchCount", 1)
- if dayFreeMatchCountMax:
- todayPKCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayPKCount)
- todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayBuyCount)
- todayItemAddCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_ItemAddCount)
-
- if todayPKCount >= (dayFreeMatchCountMax + todayBuyCount + todayItemAddCount):
- GameWorld.DebugLog("PK次数不足,无法发起匹配! todayPKCount=%s >= (dayFreeMatchCountMax=%s + todayBuyCount=%s + todayItemAddCount=%s)"
- % (todayPKCount, dayFreeMatchCountMax, todayBuyCount, todayItemAddCount), playerID)
- return
-
+ if not CheckHavePKCount(curPlayer):
+ return
+
dataMsg = {
"seasonID":GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID), # 赛季ID
"pkZoneID":GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID), # PK赛区
@@ -276,6 +268,20 @@
GameWorld.Log(" 发送取消匹配到GameServer sendMsg=%s" % str(sendMsg), playerID)
return
+
+def CheckHavePKCount(curPlayer):
+ ## 检查是否有PK次数
+ dayFreeMatchCountMax = IpyGameDataPY.GetFuncCfg("CrossRealmPKMatchCount", 1)
+ if dayFreeMatchCountMax:
+ todayPKCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayPKCount)
+ todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayBuyCount)
+ todayItemAddCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_ItemAddCount)
+
+ if todayPKCount >= (dayFreeMatchCountMax + todayBuyCount + todayItemAddCount):
+ GameWorld.DebugLog("PK次数不足,无法发起匹配! todayPKCount=%s >= (dayFreeMatchCountMax=%s + todayBuyCount=%s + todayItemAddCount=%s)"
+ % (todayPKCount, dayFreeMatchCountMax, todayBuyCount, todayItemAddCount), curPlayer.GetPlayerID())
+ return False
+ return True
def CrossServerMsg_PKOverInfo(curPlayer, overInfo):
## 收到跨服服务器的PK结算信息
@@ -369,15 +375,18 @@
curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
playerID = curPlayer.GetPlayerID()
isWinner = clientData.IsWin
- billboardCfg = IpyGameDataPY.GetFuncEvalCfg("CrossRealmPKCfg", 1, [])
- if not billboardCfg or len(billboardCfg) != 2:
- GameWorld.ErrLog("跨服竞技场排行榜配置错误!")
- return
- danLVLimit = billboardCfg[1]
- playerDanLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_DanLV)
- #策划设计该机器人目的为了前期体验,这里只验证是否超过上榜段位即可,即使作弊也不管,只要有次数即可
- if playerDanLV >= danLVLimit:
- GameWorld.ErrLog("该段位不允许与机器人匹配PK!playerDanLV=%s,danLVLimit=%s" % (playerDanLV, danLVLimit), playerID)
+# billboardCfg = IpyGameDataPY.GetFuncEvalCfg("CrossRealmPKCfg", 1, [])
+# if not billboardCfg or len(billboardCfg) != 2:
+# GameWorld.ErrLog("跨服竞技场排行榜配置错误!")
+# return
+# danLVLimit = billboardCfg[1]
+# playerDanLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_DanLV)
+# #策划设计该机器人目的为了前期体验,这里只验证是否超过上榜段位即可,即使作弊也不管,只要有次数即可
+# if playerDanLV >= danLVLimit:
+# GameWorld.ErrLog("该段位不允许与机器人匹配PK!playerDanLV=%s,danLVLimit=%s" % (playerDanLV, danLVLimit), playerID)
+# return
+
+ if not CheckHavePKCount(curPlayer):
return
zoneID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID)
--
Gitblit v1.8.0