Stability improvements

This commit is contained in:
Samuel Sloniker 2021-07-10 14:28:36 -07:00
parent 1fc8aa4505
commit 9dc8030d86
2 changed files with 3 additions and 2 deletions

View File

@ -26,6 +26,7 @@ function setup() {
type = e.data.split('%')[0] type = e.data.split('%')[0]
if (type == 'ver') { if (type == 'ver') {
ws.send('pass ' + localStorage.getItem('password')) ws.send('pass ' + localStorage.getItem('password'))
setInterval(function(){ws.send('ack')}, 3000)
} else if ( type == 'pic' ) { } else if ( type == 'pic' ) {
pos = e.data.split('%')[1] pos = e.data.split('%')[1]
x = Number(pos.split('x')[0]) x = Number(pos.split('x')[0])
@ -67,7 +68,6 @@ function setup() {
ws.onopen = function(e) { ws.onopen = function(e) {
ws.send('maxver 1') ws.send('maxver 1')
} }
setInterval(function(){ws.send('ack')}, 3000)
} }

View File

@ -108,6 +108,8 @@ class HCRAServer(tornado.websocket.WebSocketHandler):
self.close() self.close()
return return
self.has_auth = True
try: try:
self.client = Client(self) self.client = Client(self)
except DisconnectError as e: except DisconnectError as e:
@ -129,7 +131,6 @@ class HCRAServer(tornado.websocket.WebSocketHandler):
self.is_open = True self.is_open = True
self.client.ack() self.client.ack()
self.has_auth = True
else: else:
if action == 'ack': if action == 'ack':
self.client.good = True self.client.good = True