Take a sneak peak of our new documentation Read More
Last Updated: 11/8/2022, 8:40:17 AM

# Party

# Overview

AccelByte Cloud’s Lobby service includes Party features to enable multiplayer play. All Party features use WebSocket to ensure smooth communication between players. Players can interact with parties in several ways, including:

  • User Party Info shows players information about their party, including the Party ID, Leader ID, and the list of Party Members.
  • Create Party allows players to create a new party that other players can join.
  • Invite to Party allows players to invite their friends to join their party. Both the inviter and invitee will receive a notification when the invitation is sent.
  • Join Party allows players to join a party that they’ve been invited to join. When the player joins the party the inviter and other party members will be notified.
  • Reject Party Invitation allows players to reject a party invitation. The inviter will be notified that their invitation was rejected.
  • Promote Member as a Party Leader allows players to set another player as the party leader.
  • Kick Party allows party leaders to remove another player from their party.
  • Leave Party allows players to leave a party that they have already joined. The other party members will be notified when a player leaves their party.

# Permissions

Permissions (opens new window) are used to grant access to specific resources within our services. Make sure your account has the following permissions before you attempt to manage a party in the Admin Portal.

Usage Resource Action
Admin Get All Parties ADMIN:NAMESPACE:{namespace}:PARTY:STORAGE Read
Admin Get Party Data ADMIN:NAMESPACE:{namespace}:PARTY:STORAGE Read
Update Party Attributes ADMIN:NAMESPACE:{namespace}:PARTY:STORAGE Update
Admin Get User Party Data ADMIN:NAMESPACE:{namespace}:PARTY:STORAGE Read

Permissions work slightly differently depending on whether they are assigned to IAM Clients (opens new window) or Roles (opens new window) assigned to users. For more information, read the Authentication and Authorization (opens new window) documentation.

# Implement Party Interactions using the Client SDKs

# Create a Party

Players can create a party that can be used for matchmaking. A player can only create one party at a time, and will become the leader of the party they create.

# Invite to Party

Players can invite other players to their party. Invitees will receive a notification that they have been invited to join a party and current party members will also receive a notification that someone has been invited to the party.

# Party Codes

Party leaders can send party codes to players so that those players can join their party. Only party leaders can use party codes. They can also refresh or revoke a party code.

# Create Party and Party Code

When players create a party, partyCode is returned as a response (either as FAccelByteModelsCreatePartyResponse in Unreal Engine, or PartyCreateResponse in Unity).

# Generate or Refresh a Party Code

Use the following function to generate or refresh a party code.

# Get a Party Code

Once a code is generated, party leaders can get the code and share it from other players. This function allows party leaders to get the party code.

TIP

If the success response returns an empty party code, you need to call the GeneratePartyCode function to generate a new party code.

# Revoke a Party Code

Party leaders can revoke a party code. If a party code is revoked, players will no longer be able to use it to join the party. This function allows party leaders to revoke the party code.

# Join a Party with a Party Code

Players that have been sent a party code can use it to join a party. This function allows players to join a party using a party code.

# Join a Party

Players that are invited to a party can accept the invitation and join the party. Party invitees will receive a notification that they’ve joined the party and current party members will also receive a notification that someone is joining the party.

# Reject a Party Invitation

When a player has been invited to a party, they can choose to reject the invitation. Party invitees will receive a notification that they’ve rejected the invitation and current party members will also receive a notification that someone has rejected the party invitation.

# Promote a Member to Party Leader

The party leader can promote another party member to become the new party leader. All party members will be notified of the new party leader. This is how the party leader can promote another party member to become a new party leader. The new party leader is identified by a specific user id from a party member.

# Kick a Player From a Party

The party leader has the privilege to remove a party member from their party by kicking them out of the party. The kicked party member will receive a notification that they’ve been kicked out of the party, and current party members will also receive a notification that someone has been kicked from the party.

# Leave a Party

Party members can choose to leave their party. If the party leader leaves the party, party leadership will be passed to another party member automatically. Party members that leave the party will receive a notification that they’ve left the party and current party members will also receive a notification that someone is leaving the party.

# Send Notification to Party Members

Players can send a notification to all the members of their party. Call this function to send notifications to the party and allow the remaining party members to receive that notification.

# Implement Party Notifications using the Client SDKs

# Invite a Player

This is how the invited player will get notification after the other player requests an invite party to the player that will get the notification.

# Join a Party

When someone joins the party, the player inside the party will get some notification that there are some new party members inside the party.

# Reject a Party Notification

This is how the player party member and party leader will get notification after the invitation player rejects the invitation request.

# Promote a Party Leader

When there is some update from the party info data like promoting a new party leader, all party members including party leader will get a notification and get new information about the party.

# Kick a Party Member

Kick some party members will send a notification for all player members and party leaders that are still in the party.

# Leave a Party

For other players that are still at the party, they will get a notification after some players leave from the party. Call this delegate function to get a notification when some party member leaves the party.

# Implement Party Storage using the SDK

Party Storage enables a party to store party attributes that can be passed from the game server to the game client. The game server will write the party’s storage to ensure that all party members get the same information or notifications from the server.

# Party Data Update Notifications

Use this function to notify players of any updates to party data. Party members will be notified if an event occurs in the party, such as when a player accepts a party invitation, joins the party, or leaves the party.

# Retrieve Party Data (Client-Side)

Use this function to retrieve specific party data from the client side. Make sure you have players logged in to allow this API call.

# Retrieve Party Data (Server-Side)

Use this function to retrieve specific party data from the server side. Make sure the game server is authenticated to allow this API call.

# Write Party Data

Write Party Data is an exclusive feature for the game server. It’s possible that multiple servers can write to the same party at the same time. To avoid this, our SDK has a timestamp in the backend to ensure that the latest write data will never be overwritten with older data. This function you can modify from Previous Data that we called oldPartyData that you can get from the lambda or even you can input your own new Party Data.