Skip to content

Commit c89baf1

Browse files
committed
fix setting WebSocket binaryType on reconnections. colyseus/colyseus#62
1 parent 1712f85 commit c89baf1

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

dist/colyseus.js

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.html

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
console.log('joined!');
5050
})
5151

52+
room.onLeave.add(function() {
53+
room.connection.reconnectEnabled = false;
54+
console.log("LEFT ROOM", arguments);
55+
});
56+
5257
room.onUpdate.add(function(data) {
5358
console.log("chat update: ", data)
5459
});

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "colyseus.js",
3-
"version": "0.7.5",
3+
"version": "0.7.6",
44
"description": "Multiplayer Game Client for the Browser",
55
"keywords": [
66
"multiplayer",
@@ -29,7 +29,7 @@
2929
},
3030
"dependencies": {
3131
"@gamestdio/clock": "^1.1.0",
32-
"@gamestdio/websocket": "^0.1.13",
32+
"@gamestdio/websocket": "^0.2.2",
3333
"delta-listener": "^2.1.0",
3434
"fossil-delta": "^1.0.0",
3535
"msgpack-lite": "^0.1.20",

src/Room.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class Room<T=any> extends DeltaContainer<T & any> {
4242
connect (connection: Connection) {
4343
this.connection = connection;
4444
this.connection.onmessage = this.onMessageCallback.bind(this);
45-
this.connection.onclose = (e) => this.onLeave.dispatch();
45+
this.connection.onclose = (e) => this.onLeave.dispatch(e);
4646
}
4747

4848
protected onMessageCallback (event) {

src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export { Client } from "./Client";
22
export { Protocol } from "./Protocol";
33
export { Room } from "./Room";
4+
export { DataChange } from "delta-listener";

0 commit comments

Comments
 (0)