From c63ffd10aecb12b2e09dae603cf9a0f824f6482c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 10 十二月 2025 15:46:15 +0800
Subject: [PATCH] 16 卡牌服务端(合成目标物品与材料物品不在同一背包时支持合成;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ObjPool.py | 8 ++++++--
1 files changed, 6 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 062659f..1b1b21b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ObjPool.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ObjPool.py
@@ -93,6 +93,9 @@
visited = set([obj_id]) # 初始化已访问集合
try:
+ ### 回收前处理,主要处理一些其他不需要释放的对象池对象,防止被连同误回收
+ if hasattr(obj, 'onRelease'):
+ obj.onRelease()
# 1. 递归释放嵌套对象池对象
self._recursive_release(obj, visited)
# 2. 释放当前对象
@@ -327,9 +330,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