⚔ Multiplayer Framework for Node.js
gameServer.define("something_123", /*...*/)
)http
, etc.)room.leave()
.When the closing code received in the client-side is anything higher than 1000
, it means an abnormal disconnection:
room.onLeave(code => {
if (code > 1000) {
// abnormal disconnection!
} else {
// the client has initiated the disconnection
}
});
lock()
/ unlock()
hasReachedMaxClients()
during onJoin()
pingCountMax
option (https://github.com/colyseus/colyseus/pull/255/files, thanks @GDdark ❤️ )onAuth
has returned a falsy value (https://discuss.colyseus.io/topic/280/client-joined-even-authentication-failed-after-upgrading-to-version-0-11-0)Version 0.11 is finally here! 🎉 See migration guide: https://docs.colyseus.io/migrating/0.11/
Implements publish
/ subscribe
to default LocalPresence
(single-process)
(Rooms can communicate with each other through this.presence
)
onInit() {
// subscribe to global "events"
this.presence.subscribe("events", (data) => console.log("event received", data));
// publish to global "events"
this.presence.publish("events", { text: "Player XYZ has been killed!" });
}
ws
package to 7.1.x
setState(T)
(https://github.com/colyseus/colyseus/pull/234, thanks @ChristianIvicevic)ws://domain.com/your-game/
)MemsharedPresence
"strict": true
on tsconfig.json
from the consumer sideRemoteClient
.