I'm looking to update to the latest version of Colyseus, both in terms of the version and the new schema method of handling state.
The documentation has instructions on how to listen to state change for clients, and how to define the schema for state, but there isn't any documentation on modifying state in the server. Is this because the method is the same as in 0.9?
Example code:
this.state.PlayerList[client.id].AnswerPicked = true;
Schema
class TriviaState extends Schema {
constructor () {
super();
this.CurrentQuestion = new QuestionState();
this.PlayerList = new ArraySchema();
}
}
type(QuestionState)(TriviaState.prototype, "CurrentQuestion");
type([PlayerState])(TriviaState.prototype, "PlayerList");