diff --git a/core/core.py b/core/core.py index 01f98e8..cdad8bc 100644 --- a/core/core.py +++ b/core/core.py @@ -56,15 +56,14 @@ def connect_success(sock): monitor._socket.quit() # 旧的断开 monitor._temp_socket = None # 清除临时变量 - monitor.bind(sock) - monitor._init_server_() - + monitor.bind(sock) # 替换Sock + monitor.initialize() # 发送初始化消息 monitor._socket.new_server_func = functools.partial( control_server.get_ws_address, monitor._name, sock.ws_url - ) - monitor._socket.server_replace = server_replace + ) # 设置获取新服务器的函数 + monitor._socket.server_replace = server_replace # 设置开启新服务器的逻辑 def run(): diff --git a/core/monitor.py b/core/monitor.py index 4bc73b9..f37f4cf 100644 --- a/core/monitor.py +++ b/core/monitor.py @@ -116,7 +116,7 @@ class Monitor(callback.CallBack): } return payload - def _init_server_(self): + def initialize(self): payload = { "data": tostr({ 'online': self.members(),