colyseus.js
Advanced tools
Comparing version 0.7.0-alpha.2 to 0.7.0-alpha.3
@@ -18,6 +18,2 @@ "use strict"; | ||
this.rooms = {}; | ||
var colyseusid = cookie.getItem('colyseusid'); | ||
if (colyseusid) { | ||
this.id = colyseusid; | ||
} | ||
this.connection = new Connection_1.Connection(url); | ||
@@ -27,2 +23,11 @@ this.connection.onmessage = this.onMessageCallback.bind(this); | ||
this.connection.onerror = function (e) { return _this.onError.dispatch(); }; | ||
// check for id on cookie | ||
this.connection.onopen = function () { | ||
console.log("onopen!"); | ||
var colyseusid = cookie.getItem('colyseusid'); | ||
if (colyseusid) { | ||
_this.id = colyseusid; | ||
_this.onOpen.dispatch(); | ||
} | ||
}; | ||
} | ||
@@ -29,0 +34,0 @@ Client.prototype.join = function (roomName, options) { |
@@ -24,2 +24,3 @@ "use strict"; | ||
Connection.prototype.onOpenCallback = function (event) { | ||
_super.prototype.onOpenCallback.call(this); | ||
if (this._enqueuedCalls.length > 0) { | ||
@@ -26,0 +27,0 @@ for (var i = 0; i < this._enqueuedCalls.length; i++) { |
{ | ||
"name": "colyseus.js", | ||
"version": "0.7.0-alpha.2", | ||
"version": "0.7.0-alpha.3", | ||
"description": "Multiplayer Game Client for the Browser", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"tiny-emitter": "^1.1.0", | ||
"websocket.js": "^0.1.10" | ||
"websocket.js": "^0.1.12" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
803973
33
514
Updatedwebsocket.js@^0.1.12