im doing lobby /Room/ and want to supply with other rooms data, how to access to other rooms and main.
How to access to main from room
Hi @Burjee-Bataa,
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
For ClusterServer
it's more complicated. Each process have it's own instance of the MatchMaker
class. 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 ClusterServer
is 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.
Cheers!
@Burjee-Bataa this should do:
var room = client.join("room_name");
// ...
room.leave();