Suggestion: customize initial roomlist

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
Rob
Posts: 34
Joined: 01 Jul 2017, 07:33

Suggestion: customize initial roomlist

Postby Rob » 04 Jun 2019, 09:47

Could there be a way in a custom login to populate the initial roomlist with specific room groups? At the moment there's no way to specify what room groups individual users subscribes to. There's only the global "Default Room Groups" setting which applies to all users.

At the moment, we have to call subscribeRoomGroup for each group we want to join a specific user to, which in turn causes a ROOM_GROUP_SUBSCRIBE event for each group to be sent to the user. It would be more efficient to be able to include the relevant groups in the login reply.
User avatar
Lapo
Site Admin
Posts: 20959
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Suggestion: customize initial roomlist

Postby Lapo » 04 Jun 2019, 12:49

Hi,
you can configure the Default Room Groups to nothing (i.e. an empty string) so that when a User logs in the initial Room List is completely empty. Then you can apply your own custom logic to decide which Room Groups a certain User should subscribe to.

Hope it helps.
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Rob
Posts: 34
Joined: 01 Jul 2017, 07:33

Re: Suggestion: customize initial roomlist

Postby Rob » 04 Jun 2019, 14:33

Yes, that's what I'm currently doing. But that leads to multiple ROOM_GROUP_SUBSCRIBE events having to be sent to the user after processing the login. My suggestion was to add functionality to the custom login to subscribe the user to those groups immediately on login so that the LOGIN response will have all the rooms from those groups instead of an empty roomlist.

If the user needs to join 5 room groups, the current solution causes 5 extra events to be sent instead of having them all be included in the original login reply.

Maybe make it so we can call user.subscribeGroup() in our custom login handler and that would make sure the user's login reply would have the rooms added, just as if they were in the Default Room Groups setting.
User avatar
Lapo
Site Admin
Posts: 20959
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Suggestion: customize initial roomlist

Postby Lapo » 05 Jun 2019, 08:23

Makes sense, I've added a note in our TODO database.
Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 28 guests