Friend Manager

The PlayFab Friend Manager Module is specifically designed to manage friend features.

The addon implements a friend management system to allow players to add and remove friends, and get the friends list. 

Depending on the developer's preference in game design, the developer can add friends using their display name, email, username or the usual way, adding or removing friends using the playfab id.

Retrieving the friends list is also very easy to implement. It can automatically sync to other authentication services' friends list and also retrieve the complete account and player info of each friends.

 

Intstructions

1. The first step is to add the PlayFab API addon into the project.

2. Then, add the Authentication addon into the project.

3. Finally, add the Friend Manager addon into the project.

Features :

  • Add, Remove and Get Friends List.

  • Friend Tags

  • Friend Complete Profile Data

    • Account & Player info, Currency,

    • Linked Accounts, Location, Tags

    • Leaderboards and Statistics

Network Services :

  • Facebook

  • Google Plus

  • Game Center

  • Google Play

  • Facebook Instant Games

  • Steam

  • Xbox Live

  • Nintendo Switch

  • PS4

  • PlayFab

Actions, Conditions & Expressions

Actions

Add Friendship :

  • Add Friend by Email - Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user.

    • Email - Email address of the user being added.

    • Tag - Return the "Tag" of the latest request.

  • Add Friend by PlayFabID - Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user.

    • Friend PlayFab ID - The PlayFab identifier of the user being added.

    • Tag - Return the "Tag" of the latest request.

  • Add Friend by DisplayName - Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user.

    • DisplayName - The PlayFab identifier of the user being added.

    • Tag - Return the "Tag" of the latest request.

  • Add Friend by Username - Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user.

    • Username - The PlayFab identifier of the user being added.

    • Tag - Return the "Tag" of the latest request.

Remove Friend :

  • Remove Friend - Removes a specified user from the friend list of the local user.

    • Friend PlayFab ID - PlayFab identifier of the friend account which is to be removed.

    • Tag - Return the "Tag" of the latest request.

Get Friends List :

  • Get Friends List - Retrieves the current friend list for the local user.

    • Facebook Friends - Indicates whether Facebook friends should be included in the response. Default is "Include".

    • Steam Friends : - Indicates whether Steam service friends should be included in the response. Default is "Include".

    • XBox Friends - Indicates whether XBox service friends should be included in the response. Default is "Exclude".

    • XBox Token - XBox token if XBox friends should be included. Requires XBox be configured on PlayFab.

    • Tag - Return the "Tag" of the latest request.


Friend Tags :

  • Plan Friend Tag - Plan Friend Tag to Stack for the next "Set Tags".

    • Tag - Tag to set on the friend account.

 

  • Set Friend Tags - Updates the tag list for a specified user in the friend list of the local user.

    • Friend PlayFab ID - PlayFab identifier of the friend account to which the tag(s) should be applied.

    • Tag - Return the "Tag" of the latest request.

Conditions

Add Friendship :

  • On Add Friend - Triggers when the Add Friend Succeeded.

  • On Account Not Found - Triggers when the Add Friend responded that the account was not found.

  • On Users Already Friends - Triggers when the Add Friend responded that the users are already friends.

  • On Add Friend Failed - Triggers when the Add Friend Failed.

Remove Friendship :

  • On Remove Friend - Triggers when the Remove Friend Succeeded.

  • On Account Not Found - Triggers when the Remove Friend responded that the account was not found.

  • On Remove Friend Failed - Triggers when the Remove Friend Failed.


Get Friends List :

  • On Get Friends List - Triggers when the Get Friends List Succeeded.

  • On Get Friends List Failed - Triggers when the Get Friends List Failed.


Set Friend Tags :

  • On Set Friend Tags - Triggers when the Set Friend Tags Succeeded.

  • On Account Not Found - Triggers when the Set Friend Tags responded that the account was not found.

  • On Set Friend Tags Failed - Triggers when the Set Friend Tags Failed.


Friends List :

  • For Each Friend - Loops through all the Friends List using the "loopFriends" expression.


Friends List :: Tags :

  • For Each Friends Tag - Loops through all the Friend Tags List using the "loopFriendTags" expression.


Friends List :: Location :

  • For Each Friend Location - Loops through all the Friend Locations List using the "loopLocations" expression.


Friends List :: Email :

  • For Each Friends Email - Loops through all the Friend Emails List using the "loopFriendEmails" expression.


Friends List :: Currency :

  • For Each Friends Currency - Loops through all the Friend Currency List using the "loopFriendCurrencies" expression.


Friends List :: Statistics :

  • For Each Friends Statistic - Loops through all the Friend Statistics List using the "loopStatistics" expression.


Friends List :: Linked Accounts :

  • For Each Friends Linked - Loops through all the Friend Linked Accounts List using the "loopLinkedAccounts" expression.

Expressions

Get Friends List :

  • getUsername - Returns the "Username". The PlayFab unique username for this friend.

    • Index - The Index from the Friends List.

  • getDisplayName - Returns the "Title DisplayName". The Title-specific display name for this friend.

    • Index - The Index from the Friends List.

  • getPlayFabID - Returns the "Friend PlayFabID". The PlayFab unique identifier for this friend.

    • Index - The Index from the Friends List.

  • loopFriends - Returns the friend index from the "For Each Friend" looped through the friends list.

  • countFriends - Returns the friend count from the friend list.

Get Friends List :: GameCenter :

  • getGameCenterID - Returns the "GameCenterID". The GameCenter identifier for this friend.

    • Index - The Index from the Friends List.


Get Friends List :: Steam :

  • getSteamStatus - Returns the "Steam Activation Status". Either "None", "ActivatedTitleKey", "PendingSteam", "ActivatedSteam" or "RevokedSteam".

    • Index - The Index from the Friends List.

  • getSteamCountry - Returns the "Steam Country". The country in which the player resides, from Steam data.

    • Index - The Index from the Friends List.

  • getSteamCurrency - Returns the "Steam Currency". The currency type set in the user Steam account. For Example, "PHP" or "USD".

    • Index - The Index from the Friends List.

  • getSteamID - Returns the "Steam ID". The Steam identifier.

    • Index - The Index from the Friends List.


Get Friends List :: Tags :

  • getTag - Returns a "Tag" from the tags which have been associated with this friend.

    • Index - The Index from the Friends List.

    • TagIndex - The Index from the Friend Tags List.

  • loopFriendTags - Returns the friend tag index from the "For Each Friend Tag" looped through the friends list and tags list.

  • countTags - Returns the friend's tag count from the friend's tags list.

    • Index - The Index from the Friends List.


Get Friends List :: XBox :

  • getXBoxUserID - Returns the "XBox UserID". The XBox user ID.

    • Index - The Index from the Friends List.


Get Friends List :: Profile :

  • getAvatarURL - Returns the "Avatar URL" of this friend.

    • Index - The Index from the Friends List.

  • getBannedUntil - Returns the "Banned Until" of this friend. If currently banned, the UTC Date when the ban expires.

    • Index - The Index from the Friends List.

  • getCreated - Returns the "Created" of this friend. The Friend recorded created date time.

    • Index - The Index from the Friends List.

  • getPublisherID - Returns the "Publisher ID" of this friend.

    • Index - The Index from the Friends List.

  • getTitleID - Returns the "Title ID" of this friend. Title ID this friend profile applies to.

    • Index - The Index from the Friends List.

  • getTotalUSDValue - Returns the "Total Value To Date In USD" of this friend. Sum of the player's purchases made with real-money currencies, converted to US dollars.

    • Index - The Index from the Friends List.

  • getOrigination - Returns the "Origination" of this friend's account. Either "Unknown", "PlayFab", "Custom", "GameCenter", "GooglePlay", "Steam", "XBoxLive", "PSN", "Kongregate", "Facebook", "IOSDevice", "AndroidDevice", "Twitch", "WindowsHello", "GameServer", "CustomServer", "NintendoSwitch", "FacebookInstantGames" or "OpenIdConnect".

    • Index - The Index from the Friends List.

  • getLastLogin - Returns the "Last Login", the UTC time when the player most recently logged in to the title.

    • Index - The Index from the Friends List.


Get Friends List :: Email :

  • getEmail - Returns a "Contact Email Address" from the friend's Email List.

    • Index - The Index from the Friends List.

    • EmailIndex - The Index from the Friend Email List.

  • getEmailName - Returns the "Email Name" of the current Email from the friend's Email List.

    • Index - The Index from the Friends List.

    • EmailIndex - The Index from the Friend Email List.

  • getEmailStatus - Returns the "Verification Status" of the current Email from the friend's Email List. Either "Unverified", "Pending" or "Confirmed".

    • Index - The Index from the Friends List.

    • EmailIndex - The Index from the Friend Email List.

  • loopFriendEmails - Returns the friend email index from the "For Each Friend Email" looped through the friends list and emails list.

  • countEmails - Returns the friend's email count from the friend's email list.

    • Index - The Index from the Friends List.


Get Friends List :: Location :

  • getCity - Returns the "City" of this friend.

    • Index - The Index from the Friends List.

    • LocationIndex - The Index from the Friend Location List.

  • getContinent - Returns the "Continent Code" of this friend. The two-character continent code, for example "AS" or "NA".

    • Index - The Index from the Friends List.

    • LocationIndex - The Index from the Friend Location List.

  • getCountryCode - Returns the "Country Code" of this friend. The two-character ISO 3166-1 country code, for example "PH" or "US".

    • Index - The Index from the Friends List.

    • LocationIndex - The Index from the Friend Location List.

  • getLatitude - Returns the "Latitude" of this friend. The Latitude coordinate of the geographic location.

    • Index - The Index from the Friends List.

    • LocationIndex - The Index from the Friend Location List.

  • getLongitude - Returns the "Longitude" of this friend. Longitude coordinate of the geographic location.

    • Index - The Index from the Friends List.

    • LocationIndex - The Index from the Friend Location List.

  • loopFriendLocations - Returns the friend location index from the "For Each Friend Location" looped through the friends list and locations list.

  • countLocations - Returns the friend's location count from the friend's location list.

    • Index - The Index from the Friends List.


Get Friends List :: Currency :

  • getCurrency - Returns a "Currency" from the friend's Currency List. The ISO 4217 code of the currency used in the purchases.

    • Index - The Index from the Friends List.

    • CurrencyIndex - The Index from the Friend Currency List.

  • getTotalValue - Returns a "Currency Total Value" from the friend's Currency List.

    • Index - The Index from the Friends List.

    • CurrencyIndex - The Index from the Friend Currency List.

  • getTotalValueDec - Returns a "Currency Total Value in Decimal" from the friend's Currency List. It is in a string representation of decimal monetary units.

    • Index - The Index from the Friends List.

    • CurrencyIndex - The Index from the Friend Currency List.

  • loopFriendCurrencies - Returns the friend currency index from the "For Each Friend Currency" looped through the friends list and currencies list.

  • countCurrencies - Returns the friend's currency count from the friend's currencies list.

    • Index - The Index from the Friends List.


Get Friends List :: Statistics :

  • getStatName - Returns the "Statistic Name" from the friend's Statistic List.

    • Index - The Index from the Friends List.

    • StatisticIndex - The Index from the Friend Statistics List.

  • getStatValue - Returns the "Statistic Value" from the friend's Statistic List.

    • Index - The Index from the Friends List.

    • StatisticIndex - The Index from the Friend Statistics List.

  • getStatVersion - Returns the "Statistic Version" from the friend's Statistic List.

    • Index - The Index from the Friends List.

    • StatisticIndex - The Index from the Friend Statistics List.

  • loopFriendStatistics - Returns the friend currency index from the "For Each Friend Currency" looped through the friends list and currencies list.

  • countStatistics - Returns the friend's currency count from the friend's currencies list.

    • Index - The Index from the Friends List.


Get Friends List :: Linked Accounts :

  • getLinkedEmail - Returns the "Email" of the platform account from the friend's Linked Accounts List, if available.

    • Index - The Index from the Friends List.

    • LinkedIndex - The Index from the Friend Linked Accounts List.

  • getLinkedPlatform - Returns the "Platform" from the friend's Linked Accounts List.  Either "Unknown", "PlayFab" and "Custom", "GameCenter", "GooglePlay", "Steam", "XBoxLive", "Kongregate", "Facebook", "IOSDevice", "AndroidDevice", "WindowsHello", "FacebookInstantGames", etc.

    • Index - The Index from the Friends List.

    • LinkedIndex - The Index from the Friend Linked Accounts List.

  • getLinkedUserID - Returns the "Platform UserID", the Unique Account Identifier of the user on the platform, from the friend's Linked Accounts List.

    • Index - The Index from the Friends List.

    • LinkedIndex - The Index from the Friend Linked Accounts List.

  • getLinkedUsername - Returns the "Username", the account username of the user on the platform, if available from the friend's Linked Accounts List.

    • Index - The Index from the Friends List.

    • LinkedIndex - The Index from the Friend Linked Accounts List.

  • loopLinkedAccounts - Returns the friend linked account index from the "For Each Friend Linked" looped through the friends list and linked accounts list.

  • countLinkedAccounts - Returns the friend's linked accounts count from the friend's linked accounts list.

    • Index - The Index from the Friends List.


Server Response :

  • ServerResponse - Return the "Server Response" from every request from the PlayFab Server. The server response can also be shown in the "Chrome Developer Tools : Console", if in "debug mode".

Request :

  • Tag - Return the "Tag" of the latest request.

 
 
 

Game Project

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Cloud Script

The Friend Manager plugin does friend management on the client-side. Although, ideally getting the friends list and friend information data are best on the client-side. But adding friends and removing friends are ideally should be done on the server-side, hence implementing a request friendship and mutual friend feature. 

Therefore, if doing basic programming in JavaScript is not a problem, you can do the mentioned features through the Cloud Script plugin instead, requesting from your made server function from the PlayFab - Automation feature.

Get the tools

for your pro games!

Constuct Master Collection - Itch.io
Constuct Master Collection - Discord
Constuct Master Collection - Construct 3

© Construct Master Collection 2020 • All rights reserved

Contact Information: