PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

GetFriendsOnline

This function returns a dictionary array of online friends, limited by the maxFriends value.

In the returned array, some fields are only present for certain location types. For example, PlaceId won’t be present when LocationType is 0 (Mobile Website).

Name Type Description
VisitorId number The Player/UserId of the friend.
UserName string The username of the friend.
LastOnline string When the friend was last online.
IsOnline boolean If the friend is currently online.
LastLocation string The name of the friend's current location.
PlaceId number The place ID of the friend's last location.
GameId string The DataModel/JobId of the friend's last location.
LocationType number The location type of the friend's last location:
0 Mobile Website
1 Mobile InGame
2 Webpage
3 Studio
4 InGame
5 Xbox
6 Team Create

Parameters

Name Type Default Description
int
200

The maximum number of online friends to return. The default is 200.

Returns

Return Type Summary

A dictionary of online friends (see the table above).


Code Samples


Get a List of Online Friends

This example demonstrates how to get a dictionary of a player’s online friends. It returns the maximum number of friends specified by the argument, or 200 if an argument is not provided.