29 lines
752 B
Python
29 lines
752 B
Python
|
|
# -*- 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)
|