How to access to main from room
im doing lobby /Room/ and want to supply with other rooms data, how to access to other rooms and main.
If you're using
Server(single-process) you can take a look on how it's being done here: https://github.com/derwish-pro/colyseus-monitor?files=1
ClusterServerit's more complicated. Each process have it's own instance of the
MatchMakerclass. The master node access a limited amount of data (via memshared, search for "memshared" on this file, you'll see what's available) just to be able to forward connections to the right process.
One suggestion when using
ClusterServeris to keep track of your spawned rooms through the public events (https://github.com/gamestdio/colyseus/wiki/Room-handlers#listening-to-room-events-outside-the-room-scope), and consume the data as you need.
tnx, monitor nice one!
another question, how to leave room from client side?
@Burjee-Bataa this should do:
var room = client.join("room_name"); // ... room.leave();