pitaya
pitaya copied to clipboard
How to know which groups a member has joined
some methods like pitaya.MemberGroups etc..
Right now you would need to call
func GroupMembers(ctx context.Context, groupName string) ([]string, error)
for each group you have and see if the player is there.
an alternative would be to put the group list in the player agent
what is the use case?
There are some use case: If one player add to lots of group, when the player is kicked or offline, framework should remove the player from all raleted groups. If one player add to a game room, then he add to another room, before this, framework should remove the player from the previous one.
Now If only using GroupMembers, we need add a new interface like GroupAll, then scan each of groups to remove the specified player. It may be not elegant and slow.