refactor(debug-mod): 使用原生 System 替换 QuMod
删除未使用的大型 QuMod 加载框架,改为直接注册客户端和服务端 System,并显式管理按键监听、输出包装与双端销毁。 IPC 网络线程仅负责收包,所有 ModAPI 回调由游戏线程 Update 派发,同时补充断线重连、分帧读取和幂等关闭。
This commit is contained in:
28
debug_mod/DEBUG_ENV_SCRIPT/DebugServerSystem.py
Normal file
28
debug_mod/DEBUG_ENV_SCRIPT/DebugServerSystem.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import mod.server.extraServerApi as serverApi
|
||||
|
||||
from . import IPCSystem, Lifecycle
|
||||
|
||||
|
||||
ServerSystem = serverApi.GetServerSystemCls()
|
||||
|
||||
|
||||
class DebugServerSystem(ServerSystem):
|
||||
def __init__(self, namespace, system_name):
|
||||
ServerSystem.__init__(self, namespace, system_name)
|
||||
self._initialized = False
|
||||
|
||||
def Update(self):
|
||||
if not self._initialized:
|
||||
Lifecycle.activate(self)
|
||||
IPCSystem.ON_SERVER_INIT()
|
||||
self._initialized = True
|
||||
IPCSystem.UPDATE_SERVER()
|
||||
return ServerSystem.Update(self)
|
||||
|
||||
def Destroy(self):
|
||||
try:
|
||||
IPCSystem.ON_SERVER_EXIT()
|
||||
finally:
|
||||
self._initialized = False
|
||||
Lifecycle.deactivate(self)
|
||||
Reference in New Issue
Block a user