You can use a database to do this, or redis. But you can't just share variables between rooms as they should be treated as if they have no way to communicate with each other.
Posts made by seiyria
RE: Need a static variable which will be shared to all rooms
RE: Getting URL is not defined when connecting to Room
A sample project or code snippet would go a long way to helping figure out what's going on.
RE: Just beginning, seek advice for setup on CentOS dedicated server
I wasn't having a ton of luck compiling uws. For me, I downgraded from node 9 to node 8.9.3 and uws started working for me again.
Land of the Rair
I've been working on a multiplayer rpg using colyseus. You can find it at https://rair.land. It's pretty old-style, and it currently looks like this:
I make use of colyseus by making each room correspond to a map in the world. That way, empty maps aren't loaded or taking any resources. Rooms with fewer players will still take fewer resources than a normal, populated one, since anything not near a player slows down significantly. The loot on the ground is persistent, same with boss timers, so you can't cheat the system.