sending message in correct format

This commit is contained in:
Eric Levin 2015-11-16 12:47:16 -08:00
parent 4e9be8cdd0
commit eca11d3a99
2 changed files with 13 additions and 9 deletions

View file

@ -1,18 +1,22 @@
var HOST = "localhost:5000" // var HOST = "localhost:5000"
// var HOST = "https://thawing-hamlet-8433.herokuapp.com/"; var HOST = "desolate-bastion-1742.herokuapp.com";
var client = new WebSocket("ws://" + HOST); var client = new WebSocket("ws://" + HOST);
client.onerror - function() { var score = 1;
console.log("CONNECTION ERROR"); var username = GlobalServices.username;
client.onerror = function() {
print("CONNECTION ERROR");
} }
print("TESSST"); print("TESSST");
client.onopen = function() { client.onopen = function() {
print("Web Socket client connected"); print("Web Socket client connected");
function sendMessage() { function sendMessage() {
// if(client.readyState === client.OPEN) { if(client.readyState === client.OPEN) {
client.send("HEY");
Script.setTimeout(sendMessage, 1000); Script.setTimeout(sendMessage, 3000);
// } client.send(JSON.stringify({id: score, username: username, score: score}))
score++;
}
} }
sendMessage(); sendMessage();
} }

View file

@ -167,7 +167,7 @@ public:
AvatarData(); AvatarData();
virtual ~AvatarData(); virtual ~AvatarData();
static const QUrl& defaultFullAvatarModelUrl(); static const QUrl& defaultFullAvatarcodelUrl();
virtual bool isMyAvatar() const { return false; } virtual bool isMyAvatar() const { return false; }