Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Creating Group Alliances by Users with no role

A topic by ratuspro created Dec 14, 2018 Views: 182 Replies: 4
Viewing posts 1 to 5
Submitted

Hello again, 


Since the last time we talked, I've managed to use a lot of the API successfully. Still, I'm finding some issues with the features regarding Alliances. When trying to create an alliance between two groups, I've encountered some problems when calling CreateAllianceRequestAsync.


The method always returns an error even if I change the request's auto accept property. I've tried a bunch of stuff and ended up verifying if the users were actually in the requestor's group. Indeed, it was. However, when inspecting the Data model in the admin panel, I've discovered that no user inside the groups has a role assigned to. I assigned the only available role ("Group") and then tried to create an alliance. This time it worked! Looking for ways to assign roles in the code, I haven't found any method that enables me to do it. Maybe I'm missing something but how can I solve the problem of having group member's default role be empty? 


Thanks in advance!

Host

Hi ratuspro.

CreateAllianceRequestAsync should be called by the group owner, and only the group owner is able to assign roles to members. 

It is not possible in the current version of SUGAR to set the default permissions assigned to a user when they join a group. only the group admin (the one who created the group) can assign these roles. Setting default permissions for relationships is a feature in the pipeline, which will not be available in the game jam version. 

Hope this helps!

Submitted

Hey,

So, the only user than can create an alliance request between two groups is the group owner, and this role cannot be interchanged between users? This is, user 1, the group owner, cannot grant user 2, another member of the same group, permissions to establish an alliance with other groups?

Still, the groups that I'm using were created before any user joined (using the admin panel). How can a user be the owner of such  group?

Thanks!

Host

Only users with the group role have the permission to assign roles to other members of the group. 

In the current version of SUGAR, the user who creates the group is given the group role, and members who join it are not given the role automatically. It must be assigned by the group owner or another user who has the group role. 

Submitted

Thanks. It makes sense that there should be a chain of responsability assigning such roles.  

However, I need all members to create alliances. Since this is not possible for this jam, I'm going to do a minor workaround that wouldn't be acceptable for a production product but, hopefully, it will serve the purpose for the game jam. Hope you understand.

Thanks again.