colyseus.js
Advanced tools
Comparing version 0.7.0-alpha.3 to 0.7.0-alpha.4
@@ -21,1 +21,19 @@ # Migration guide for colyseus.js | ||
``` | ||
#### `room.listen()` signature has changed. | ||
OLD | ||
```typescript | ||
room.listen("entities/:id/:attribute", "replace", (id, attribute, value) => { | ||
console.log(id, attribute, value); | ||
}) | ||
``` | ||
NEW | ||
```typescript | ||
room.listen("entities/:id/:attribute", (change) => { | ||
console.log(change.path.id, change.path.attribute, change.value); | ||
}) | ||
``` |
{ | ||
"name": "colyseus.js", | ||
"version": "0.7.0-alpha.3", | ||
"version": "0.7.0-alpha.4", | ||
"description": "Multiplayer Game Client for the Browser", | ||
@@ -30,3 +30,3 @@ "keywords": [ | ||
"clock.js": "^1.1.0", | ||
"delta-listener": "^1.1.0", | ||
"delta-listener": "^2.0.0", | ||
"fossil-delta": "^0.2.5", | ||
@@ -33,0 +33,0 @@ "msgpack-lite": "^0.1.20", |
@@ -6,2 +6,3 @@ #  | ||
[](https://gitter.im/gamestdio/colyseus?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=N9C36SSE9ZCTS) | ||
[](http://travis-ci.org/gamestdio/colyseus.js) | ||
@@ -8,0 +9,0 @@ [](https://greenkeeper.io/) |
@@ -49,14 +49,14 @@ const assert = require('chai').assert; | ||
let patchCount = 0; | ||
room.listen("players/:id/:attribute", "replace", (id, attribute, value) => { | ||
room.listen("players/:id/:attribute", (change) => { | ||
patchCount++ | ||
assert.equal(id, "one"); | ||
assert.equal(attribute, "hp"); | ||
assert.equal(value, 40); | ||
assert.equal(change.path.id, "one"); | ||
assert.equal(change.path.attribute, "hp"); | ||
assert.equal(change.value, 40); | ||
}) | ||
room.listen("players/:id/position/:axis", "replace", (id, axis, value) => { | ||
room.listen("players/:id/position/:axis", (change) => { | ||
patchCount++ | ||
assert.equal(id, "one"); | ||
assert.equal(axis, "y"); | ||
assert.equal(value, 100); | ||
assert.equal(change.path.id, "one"); | ||
assert.equal(change.path.axis, "y"); | ||
assert.equal(change.value, 100); | ||
}) | ||
@@ -63,0 +63,0 @@ |
Sorry, the diff of this file is not supported yet
804479
107
+ Addeddelta-listener@2.1.2(transitive)
- Removeddelta-listener@1.1.1(transitive)
Updateddelta-listener@^2.0.0