Skip to content

Migrating to version 0.12 (from 0.11)

Version 0.12 has mostly internal improvements and bug fixes.

Please install the latest version of the server, as well as the client:

Upgrading the server:

npm install colyseus@^0.12.0 --save

Upgrading the client:

npm install colyseus.js@^0.12.0 --save

If you're using Unity or other client, please check on its respective repository on GitHub. If you have questions feel free to ask on Discord

Using this.broadcast() during onJoin() in the server

The version 0.11 introduced a bug where this.broadcast() would not send the message to the current connecting client during onJoin() (#260). Forcing you to also use this.send(client, ...) in order for the connecting client to also receive that message. This has been fixed now on 0.12:

class MyRoom extends Room {
  onJoin(client, options) {
    this.broadcast(/* your data */);

    /**
    * IF YOU'RE ALSO USING `this.send()` HERE, YOU CAN SAFELY REMOVE IT,
    * OTHERWISE THE MESSAGE WILL ARIVE TWICE FOR THIS CLIENT
    */
    // this.send(client, /* your data */);
  }
}

The @serialize() decorator has been deprecated.

The @serialize decorator was introduced on version 0.10, and it's now deprecated.

You can remove the @serialize() call from your project, as the serializer is now determined automatically whenever you use this.setState().

The Fossil Delta serializer is still supported on 0.12, and will probably continue to exist for JavaScript, LUA and C# clients. Other clients won't ever support the Fossil Delta serializer.

Back to top