Teams #
Teams are a Hiro meta system which allows the player to create, join, and search for teams of other players. Teams can be used to create guilds, clans, or any other organized unit of players useful for your gameplay.
The Teams system is build on top of the Nakama groups feature, and the chat feature, to enable players to communicate with each other, fetch historical chat messages, and even request donations.
Customization parameters #
The following JSON represents the customization parameters you can use to configure the default user experience for the teams system.
Property | Subproperty | Description |
---|---|---|
max_team_size | The maximum number of members for a team. |
Initializing the teams system #
The teams system relies on the Nakama System which must be passed in as a dependency via the constructor.
|
|
Subscribing to changes in the teams system #
You can listen for changes in the teams system so that you can respond appropriately, such as updating the UI, by implementing the appropriate interface.
|
|
Refreshing the teams system #
To ensure the teams system has the latest information from Nakama you can refresh it.
|
|
Getting the user’s current team #
You can get the user’s current team.
|
|
You can also determine if the user is an Admin or Superadmin of their current team.
|
|
Getting the user’s current team members #
You can get the user’s current team members.
|
|
Getting team members for other teams #
You can get the team members in other teams by passing the team id or a team object.
|
|
Getting the chat history for the user’s team #
You can get the chat history for the user’s team.
|
|
Creating a team #
You can create a team for the user. You must provide a function that returns a boolean
value indicating whether or not the user can create a team.
|
|
Listing available teams #
You can list available teams by location.
|
|
Searching for teams #
You can search for teams based on their name or shortcode.
|
|
Joining a team #
You can join a team for the user either by passing the team id or by passing a team object.
|
|
Listing join requests for the user’s current team #
You can list join requests for the user’s current team
|
|
Approving team join requests #
You can approve a single join request, either by passing the user id of the user requesting to join, or by directly passing the join request object.
|
|
You can also approve multiple join requests at once.
|
|
Rejecting team join requests #
You can reject a single join request, either by passing the user id of the user requesting to join, or by directly passing the join request object.
|
|
You can also reject multiple join requests at once.
|
|
Promoting team members #
You can promote team members if the user has sufficient priviledges.
|
|
Leaving a team #
You can leave a team for the user either by passing the team id.
|
|
Or by passing a team object.
|
|
Deleting a team #
You can delete a team, providing the user has sufficient priviledges.
|
|
Sending a chat message to the user’s team #
You can send a chat message to the user’s team.
|
|