mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Move internet check to start after server has started.
This commit is contained in:
parent
a48078ac1a
commit
635f671fd9
@ -257,20 +257,6 @@ class Server:
|
|||||||
'error': translation.translate('error', 'start-error', user_lang).format(self.name, ex)
|
'error': translation.translate('error', 'start-error', user_lang).format(self.name, ex)
|
||||||
})
|
})
|
||||||
return False
|
return False
|
||||||
if user_id:
|
|
||||||
if helper.check_internet():
|
|
||||||
loc_server_port = servers_helper.get_server_stats_by_id(self.server_id)['server_port']
|
|
||||||
if helper.check_port(loc_server_port):
|
|
||||||
websocket_helper.broadcast_user(user_id, 'send_start_reload', {
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
websocket_helper.broadcast_user(user_id, 'send_start_error', {
|
|
||||||
'error': translation.translate('error', 'closedPort', user_lang).format(loc_server_port)
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
websocket_helper.broadcast_user(user_id, 'send_start_error', {
|
|
||||||
'error': translation.translate('error', 'internet', user_lang)
|
|
||||||
})
|
|
||||||
servers_helper.set_waiting_start(self.server_id, False)
|
servers_helper.set_waiting_start(self.server_id, False)
|
||||||
out_buf = ServerOutBuf(self.process, self.server_id)
|
out_buf = ServerOutBuf(self.process, self.server_id)
|
||||||
|
|
||||||
@ -295,6 +281,20 @@ class Server:
|
|||||||
console.info("Server {} has crash detection enabled - starting watcher task".format(self.name))
|
console.info("Server {} has crash detection enabled - starting watcher task".format(self.name))
|
||||||
|
|
||||||
self.crash_watcher_schedule = schedule.every(30).seconds.do(self.detect_crash).tag(self.name)
|
self.crash_watcher_schedule = schedule.every(30).seconds.do(self.detect_crash).tag(self.name)
|
||||||
|
if user_id:
|
||||||
|
if helper.check_internet():
|
||||||
|
loc_server_port = servers_helper.get_server_stats_by_id(self.server_id)['server_port']
|
||||||
|
if helper.check_port(loc_server_port):
|
||||||
|
websocket_helper.broadcast_user(user_id, 'send_start_reload', {
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
websocket_helper.broadcast_user(user_id, 'send_start_error', {
|
||||||
|
'error': translation.translate('error', 'closedPort', user_lang).format(loc_server_port)
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
websocket_helper.broadcast_user(user_id, 'send_start_error', {
|
||||||
|
'error': translation.translate('error', 'internet', user_lang)
|
||||||
|
})
|
||||||
|
|
||||||
def stop_threaded_server(self):
|
def stop_threaded_server(self):
|
||||||
self.stop_server()
|
self.stop_server()
|
||||||
|
Loading…
Reference in New Issue
Block a user