question

Abdullah Sohail avatar image
Abdullah Sohail asked

How to create a group of these types: OPEN/CLOSED/INVITEONLY

open group: anyone can join

closed group: no one can join

invite only: player can send request to join group but player can join only if there joining request is accepted

apismultiplayerShared Group Data
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

Our entity group system is the combination of “invite/apply only” and “open” by default: players call ApplyToGroup to apply to a group and members of the group administrator use AcceptGroupInvitation to accept applications, or, members of the group administrator call InviteToGroup to invite a player and it calls AcceptGroupInvitation to accept the invitation. I am not sure what do you mean by “closed group” though, does it mean that players cannot submit applications or accept invitations from members of the group?

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Abdullah Sohail avatar image Abdullah Sohail commented ·

thanks for your answer. about your question for "closed" group, it mans the group is closed for anyone to join so players can not even call ApplyToGroup API. By the way, i had implemented this functionality now and i'll share the solution here for others.

MY SOLUTION:

store the type of group in "group object" like this KEY : "Type", VALUE: { "groupType" : "close / open / inviteOnly" }

and on the basis of this, you can apply checks. For example:

switch(groupType)

{

case "open":

//add player to group directly

break;

case "inviteOnly":

//send ApplyToGroup request

break;

case "close":

//player can not join this group

break;

}

note: main thing here is playing with group object entity

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Abdullah Sohail commented ·

Thanks for sharing!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.