From a1e99408a57de594046d8d12baa613619f1d316f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 11 十二月 2025 17:22:04 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(战斗去除对象池使用,释放效率有点低,且对象池对简单的类创建性能提升不高,故暂废弃;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
index 6878c26..b1d4436 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -43,7 +43,6 @@
import TurnBuff
import FBCommon
import CommFunc
-import ObjPool
import FBLogic
import random
@@ -462,14 +461,11 @@
GameWorld.DebugLogEx("回合战斗过程封包: %s, len:%s", headStr, buffLen)
self.batBuffer += CommFunc.WriteWORD("", buffLen)
self.batBuffer += packBuff
- ObjPool.GetPoolMgr().release(clientPack)
else:
GameWorld.DebugLogEx("回合战斗过程封包: %s", headStr)
# 有玩家的统一每个包单独发送,同样也支持战报统计
if self.curPlayer:
NetPackCommon.SendFakePack(self.curPlayer, clientPack)
- else:
- ObjPool.GetPoolMgr().release(clientPack)
return
def ResetOneActionUseSkillCnt(self): self._oneActionUseSkillCntDict = {}
@@ -487,7 +483,7 @@
return
def addTurnFight(self, guid, mapID, funcLineID=0, reqPlayerID=0, reqServerID=0):
- tf = ObjPool.GetPoolMgr().acquire(TurnFight, guid, mapID, funcLineID, reqPlayerID, reqServerID)
+ tf = TurnFight(guid, mapID, funcLineID, reqPlayerID, reqServerID)
if not tf:
tf = TurnFight(guid, mapID, funcLineID, reqPlayerID, reqServerID) # 一般是不可能,为了点出代码
self.turnFightDict[tf.guid] = tf
@@ -499,7 +495,6 @@
return
turnFight.exitFight()
self.turnFightDict.pop(guid, None)
- ObjPool.GetPoolMgr().release(turnFight)
return
def getTurnFight(self, guid):
@@ -1994,7 +1989,7 @@
gameObj.SetDead()
TurnBuff.DoBuffByDead(turnFight, gameObj)
- clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCTurnFightObjDead)
+ clientPack = ChPyNetSendPack.tagMCTurnFightObjDead()
clientPack.ObjID = objID
clientPack.KillerObjID = killerObjID
clientPack.SkillID = skillID
--
Gitblit v1.8.0