About setting number of rooms for a registered room on the server.


I'm trying to find a way to set the number of rooms.
My code trace has led me to believe I can make changes here:

MatchMaker.prototype.create = function (roomName, clientOptions) { ...}
Change the function so that it checks some flag to decided whether a room should be returned.

My question: I am not suppose to change the code for the files in the Colyseus folder right? What would be the recommended actions or approach to take for handling what I want to do?

Hi @shophk,

You generally shouldn't touch the implementation of the framework directly.

I'm not sure if I understood your problem. Would you like to limit the maximum number of rooms the server can spawn?


@endel Yes, I would like to limit the number of rooms. I want to have the first 10 rooms to have bonus or special effects.
after the first 10 rooms, users will get put into another registered room.

So in a way, yes, I want to limit the number of rooms the server can spawn base on some criteria.

Hi @endel
Did this get resolved ? I was wondering this as well just to make sure that the server would not run out of memory and cause all the other games to crash.


@Tyrus-Shan that's a good idea indeed, I've created an issue on GitHub to track this: https://github.com/gamestdio/colyseus/issues/155

Hi @endel thank you for the quick response. will keep track of the issues.