When writing my server extension I noticed that if I call Room.setGroupId passing an ID that's not in the zone's list of groups (retrieved with Zone.getGroups) it will not be added to the list and the room will remain in whichever group it's in (retrieved with Zone.getRoomListFromGroup). The room will still get the new ID though (retrieved by Room.getGroupId).
I read an old thread mentioning that group IDs are added when rooms are created. Is this still the only way of adding groups programmatically?
I'm using groups to find suitable rooms to put new clients into. I encode a language ID and a game activity ID into the group ID to accomplish this. My assumption has been that groups are meant to serve scenarios like this. Is this the case or would you recommend a custom solution?
Edit: I did some more testing and found that setting a room's group ID to an ID that exists will not update the group lists either. I suppose Room.setGroupId is an internal method not meant to be called by the user, and that a rooms can't change group after creation. Is this correct?
Changing a room's group ID to a previously unused ID
-
- Posts: 4
- Joined: 28 Aug 2017, 06:47
Re: Changing a room's group ID to a previously unused ID
Hi,
the group is assigned at creation time, but you can't change it after the Room has been created.
Correct. You create a Room and assign it to a group.
Cheers
the group is assigned at creation time, but you can't change it after the Room has been created.
I read an old thread mentioning that group IDs are added when rooms are created. Is this still the only way of adding groups programmatically?
Correct. You create a Room and assign it to a group.
Cheers
Who is online
Users browsing this forum: Baidu [Spider] and 36 guests