diff --git a/assets/js/sumorobot.js b/assets/js/sumorobot.js index 3476997..3083729 100755 --- a/assets/js/sumorobot.js +++ b/assets/js/sumorobot.js @@ -60,6 +60,8 @@ Sumorobot.prototype.connect = function() { /* when the WebSocket gets connected */ this.websocket.onopen = function(evt) { console.log("INFO websocket connected"); + // send authentication message + sumorobot.send('{"setID": "browser-' + robotId + '@00000514", "passwd": "salakala"}'); /* setup a timer to ping the robot */ self.watchdogTimer = setInterval(function() { /* send a ping to the robot */ @@ -561,7 +563,6 @@ window.onload = function() { } /* connect to the selected robots WebSocket */ sumorobot = new Sumorobot("ws://" + robotServer); - sumorobot.send('{"setID": "browser-' + robotId + '@00000514", "passwd": "salakala"}'); /* connect to the other block highlight WebSocket */ /*blockHighlight = new WebSocket("ws://" + robotServer + ":80/p2p/browser/" + robotId + "-highlight/"); // when there is a message from the WebSocket