I have developed a multiplayer game with colyseus.
it requires 4 clients and most of the time client have to wait for other clients to join.so some device going to sleep mode after a few seconds and the client Disconnect from the server.
i added window.set_dim_mode (window.DIMMING_ON) this line to init function.but it not works.
also, i need to know about rejoining functions. i used this code and it gives a error “this.state.inactivateClient” is not function;
async onLeave (client) {
// flag client as inactive for other users
this.state.inactivateClient(client);
try {
// allow disconnected client to rejoin into this room until 20 seconds
await this.allowReconnection(client, 20);
// client returned! let's re-activate it.
this.state.activateClient(client);
} catch (e) {
// 20 seconds expired. let's remove the client.
this.state.removeClient(client);
}
}
please help me.