From 1fd883c95ef2a3c8386648319d9b2acb4676c92c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 20 三月 2025 18:57:24 +0800
Subject: [PATCH] 10263 【英文】【BT】【GM】后端支持NPC仿真实玩家战斗和快速战斗(优化释放被动UsePassive计数,防止可能引起的死循环;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py | 3 ++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py | 2 +-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py | 10 +++++++++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py | 1 +
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py
index e927225..4430e63 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py
@@ -516,6 +516,7 @@
'''
playerID = 0
+ curTime = int(time.time())
if curPlayer:
if GameWorld.IsCrossServer():
GameWorld.DebugLog("跨服服务器中不允许玩家镜像战斗请求!", playerID)
@@ -527,7 +528,6 @@
if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MirrorBattleID):
GameWorld.DebugLog("镜像战斗场景中,无法请求!", playerID)
return
- curTime = int(time.time())
# 请求cd验证
requestTime = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MirrorBattleTime)
if requestTime and (curTime - requestTime) <= 20: # 20秒内不重复请求
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
index 10a3eea..df6e242 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
@@ -296,6 +296,7 @@
def __DoClientUseSkillEx(curPlayer, skillData, tick):
#使用技能结果
useSkillResult = False
+ SkillCommon.ClearUsingPassiveSkill(curPlayer)
#---无目标类技能---
aimType = SkillShell.GetSkillFireAim(skillData)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py
index a7fa34e..50c5d8a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py
@@ -2006,7 +2006,15 @@
return attacker.GetDictByKey("UsePassive")
def SetUsingPassiveSkill(attacker, value):
- return attacker.SetDict("UsePassive", value)
+ if value > 0:
+ attacker.SetDict("UsePassive", attacker.GetDictByKey("UsePassive") + 1)
+ else:
+ attacker.SetDict("UsePassive", max(0, attacker.GetDictByKey("UsePassive") - 1))
+ return
+
+def ClearUsingPassiveSkill(attacker):
+ attacker.SetDict("UsePassive", 0)
+ return
def CheckPlayerAtkInterval(curPlayer, skillTypeID, tick):
''' 验证是否基本攻击间隔 '''
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
index f4c47f4..2208fd5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -3807,7 +3807,8 @@
skillID = curSkill.GetSkillID()
PyGameData.g_singleAtkRecordList.append([atkID, tagID, skillID])
#GameWorld.DebugLog("PyGameData.g_singleAtkRecordList: %s, %s" % (len(PyGameData.g_singleAtkRecordList), PyGameData.g_singleAtkRecordList))
- if len(PyGameData.g_singleAtkRecordList) >= 50:
+ #已修复SetUsingPassiveSkill计数问题,这个记录还是先保留,观察一段时间后没问题可去除
+ if len(PyGameData.g_singleAtkRecordList) >= 100:
mapID = GameWorld.GetMap().GetMapID()
GameWorld.SendGameError("MirrorAIAtkDepthError", "mapID=%s, %s" % (mapID, PyGameData.g_singleAtkRecordList))
PyGameData.g_singleAtkRecordList = None
--
Gitblit v1.8.0