diff --git a/client/js/main.js b/client/js/main.js index b74131a..b56cf60 100644 --- a/client/js/main.js +++ b/client/js/main.js @@ -26,6 +26,7 @@ function setup() { type = e.data.split('%')[0] if (type == 'ver') { ws.send('pass ' + localStorage.getItem('password')) + setInterval(function(){ws.send('ack')}, 3000) } else if ( type == 'pic' ) { pos = e.data.split('%')[1] x = Number(pos.split('x')[0]) @@ -67,7 +68,6 @@ function setup() { ws.onopen = function(e) { ws.send('maxver 1') } - setInterval(function(){ws.send('ack')}, 3000) } diff --git a/server/wss.py b/server/wss.py index b1c56b8..ea09bd1 100644 --- a/server/wss.py +++ b/server/wss.py @@ -108,6 +108,8 @@ class HCRAServer(tornado.websocket.WebSocketHandler): self.close() return + self.has_auth = True + try: self.client = Client(self) except DisconnectError as e: @@ -129,7 +131,6 @@ class HCRAServer(tornado.websocket.WebSocketHandler): self.is_open = True self.client.ack() - self.has_auth = True else: if action == 'ack': self.client.good = True