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

7 Nov 2017, 15:02

Hi,

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?

7 Nov 2017, 16:11

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?

Cheers

8 Nov 2017, 03:05

@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.

18 May 2018, 06:35

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.

Thanks

18 May 2018, 17:06

@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

20 May 2018, 04:37

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