| | |
| | |
|
| | | # 进行匹配
|
| | | 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赛区
|
| | |
| | | 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结算信息
|
| | |
| | | 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)
|