Skip to content

Commit

Permalink
fix setting WebSocket binaryType on reconnections. colyseus/colyseus#62
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Nov 2, 2017
1 parent 1712f85 commit c89baf1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
9 changes: 5 additions & 4 deletions dist/colyseus.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions dist/index.html
Expand Up @@ -49,6 +49,11 @@
console.log('joined!');
})

room.onLeave.add(function() {
room.connection.reconnectEnabled = false;
console.log("LEFT ROOM", arguments);
});

room.onUpdate.add(function(data) {
console.log("chat update: ", data)
});
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "colyseus.js",
"version": "0.7.5",
"version": "0.7.6",
"description": "Multiplayer Game Client for the Browser",
"keywords": [
"multiplayer",
Expand Down Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@gamestdio/clock": "^1.1.0",
"@gamestdio/websocket": "^0.1.13",
"@gamestdio/websocket": "^0.2.2",
"delta-listener": "^2.1.0",
"fossil-delta": "^1.0.0",
"msgpack-lite": "^0.1.20",
Expand Down
2 changes: 1 addition & 1 deletion src/Room.ts
Expand Up @@ -42,7 +42,7 @@ export class Room<T=any> extends DeltaContainer<T & any> {
connect (connection: Connection) {
this.connection = connection;
this.connection.onmessage = this.onMessageCallback.bind(this);
this.connection.onclose = (e) => this.onLeave.dispatch();
this.connection.onclose = (e) => this.onLeave.dispatch(e);
}

protected onMessageCallback (event) {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
@@ -1,3 +1,4 @@
export { Client } from "./Client";
export { Protocol } from "./Protocol";
export { Room } from "./Room";
export { DataChange } from "delta-listener";

0 comments on commit c89baf1

Please sign in to comment.