GS2-Friend SDK for Game Engine API Reference
Model
EzProfile
Profile
The profile stores information about the game player.
There are three types of profiles that can be set for each public range.
- friend The information that can be viewed by those with whom a friend relationship has been established.
- follow Content that can be viewed by followers.
- public Content that can be viewed by anyone
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| publicProfile | string | ~ 1024 chars | Public profile Profile information visible to all players regardless of relationship. Typically used for display names, avatars, or other publicly shareable information. | |||
| followerProfile | string | ~ 1024 chars | Profile for followers Profile information visible only to players who follow this user. Can contain more detailed information than the public profile, such as gameplay statistics or status messages. | |||
| friendProfile | string | ~ 1024 chars | Profile for friends Profile information visible only to players who have an established mutual friend relationship. The most private profile level, suitable for sharing personal information like contact details or private messages. |
EzBlackList
Blacklist
Manages a list of users that the player has blocked. Blocked users are prevented from sending friend requests or follow requests to this player, providing a mechanism for players to control unwanted interactions.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| targetUserIds | List<string> | 0 ~ 1000 items | Blacklist user ID list The list of user IDs that this player has blocked. Blocked users cannot send friend requests or follow requests to this player. |
EzFollowUser
Follow User
Represents a user that the current user is following. Provides access to the followed user’s public profile and follower-level profile information, which is visible to followers but not to the general public.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| publicProfile | string | ~ 1024 chars | Public profile The followed user’s publicly visible profile information, accessible to all players. | |||
| followerProfile | string | ~ 1024 chars | Profile for followers The followed user’s profile information visible only to their followers. Contains more detailed information than the public profile. |
EzFriendUser
Friend User
Represents a user who has an established mutual friend relationship with the current user. Provides access to the friend’s public profile and friend-level profile information, which is only visible to confirmed friends.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| publicProfile | string | ~ 1024 chars | Public profile The friend’s publicly visible profile information, accessible to all players. | |||
| friendProfile | string | ~ 1024 chars | Profile for friends The friend’s profile information visible only to confirmed friends. Contains more private information than the public profile. |
EzFriendRequest
Friend Request
Represents a friend request between two players. Contains the sender’s user ID, the recipient’s user ID, and the sender’s public profile for display purposes.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID of the sender of the friend request | ||
| targetUserId | string | ✓ | ~ 128 chars | User ID to whom a friend request was sent | ||
| publicProfile | string | ~ 1024 chars | Public profile The public profile of the friend request sender. Included for display purposes so that the recipient can identify who is requesting friendship. |
EzPublicProfile
Public Profile
A read-only view of a user’s publicly visible profile information. Can be retrieved for any user without requiring a friend or follow relationship. Used for displaying player information in search results, leaderboards, or other public contexts.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| publicProfile | string | ~ 1024 chars | Public profile The user’s publicly visible profile content, accessible without requiring a friend or follow relationship. |
Methods
getProfile
Get the player’s own profile
Retrieves the player’s own profile, including all three visibility levels:
- Public profile: visible to everyone (e.g., player name, avatar)
- Follower profile: visible only to players who follow you (e.g., play style, favorite team)
- Friend profile: visible only to mutual friends (e.g., real name, contact info) Use this to display the “My Profile” or “Edit Profile” screen where the player can see and manage all their profile information.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession |
Result
| Type | Description | |
|---|---|---|
| item | EzProfile | Profile |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Profile(
);
var item = await domain.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Profile(
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Profile(
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Profile(
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Profile(
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Profile(
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Friend::Model::FProfile> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getPublicProfile
Get another player’s public profile
Retrieves only the public portion of the specified player’s profile — the information that is visible to everyone regardless of follow or friend status. For example, this returns their display name, avatar, and level, but NOT their follower-only or friend-only profile data. Use this to show a player card or mini-profile when tapping on another player’s name in rankings, chat, or matchmaking results.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID |
Result
| Type | Description | |
|---|---|---|
| item | EzPublicProfile | Public Profile |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).User(
userId: "user-0001"
).PublicProfile(
);
var item = await domain.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).User(
userId: "user-0001"
).PublicProfile(
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->User(
"user-0001" // userId
)->PublicProfile(
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).User(
userId: "user-0001"
).PublicProfile(
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).User(
userId: "user-0001"
).PublicProfile(
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->User(
"user-0001" // userId
)->PublicProfile(
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Friend::Model::FPublicProfile> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
updateProfile
Update the player’s own profile
Updates the player’s profile with three distinct visibility levels:
- publicProfile: information shown to all players (e.g., display name, level, avatar icon)
- followerProfile: extra information shown only to followers (e.g., “Looking for guild members!”)
- friendProfile: private information shown only to friends (e.g., Discord ID, schedule) Each field is a free-form string, so you can store any text or JSON data. Use this when the player edits their profile from a settings or profile edit screen.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| publicProfile | string | ~ 1024 chars | Public profile Profile information visible to all players regardless of relationship. Typically used for display names, avatars, or other publicly shareable information. | |||
| followerProfile | string | ~ 1024 chars | Profile for followers Profile information visible only to players who follow this user. Can contain more detailed information than the public profile, such as gameplay statistics or status messages. | |||
| friendProfile | string | ~ 1024 chars | Profile for friends Profile information visible only to players who have an established mutual friend relationship. The most private profile level, suitable for sharing personal information like contact details or private messages. |
Result
| Type | Description | |
|---|---|---|
| item | EzProfile | Profile updated |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Profile(
);
var result = await domain.UpdateProfileAsync(
publicProfile: "public",
followerProfile: "follower",
friendProfile: "friend"
);
var item = await result.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Profile(
);
var future = domain.UpdateProfileFuture(
publicProfile: "public",
followerProfile: "follower",
friendProfile: "friend"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Profile(
);
const auto Future = Domain->UpdateProfile(
"public", // publicProfile
"follower", // followerProfile
"friend" // friendProfile
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();describeFollowUsers
Get a list of players the player is following
Retrieves all players that the current player has followed. Following is a one-way relationship — you can follow someone without their approval, like a social media follow. If withProfile is set to true, each followed player’s follower-level profile is also returned (the extra info they share with followers). Use this to build a “Following” list screen where the player can see everyone they follow.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| withProfile | bool | false | Get a profile together | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data |
Result
| Type | Description | |
|---|---|---|
| items | List<EzFollowUser> | List of users that the user follows |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Follow(
withProfile: true
);
var items = await domain.FollowsAsync(
).ToListAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Follow(
withProfile: true
);
var it = domain.Follows(
);
List<EzFollowUser> items = new List<EzFollowUser>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Follow(
true // withProfile
);
const auto It = Domain->Follows(
);
TArray<Gs2::UE5::Friend::Model::FEzFollowUserPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}follow
Follow another player
Adds the specified player to the current player’s follow list. Following is a one-way action that does not require the other player’s approval — it works like a social media follow. After following, the player can see the target player’s follower-level profile information (the extra details they share with followers). Use this for a “Follow” button on another player’s profile, in search results, or in ranking lists.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| targetUserId | string | ✓ | ~ 128 chars | User ID of the person want to follow | ||
| withProfile | bool | ✓ | false | Get a profile together |
Result
| Type | Description | |
|---|---|---|
| item | EzFollowUser | Followed user |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Follow(
withProfile: true
);
var result = await domain.FollowAsync(
targetUserId: "user-0002"
);
var item = await result.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Follow(
withProfile: true
);
var future = domain.FollowFuture(
targetUserId: "user-0002"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Follow(
true // withProfile
);
const auto Future = Domain->Follow(
"user-0002" // targetUserId
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();getFollowUser
Check if a specific player is being followed
Retrieves a specific player from the current player’s follow list. If the target player is in the follow list, their information is returned. If withProfile is true, their follower-level profile is also included. Use this to check whether the player is already following someone — for example, to toggle a “Follow / Unfollow” button on another player’s profile screen.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| withProfile | bool | false | Get a profile together | |||
| targetUserId | string | ✓ | ~ 128 chars | User ID |
Result
| Type | Description | |
|---|---|---|
| item | EzFollowUser | Following user |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Follow(
withProfile: true
).FollowUser(
targetUserId: "user-0002"
);
var item = await domain.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Follow(
withProfile: true
).FollowUser(
targetUserId: "user-0002"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Follow(
true // withProfile
)->FollowUser(
"user-0002" // targetUserId
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Follow(
withProfile: true
).FollowUser(
targetUserId: "user-0002"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Follow(
withProfile: true
).FollowUser(
targetUserId: "user-0002"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Follow(
true // withProfile
)->FollowUser(
"user-0002" // targetUserId
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Friend::Model::FFollowUser> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
unfollow
Unfollow a player
Removes the specified player from the current player’s follow list. After unfollowing, the player will no longer be able to see the target player’s follower-level profile information. Use this for an “Unfollow” button on a followed player’s profile or in the “Following” list screen.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| targetUserId | string | ✓ | ~ 128 chars | User ID | ||
| withProfile | bool | ✓ | false | Get a profile together |
Result
| Type | Description | |
|---|---|---|
| item | EzFollowUser | Unfollowed user |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Follow(
withProfile: true
).FollowUser(
targetUserId: "user-0002"
);
var result = await domain.UnfollowAsync(
); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Follow(
withProfile: true
).FollowUser(
targetUserId: "user-0002"
);
var future = domain.UnfollowFuture(
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
} const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Follow(
true // withProfile
)->FollowUser(
"user-0002" // targetUserId
);
const auto Future = Domain->Unfollow(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();deleteFriend
Remove a player from the friend list
Removes the specified player from the current player’s friend list, ending the mutual friendship. After removal, neither player will be able to see each other’s friend-level profile information. Use this for a “Remove Friend” button on a friend’s profile or detail screen. Consider showing a confirmation dialog since the other player will also lose the friendship.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| targetUserId | string | ✓ | ~ 128 chars | User ID | ||
| withProfile | bool | ✓ | false | Get a profile together |
Result
| Type | Description | |
|---|---|---|
| item | EzFriendUser | Friend deleted |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Friend(
withProfile: true
);
var result = await domain.DeleteFriendAsync(
targetUserId: "user-0002"
); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Friend(
withProfile: true
);
var future = domain.DeleteFriendFuture(
targetUserId: "user-0002"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
} const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Friend(
true // withProfile
);
const auto Future = Domain->DeleteFriend(
"user-0002" // targetUserId
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();describeFriends
Get the player’s friend list
Retrieves all players who are mutual friends with the current player. Unlike following (one-way), friendship is a two-way relationship that is established when a friend request is accepted by both sides. If withProfile is set to true, each friend’s friend-level profile is also returned (the most private level of profile information). Use this to build a “Friends” list screen showing all of the player’s friends — for example, displaying their names, avatars, and online status.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| withProfile | bool | false | Get a profile together | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data |
Result
| Type | Description | |
|---|---|---|
| items | List<EzFriendUser> | List of Friend |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.FriendsAsync(
withProfile: true
).ToListAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.Friends(
withProfile: true
);
List<EzFriendUser> items = new List<EzFriendUser>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto It = Domain->Friends(
true // withProfile
);
TArray<Gs2::UE5::Friend::Model::FEzFriendUserPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeFriends(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeFriends(callbackId); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeFriends(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeFriends(callbackId); const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
// Start event handling
const auto CallbackId = Domain->SubscribeFriends(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeFriends(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getFriend
Get a specific friend’s information
Retrieves information about a specific player from the current player’s friend list. If withProfile is true, the friend’s friend-level profile (the most private tier of profile data) is also returned. Use this to display a friend’s detail screen — for example, showing their full profile, stats, and options like “Remove Friend” or “Send Message”.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| targetUserId | string | ✓ | ~ 128 chars | User ID | ||
| withProfile | bool | false | Get a profile together |
Result
| Type | Description | |
|---|---|---|
| item | EzFriendUser | Friend |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Friend(
withProfile: true
).FriendUser(
targetUserId: "user-0002"
);
var item = await domain.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Friend(
withProfile: true
).FriendUser(
targetUserId: "user-0002"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Friend(
true // withProfile
)->FriendUser(
"user-0002" // targetUserId
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Friend(
withProfile: true
).FriendUser(
targetUserId: "user-0002"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Friend(
withProfile: true
).FriendUser(
targetUserId: "user-0002"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Friend(
true // withProfile
)->FriendUser(
"user-0002" // targetUserId
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Friend::Model::FFriendUser> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
deleteRequest
Cancel a sent friend request
Cancels a friend request that the player previously sent, before the other player responds. The request is removed from both the sender’s outbox and the recipient’s inbox. Use this for a “Cancel Request” button on the sent requests screen or on a player’s profile where a request is already pending.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| targetUserId | string | ✓ | ~ 128 chars | User ID |
Result
| Type | Description | |
|---|---|---|
| item | EzFriendRequest | Friend Request deleted |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SendFriendRequest(
targetUserId: "user-0002"
);
var result = await domain.DeleteRequestAsync(
); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SendFriendRequest(
targetUserId: "user-0002"
);
var future = domain.DeleteRequestFuture(
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
} const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->SendFriendRequest(
"user-0002" // targetUserId
);
const auto Future = Domain->DeleteRequest(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();describeSendRequests
Get a list of outgoing friend requests
Retrieves all friend requests that the current player has sent and are still waiting for a response. Each request shows who it was sent to and when. The player can cancel pending requests if they change their mind. Use this to build a “Sent Requests” screen — for example, showing “Waiting for PlayerB to respond… [Cancel]”.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession |
Result
| Type | Description | |
|---|---|---|
| items | List<EzFriendRequest> | List of Friend Request |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.SendRequestsAsync(
).ToListAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.SendRequests(
);
List<EzFriendRequest> items = new List<EzFriendRequest>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto It = Domain->SendRequests(
);
TArray<Gs2::UE5::Friend::Model::FEzFriendRequestPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}getSendRequest
Get a specific outgoing friend request
Retrieves the details of a friend request that the current player has sent to a specific player. Use this to display the status of a specific sent request — for example, checking whether a request to a particular player is still pending, or showing request details on a player profile screen.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| targetUserId | string | ✓ | ~ 128 chars | User ID |
Result
| Type | Description | |
|---|---|---|
| item | EzFriendRequest | Friend Request |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SendFriendRequest(
targetUserId: "user-0002"
);
var item = await domain.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SendFriendRequest(
targetUserId: "user-0002"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->SendFriendRequest(
"user-0002" // targetUserId
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SendFriendRequest(
targetUserId: "user-0002"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SendFriendRequest(
targetUserId: "user-0002"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->SendFriendRequest(
"user-0002" // targetUserId
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Friend::Model::FSendFriendRequest> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
sendRequest
Send a friend request to another player
Sends a friend request to the specified player. The request will appear in their inbox, and they can accept or reject it. If accepted, both players become mutual friends and can see each other’s friend-level profile. Note: if the player already has 1000 friends, the request cannot be sent. Also, if there are existing pending requests, the oldest unanswered request is automatically withdrawn to make room for the new one. Use this for a “Send Friend Request” button on another player’s profile or in search results.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| targetUserId | string | ✓ | ~ 128 chars | User ID of the person want to be friend |
Result
| Type | Description | |
|---|---|---|
| item | EzFriendRequest | Sent Friend Request |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var result = await domain.SendRequestAsync(
targetUserId: "user-0002"
);
var item = await result.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var future = domain.SendRequestFuture(
targetUserId: "user-0002"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto Future = Domain->SendRequest(
"user-0002" // targetUserId
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();accept
Accept a friend request
Accepts an incoming friend request from the specified player. Once accepted, a mutual friendship is established — both players are added to each other’s friend lists and can see each other’s friend-level profile information. Use this for the “Accept” button on a friend request notification or in the friend request inbox.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| fromUserId | string | ✓ | ~ 128 chars | User ID |
Result
| Type | Description | |
|---|---|---|
| item | EzFriendRequest | Accepted Friend Request |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).ReceiveFriendRequest(
fromUserId: "user-0002"
);
var result = await domain.AcceptAsync(
); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).ReceiveFriendRequest(
fromUserId: "user-0002"
);
var future = domain.AcceptFuture(
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
} const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->ReceiveFriendRequest(
nullptr, // targetUserId
"user-0002" // fromUserId
);
const auto Future = Domain->Accept(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();describeReceiveRequests
Get a list of incoming friend requests
Retrieves all friend requests that other players have sent to the current player and are waiting for a response. Each request shows who sent it and when. The player can then accept or reject each one. Use this to build a “Friend Requests” inbox screen — for example, showing “PlayerA wants to be your friend! [Accept] [Reject]”.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession |
Result
| Type | Description | |
|---|---|---|
| items | List<EzFriendRequest> | List of Friend request |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.ReceiveRequestsAsync(
).ToListAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.ReceiveRequests(
);
List<EzFriendRequest> items = new List<EzFriendRequest>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto It = Domain->ReceiveRequests(
);
TArray<Gs2::UE5::Friend::Model::FEzFriendRequestPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}getReceiveRequest
Get a specific incoming friend request
Retrieves the details of a friend request from a specific sender. Use this to display a friend request detail screen — for example, showing the sender’s profile and when the request was sent, along with “Accept” and “Reject” buttons.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| fromUserId | string | ✓ | ~ 128 chars | User ID |
Result
| Type | Description | |
|---|---|---|
| item | EzFriendRequest | Friend request |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).ReceiveFriendRequest(
targetUserId: null,
fromUserId: "user-0002"
);
var item = await domain.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).ReceiveFriendRequest(
targetUserId: null,
fromUserId: "user-0002"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->ReceiveFriendRequest(
nullptr, // targetUserId
"user-0002" // fromUserId
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).ReceiveFriendRequest(
targetUserId: null,
fromUserId: "user-0002"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).ReceiveFriendRequest(
targetUserId: null,
fromUserId: "user-0002"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->ReceiveFriendRequest(
nullptr, // targetUserId
"user-0002" // fromUserId
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Friend::Model::FReceiveFriendRequest> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
reject
Reject a friend request
Rejects an incoming friend request from the specified player. The request is deleted and no friendship is established. The sender is not notified that the request was rejected. Use this for the “Reject” or “Decline” button on a friend request notification or in the friend request inbox.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| fromUserId | string | ✓ | ~ 128 chars | User ID |
Result
| Type | Description | |
|---|---|---|
| item | EzFriendRequest | Rejected friend request |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).ReceiveFriendRequest(
fromUserId: "user-0002"
);
var result = await domain.RejectAsync(
); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).ReceiveFriendRequest(
fromUserId: "user-0002"
);
var future = domain.RejectFuture(
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
} const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->ReceiveFriendRequest(
nullptr, // targetUserId
"user-0002" // fromUserId
);
const auto Future = Domain->Reject(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();getBlackList
Get the player’s block list
Retrieves a list of user IDs that the current player has blocked. Blocked players cannot send friend requests to or follow the current player. Use this to build a “Blocked Players” management screen where the player can review and unblock people they’ve previously blocked.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession |
Result
| Type | Description | |
|---|---|---|
| items | List<string> | Blacklisted user ID list |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.BlackListUsersAsync(
).ToListAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.BlackListUsers(
);
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto It = Domain->BlackListUsers(
);
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}registerBlackList
Block a player
Adds the specified player to the current player’s block list. Once blocked, the target player will not be able to send friend requests to or follow the current player. Use this for a “Block” button on another player’s profile screen or in a report/moderation menu. This helps players protect themselves from unwanted interactions.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| targetUserId | string | ✓ | ~ 128 chars | User ID |
Result
| Type | Description | |
|---|---|---|
| item | EzBlackList | blacklist |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BlackList(
);
var result = await domain.RegisterBlackListAsync(
targetUserId: "user-0002"
);
var item = await result.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BlackList(
);
var future = domain.RegisterBlackListFuture(
targetUserId: "user-0002"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->BlackList(
);
const auto Future = Domain->RegisterBlackList(
"user-0002" // targetUserId
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();unregisterBlackList
Unblock a player
Removes the specified player from the current player’s block list. After unblocking, the target player will be able to send friend requests and follow the current player again. Use this for an “Unblock” button on the blocked players management screen or on a blocked player’s profile.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| targetUserId | string | ✓ | ~ 128 chars | User ID |
Result
| Type | Description | |
|---|---|---|
| item | EzBlackList | Blacklist |
Implementation Example
var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BlackList(
);
var result = await domain.UnregisterBlackListAsync(
targetUserId: "user-0002"
);
var item = await result.ModelAsync(); var domain = gs2.Friend.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BlackList(
);
var future = domain.UnregisterBlackListFuture(
targetUserId: "user-0002"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Friend->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->BlackList(
);
const auto Future = Domain->UnregisterBlackList(
"user-0002" // targetUserId
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();Event Handler
OnFollowNotification
Push notification to be used when you are followed
| Name | Type | Description |
|---|---|---|
| namespaceName | string | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string | User ID |
| fromUserId | string | User ID |
Implementation Example
gs2.Friend.OnFollowNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var fromUserId = notification.FromUserId;
}; gs2.Friend.OnFollowNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var fromUserId = notification.FromUserId;
}; Gs2->Friend->OnFollowNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto UserId = Notification->UserIdValue;
const auto FromUserId = Notification->FromUserIdValue;
});OnAcceptRequestNotification
Push notification used when a friend request is approved
| Name | Type | Description |
|---|---|---|
| namespaceName | string | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string | User ID |
| targetUserId | string | User ID |
Implementation Example
gs2.Friend.OnAcceptRequestNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var targetUserId = notification.TargetUserId;
}; gs2.Friend.OnAcceptRequestNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var targetUserId = notification.TargetUserId;
}; Gs2->Friend->OnAcceptRequestNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto UserId = Notification->UserIdValue;
const auto TargetUserId = Notification->TargetUserIdValue;
});OnRejectRequestNotification
Push notification used when a friend request is rejected
| Name | Type | Description |
|---|---|---|
| namespaceName | string | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string | User ID |
| targetUserId | string | User ID |
Implementation Example
gs2.Friend.OnRejectRequestNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var targetUserId = notification.TargetUserId;
}; gs2.Friend.OnRejectRequestNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var targetUserId = notification.TargetUserId;
}; Gs2->Friend->OnRejectRequestNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto UserId = Notification->UserIdValue;
const auto TargetUserId = Notification->TargetUserIdValue;
});OnDeleteFriendNotification
Push notification used when a friend is deleted
| Name | Type | Description |
|---|---|---|
| namespaceName | string | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string | User ID |
| fromUserId | string | User ID |
Implementation Example
gs2.Friend.OnDeleteFriendNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var fromUserId = notification.FromUserId;
}; gs2.Friend.OnDeleteFriendNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var fromUserId = notification.FromUserId;
}; Gs2->Friend->OnDeleteFriendNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto UserId = Notification->UserIdValue;
const auto FromUserId = Notification->FromUserIdValue;
});OnReceiveRequestNotification
Push notification used when a friend request is received
| Name | Type | Description |
|---|---|---|
| namespaceName | string | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string | User ID |
| fromUserId | string | User ID |
Implementation Example
gs2.Friend.OnReceiveRequestNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var fromUserId = notification.FromUserId;
}; gs2.Friend.OnReceiveRequestNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var fromUserId = notification.FromUserId;
}; Gs2->Friend->OnReceiveRequestNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto UserId = Notification->UserIdValue;
const auto FromUserId = Notification->FromUserIdValue;
});OnCancelRequestNotification
Push notification used when a friend request is canceled
| Name | Type | Description |
|---|---|---|
| namespaceName | string | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string | User ID |
| fromUserId | string | User ID |
Implementation Example
gs2.Friend.OnCancelRequestNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var fromUserId = notification.FromUserId;
}; gs2.Friend.OnCancelRequestNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var fromUserId = notification.FromUserId;
}; Gs2->Friend->OnCancelRequestNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto UserId = Notification->UserIdValue;
const auto FromUserId = Notification->FromUserIdValue;
});