Beamable SDK
|
Public Member Functions | |
GroupsApi (IUserContext ctx, IBeamableRequester requester) | |
Promise< GroupUser > | GetUser (long gamerTag) |
Get the GroupUser for a player, which contains all the group metadata the player belongs to. Use the GetGroup method to resolve the full group data. More... | |
Promise< Group > | GetGroup (long groupId) |
Get the Group data for some group. The resulting Group structure will be personalized for the current player making the call. More... | |
Promise< EmptyResponse > | DisbandGroup (long group) |
Disbanding a group will delete the group data from Beamable. This method can only be called by an admin, from a microservice, or by the group Leader that has the Group.canDisband permission. More... | |
Promise< GroupMembershipResponse > | LeaveGroup (long group) |
Remove the current player from a group. After a player leaves, the group will no longer appear in the GetUser method response. More... | |
Promise< GroupMembershipResponse > | JoinGroup (long group) |
Add the current player to a group. A player can only join a group when the group's Group.enrollmentType is set to "open". A player can only be in one group at a time. If the player is already in a group, they must use the LeaveGroup method before they can join a new group. More... | |
Promise< EmptyResponse > | Petition (long group) |
This will be removed in a future version of Beamable. Please do not use. More... | |
Promise< GroupSearchResponse > | GetRecommendations () |
This will be removed in a future version of Beamable. Please do not use. More... | |
Promise< GroupSearchResponse > | Search (string name=null, List< string > enrollmentTypes=null, bool? hasSlots=null, long? scoreMin=null, long? scoreMax=null, string sortField=null, int? sortValue=null, int? offset=null, int? limit=null) |
Get a list of Groups that match some criteria. The resulting Group structures will not be personalized to the current player, and as such, the various permission fields should not be trusted. More... | |
Promise< GroupCreateResponse > | CreateGroup (GroupCreateRequest request) |
Create a new group. The current player will become the group Leader for the new group. More... | |
Promise< AvailabilityResponse > | CheckAvailability (string name, string tag) |
Check if the given name and tag are available to be used. Names and tags are required to be unique, so if another group is already using the name or tag given to the CreateGroup or SetGroupProps methods, those requests will fail. More... | |
Promise< EmptyResponse > | SetGroupProps (long groupId, GroupUpdateProperties props) |
Update the group's data. Only the group Leader can update group data. More... | |
Promise< GroupMembershipResponse > | Kick (long group, long gamerTag) |
A Member can be kicked from the group if the current player's Member.canKick field is true. The group Leader and all Officers can kick regular group members. Once a member is kicked, they will no longer be a member. More... | |
Promise< EmptyResponse > | SetRole (long group, long gamerTag, string role) |
Set a player's role within a group. Valid roles are "leader", "officer", or an empty string. A group can only have 1 Leader, and the request will fail if the SetRole operation would result in 0 group Leaders. A group can have arbitrary many Officers. This method can be used to change the group Leader. The existing group Leader must call this method and assign a different user the role of "leader". The player that is running this method must have sufficient permissions to grant the role. More... | |
Promise< EmptyResponse > | MakeDonationRequest (long group, Currency currency) |
Send a request to the rest of the group to request an amount Currency. Other members in the group may decide to donate their personal currency to the requester by calling the Donate method. The status of donations can be observed in the Group.donations list. ATTENTION! For group donations to work, you must configure a GroupDonationsContent content object called "default". After a player makes a donation request, they must wait some number seconds (as configured in the donations.default) before making a new request. More... | |
Promise< EmptyResponse > | Donate (long group, long recipientId, long amount, bool autoClaim=true) |
Send an amount of player currency to fulfil a pending donation request. Members of a group can request currency by running the MakeDonationRequest method. The status of donations can be observed in the Group.donations list. ATTENTION! For group donations to work, you must configure a GroupDonationsContent content object called "default". More... | |
Promise< EmptyResponse > | ClaimDonations (long group) |
If a player has requested a donation with the MakeDonationRequest method, and other players have donated with the Donate method without autoClaim enabled, then this method must be called by the original player to complete the donation. More... | |
string | AddQuery (string query, string key, string value) |
This will be removed in a future version of Beamable. Please do not use. More... | |
virtual Promise< GroupsView > | GetCurrent (string scope="") |
Public Member Functions inherited from Beamable.Common.Api.ISupportsGet< GroupsView > | |
Promise< TData > | GetCurrent (string scope="") |
Manually fetch the available data. If the server hasn't delivered a new update, this method will not return the absolute latest data unless you pass forceRefresh as true. More... | |
Properties | |
IUserContext | Ctx [get] |
IBeamableRequester | Requester [get] |
|
inline |
This will be removed in a future version of Beamable. Please do not use.
query | |
key | |
value |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
Check if the given name and tag are available to be used. Names and tags are required to be unique, so if another group is already using the name or tag given to the CreateGroup or SetGroupProps methods, those requests will fail.
name | The name to check if other groups are using yet. |
tag | The tag to check if other groups are using yet. |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
If a player has requested a donation with the MakeDonationRequest method, and other players have donated with the Donate method without autoClaim enabled, then this method must be called by the original player to complete the donation.
This method will claim all outstanding donations for the current player. ATTENTION! For group donations to work, you must configure a GroupDonationsContent content object called "default".
group | the group id. |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
Create a new group. The current player will become the group Leader for the new group.
request | The GroupCreateRequest that will be used to seed the initial properties of the group. |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
Disbanding a group will delete the group data from Beamable. This method can only be called by an admin, from a microservice, or by the group Leader that has the Group.canDisband permission.
group | The group id to disband. |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
Send an amount of player currency to fulfil a pending donation request. Members of a group can request currency by running the MakeDonationRequest method. The status of donations can be observed in the Group.donations list. ATTENTION! For group donations to work, you must configure a GroupDonationsContent content object called "default".
group | The group id |
recipientId | The gamertag of the player that is asking for a donation. |
amount | The amount of currency to donate to the player. |
autoClaim | When true, the currency will automatically be transferred into the recipient's inventory. When false, the recipient will need to call ClaimDonations. However, the currency will leave the sender's inventory immediately. |
Implements Beamable.Common.Api.Groups.IGroupsApi.
Get the Group data for some group. The resulting Group structure will be personalized for the current player making the call.
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
This will be removed in a future version of Beamable. Please do not use.
Implements Beamable.Common.Api.Groups.IGroupsApi.
Get the GroupUser for a player, which contains all the group metadata the player belongs to. Use the GetGroup method to resolve the full group data.
gamerTag | The gamertag of a player |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
Add the current player to a group. A player can only join a group when the group's Group.enrollmentType is set to "open". A player can only be in one group at a time. If the player is already in a group, they must use the LeaveGroup method before they can join a new group.
group | The group id to join |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
A Member can be kicked from the group if the current player's Member.canKick field is true. The group Leader and all Officers can kick regular group members. Once a member is kicked, they will no longer be a member.
group | The group id to kick the member from. |
gamerTag | The gamertag of the member to kick from the group. |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
Remove the current player from a group. After a player leaves, the group will no longer appear in the GetUser method response.
group | The group id to leave |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
Send a request to the rest of the group to request an amount Currency. Other members in the group may decide to donate their personal currency to the requester by calling the Donate method. The status of donations can be observed in the Group.donations list. ATTENTION! For group donations to work, you must configure a GroupDonationsContent content object called "default". After a player makes a donation request, they must wait some number seconds (as configured in the donations.default) before making a new request.
group | The group id |
currency | A Currency structure to describe what type of donation the player is requesting. |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
This will be removed in a future version of Beamable. Please do not use.
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
Get a list of Groups that match some criteria. The resulting Group structures will not be personalized to the current player, and as such, the various permission fields should not be trusted.
name | An optional group name. This text will be a fuzzy text match |
enrollmentTypes | valid values include "open", "closed", and "restricted". |
hasSlots | By default, will be true. When true, only search for groups that still have room left for new members to join. |
scoreMin | This will be removed in a future version of Beamable. |
scoreMax | This will be removed in a future version of Beamable. |
sortField | Sort the resulting groups on a particular field name. When this field is used, you must also specify a sortValue |
sortValue | Use a positive number to sort the resulting groups from highest to lowest. Use a negative number to sort the resulting groups from lowest to highest. When this field is used, you must also specify a sortField |
offset | The number of resulting groups to skip in the response. This can be used with limit to page the groups. |
limit | The maximum number of resulting groups for the response. This can be used with the offset to page the groups. |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
Update the group's data. Only the group Leader can update group data.
groupId | The id of the group to update |
props | A GroupUpdateProperties structure that contains the data to update. The update can be partial. Any fields that are null will not cause updates. |
Implements Beamable.Common.Api.Groups.IGroupsApi.
|
inline |
Set a player's role within a group. Valid roles are "leader", "officer", or an empty string. A group can only have 1 Leader, and the request will fail if the SetRole operation would result in 0 group Leaders. A group can have arbitrary many Officers. This method can be used to change the group Leader. The existing group Leader must call this method and assign a different user the role of "leader". The player that is running this method must have sufficient permissions to grant the role.
group | The group id |
gamerTag | the gamertag of the player whose role will be changed. |
role | The role to assign the player to. Valid options are "leader", "officer", or "" |
Implements Beamable.Common.Api.Groups.IGroupsApi.