Navigation

  • Recent
  • Tags
  • Users
  • Search
  • Login
Colyseus
  • Login
  • Search
  • Recent
  • Tags
  • Users

Documentation GitHub

We're migrating to GitHub Discussions. This forum does not accept new registrations since April 6, 2023.
  1. Home
  2. emarkk
emarkk

emarkk

@emarkk

Chat Follow Unfollow
0
Reputation
4
Posts
1.3k
Profile views
0
Followers
0
Following
Joined 25 Apr 2019, 13:22 Last Online 14 May 2019, 13:04

  • Profile
  • More
    • Continue chat with emarkk
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups
emarkk Follow

Posts made by emarkk

RE: Questions about rooms

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.

posted in Questions & Help • 13 May 2019, 16:01
Questions about rooms

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?

posted in Questions & Help • 13 May 2019, 14:32
RE: @filter not working as expected

Ok, I get it. The same goes for @nosync?

posted in Questions & Help • 25 Apr 2019, 14:23
@filter not working as expected

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.

posted in Questions & Help • 25 Apr 2019, 13:32

© 2023 Endel Dreyer