Page 1 of 1

Question about group ids

Posted: 01 Feb 2012, 12:26
by auras
How do group IDs work?
Do they have be declared first somewhere before using them? If so, how?

I'm asking because when I'm creating a room if I want to set a group id it won't work

Code: Select all

RoomSettings room = new RoomSettings(nextRoom);
         room.setGroupId("experience" + keycode);
         room.setMaxUsers(MAX_ROOM_USERS);

         if (password != null && !password.equals(""))
            room.setPassword(password);
         
         sfClient.send(new CreateRoomRequest(room));


If I comment the second line it will work.

Posted: 01 Feb 2012, 22:32
by rjgtav
Hi.

You can set the group IDs of a Zone in the Zone Configurator, in the Public Room Groups setting under the General Tab.

You can also create new Room Groups on run-time (server-side only), by specifying a new Group ID when creating the room.

Re: Question about group ids

Posted: 23 Feb 2012, 16:56
by set_a
If I need to add another group to an already created groups. I need to create an array of the names of these groups and call setPublicGroups for current zone
If I do that what happens to the rooms that were already attached to the created groups?

Re: Question about group ids

Posted: 23 Feb 2012, 20:37
by rjgtav
Hi. If you want to create a new room group, you simply need to create a new room and attach it to a new groupId.

Re: Question about group ids

Posted: 24 Feb 2012, 11:08
by set_a
Example:
List of groups: group_1, group_2, group_3
Add groups to the area through the setPublicGroups method. Add several rooms into each group.
1. I need to add a new group group_4 (ie I can't use setPublicGroups method). So I need to create a room and tie it to the new group for creating this group in the area?
2. If I use setPublicGroups method all of the rooms that were added to the group group_1, group_2, group_3 will disappear?
3. For removing the group I have to delete all the rooms in this group?

Re: Question about group ids

Posted: 24 Feb 2012, 20:00
by rjgtav
First of all, please don't use the setPublicGroups() method. It is for internal use only, by the API.
For creating a new room group, yes, you just create a new room, and as the group id, you set "group_4".
And yes, I think the room group is removed when all of its rooms are also removed.

Re: Question about group ids

Posted: 27 Feb 2012, 02:43
by ganggangde
If I need to add another group to an already created groups. I need to create an array of the names of these groups and call setPublicGroups for current zone
If I do that what happens to the rooms that were already attached to the created groups?

Re: Question about group ids

Posted: 13 Mar 2012, 10:42
by Lapo
Room groups are never removed, because they are just "keys". They basically don't take real space.
It is like the name of a road. If you build a few houses along that road you can then tell people how to get there by providing the address... Lapo Street ... for example :) If you destroy all houses then who cares about the name of that street anymore? :)

One more note. In general groups are not meant to be totally dynamic, if you have planned your application a bit you should know beforehand which groups you will need.

Re: Question about group ids

Posted: 05 Feb 2016, 18:51
by Carl Lydon
It would be nice if you could remove them though, just for the sake of organization. They show up in the admin tool and if there are a lot of "dead" ones cluttering up the dropdown isn't so nice, and also if you you have code that searches rooms by roomGroup, it would be nicer to not loop through a bunch of roomGroups that don't exist. That said, I suppose restarting the server can fix it of snow.

Re: Question about group ids

Posted: 08 Feb 2016, 09:14
by Lapo
Carl Lydon wrote:It would be nice if you could remove them though, just for the sake of organization. They show up in the admin tool and if there are a lot of "dead" ones cluttering up the dropdown isn't so nice, and also if you you have code that searches rooms by roomGroup, it would be nicer to not loop through a bunch of roomGroups that don't exist. That said, I suppose restarting the server can fix it of snow.

Groups are defined at Zone Level, so you can always remove those that are no longer needed.
In terms of performance the unused groups don't cause any issue.

cheers

Re: Question about group ids

Posted: 21 Jul 2016, 19:13
by Carl Lydon
How? I see a display in the admin tool under zone-->runtime zone settings, but no ability to select a room group

The only way I've seen so far is to restart the server, which I try to avoid doing...

Re: Question about group ids

Posted: 22 Jul 2016, 08:02
by Lapo
Good point. At the moment you will need a restart, but if you're doing it because you want to remove groups I wouldn't recommend it for the reasons I explained in my previous post.

We have a new feature coming with the next 2.12 release which will allow you to manage groups dynamically from your Extension code. So no restart required.

cheers

Re: Question about group ids

Posted: 26 Jul 2016, 02:43
by Carl Lydon
Awesome!

Re: Question about group ids

Posted: 20 Jun 2019, 08:41
by DrPsyche
Lapo wrote:

Room groups are never removed, because they are just "keys". They basically don't take real space.]term paper for sale
It is like the name of a road. If you build a few houses along that road you can then tell people how to get there by providing the address... Lapo Street ... for example :) If you destroy all houses then who cares about the name of that street anymore? :)

One more note. In general groups are not meant to be totally dynamic, if you have planned your application a bit you should know beforehand which groups you will need.


Quite an interesting approach to explain that :) I planned all the groups for my application beforehand, just like you said. But my last application project was actually a mess (and I had to work on other variants) because I didn't managed to complete migration from 2.10 to 2.12 successfully. Anyway, that was my mistake.

Edit: Sorry for the bump, just noticed the topic is quite old.