From bd9dce2d66b5086712596b8dac6d9116be65bafd Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 11 十二月 2025 16:53:47 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(去除常规功能封包对象池使用;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ObjPool.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ObjPool.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ObjPool.py
index 6f75602..b410500 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ObjPool.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ObjPool.py
@@ -50,6 +50,7 @@
     
     def acquire(self, obj_class, *args, **kwargs):
         """获取对象并记录其所属池"""
+        return obj_class(*args, **kwargs) # 关闭对象池
         if obj_class not in self._pools:
             # 如果池不存在,自动创建大小为0的无限制池
             self.create_pool(obj_class, 0)
@@ -78,6 +79,7 @@
     
     def release(self, obj):
         """释放对象并递归释放其嵌套对象池对象"""
+        return # 释放对象效率有点低,暂时关闭对象池,后续优化
         obj_id = id(obj)
         
         # 检查是否正在递归释放中
@@ -330,9 +332,10 @@
         PyGameData.g_objPoolMgr = poolMgr
     return poolMgr
 
-def OnMinute():
+def OnMinute(curTime):
     """每分钟执行,输出对象池状态"""
-    GetPoolMgr().pool_status()
+    if curTime.minute == 5: # 每小时的5分输出一次
+        GetPoolMgr().pool_status()
     return
 
 ## 使用示例

--
Gitblit v1.8.0