Spine Tutorial 6 – Friends

Requirements

Introduction

This tutorial explains how to query the friends of a player. Required is the module SPINE_MODULE_FRIENDS. Friends can be useful for matchmaking just with friends.

Friends

Friends can be added easily in Spine. If the requested friendship is accepted the friend is diplayed on the friends site in Spine and can be queried from the scripts.

The Functions

Here want to explain the functions of the friends module.

Spine_GetFriendCount

With Spine_GetFriendCount you can query how many friends the current user has. That’s important to know how many friends can be accessed.

Spine_GetFriendName

With Spine_GetFriendName you can get the name of a friend. The friends are ordered alphabetically and the amount can be queried using Spine_GetFriendCount. They are accessed using their index, starting with 0. That means the highest index is Spine_GetFriendCount() – 1. That means with

Spine_GetFriendName(0);

you get the name of the first friend.