Friends


ServerBytes Friends plugin helps you to build friend relationships between players, and check whether user is online or offline.
Use Friends plugin to manage friend requests, block/unblock users and get notified when user status change.

Installation

To add Friends plugin to your game, simply download Unity package and import it into the Unity game, or download Nuget package.

Client

Client setup

The very first step to initialize the plugin is to setup the plugin host:

var pluginHost = ClientFactory.GetPluginHost(appKey);
var friendsFactory = new FriendsFactory(pluginHost, myRelationshipNotifications);
// ...or initialize without notification handler
// var friendsFactory = new FriendsFactory(pluginHost);

// instantiate other plugins

var client = UnityClientFactory.GetClient(pluginHost);

Client.OnConnected += Client_OnConnected;
Client.OnFailedToConnect += Client_OnFailedToConnect;
Client.OnDisconnected += Client_OnDisconnected;
Client.Connect();

Read more about intallation here To add notifications about change in relationships between your players, or to get notified when your friends are online or offline, implement RelationshipNotifications and override callbacks that you want to follow.

Now, that we are connected with plugin, we can start using one of the plugin services:

private void Client_OnConnected()
{
    IRelationshipService relationshipService = friendsFactory.Create(Client);
}

Services

Check client services here

Web UI

Users

User page give the full insight of relationship status of your players.

Relationship statuses

There are a couple of relationship statutes between two players:

  • Not friends
  • Friend request sent
  • Pending approval
  • Friends
  • Blocking
  • Blocked by other user

List relationships

Provide user id and select the Filter button to list all relationships for the specific user. Additionally, specify relationship status to get specific results.


ListRelationships

Edit relationship

To edit relationship between users, select the relations field by specific user.
After updating relationship status, both users will receive notifications about status change.


EditRelationships

results matching ""

    No results matching ""