apparently it was due to the websocket disconnecting. it happens every time a "normal" request is sent (like performing an http get request or loading an ad). for now I am just forcing the websocket to reconnect, but maybe a simpler way exists.
Posts made by emarkk
Is it possible to join two or more rooms together? The situation is the following: all clients join room A (and should stay there the entire time, until the app is closed). Then, if a player wants to start a match, its client will enter also room B. The problem is that when I do - with colyseus-defold - room_b:leave(), this causes the client to leave room A as well. Is it the normal behaviour or is there something wrong?
Ok, I get it. The same goes for @nosync?
My GameState has a map (MapSchema) of players (Player). Inside Player, I have a field which should be private (visible to the player and not the entire room). I am trying to use @filter, but without success.
export class SecretSchema extends Schema {
@type("number")
xyz: number;
@type("number")
abc: number;
}
export class Player extends Schema {
@filter(function(this: Player, client: any, value: GameMap, root: GameState) {
console.log("filter");
return true;
})
@type(SecretSchema)
secretVar: SecretSchema;
}
export class GameState extends Schema {
@type({ map: Player })
players = new MapSchema<Player>();
}
First, I have typescript errors on @filter. It says that Player and Schema are incompatible. But apart from that, "filter" is not printed to the console and I get the whole state on all Players in the room.