Skip to main content
Version: 1.3.0

User

Provides a function for user information management. You can modify information on avatars, nicknames, language, as well as metadata. The function also allows blocks between users.

Description

The following details callback methods, call methods, and information classes related to user information.

User information

Callback method

// This callback method is relayed when the information of a certain user is changed among those logged in to the channel. It transfers the user's changed information.
public void OnUpdatePlayerInfo(string channelGroup, string channelName, ulong channelNumber, PlayerInfo player) { }

// This callback method is relayed when the nickname of a certain user is changed among those logged in to the chat server. It transfers the user's nicknames before and after the change.
public void OnChangeGamerName(string oldGamerName, string newGamerName) { }

Call method

// This is a method that changes the information of your avatar. It sends the avatar information to be changed.
ChatClient.UpdateAvatar(string avatar)

// This is a method that changes the nickname of your avatar. It sends the nickname to be changed.
ChatClient.UpdateNickname(string nickname)

// This is a method that changes the language information. It sends the language information to be changed.
ChatClient.UpdateLanguage(string language)

// This is a method that changes the metadata. It sends all metadata information. (Overwrites information.)
ChatClient.UpdateMetadata(Dictionary<string, string> metadata)

Description

This call method is related to the function that allows blocks between users.

Blocks between users

Call method

// Imports the nickname list of currently blocked users.
List<string> blockedPlayers = ChatClient.GetBlockGamers();
// This is the user block method. It sends the nickname of the user to be blocked.
ChatClient.SendAddBlockGamer(string gamerName)

// This is the user unblock method. It sends the nickname of the user to be unblocked.
ChatClient.SendRemoveBlockGamer(string gamerName);

Information class

public class PlayerInfo
{
// Player name
public string GamerName = string.Empty;

// Player avatar name
public string Avatar = string.Empty;

// Player language information
public string Language = string.Empty;

// Player metadata
public Dictionary<string, string> Metadata = new Dictionary<string, string>();
}

Blocks between users when using custom authentication

If you are using custom authentication, you must set the endpoint for blocks/unblocks between users to be connected in the BACKND Console.

API settings for blocks between users when using custom authentication

In Console > Chat > Settings menu, you can set the API endpoint for blocks/unblocks between users.

The chat server sends an HTTP request in the following way:

Block API

HTTP request
POST https://auth.mygame.com/block
Headers
Content-Type: application/json; charset=utf8
token: USER_TOKEN
Request body
Property nameTypeValueDescription
sourcestringthebackend-chat-apiRequested server name (BACKND's chat server)
nicknamestringnicknameNickname of the user to be blocked
{
"source": "thebackend-chat-api",
"nickname" : "nickname",
}
Responses

Configure it to return a response with the correct format.
The user information must contain a nickname and uid in a string format.
The uid must be a unique value assigned to each user because users are distinguished using the uid.

The following is an example of the user information sent from the user block API to the chat server:

Status: 200 OK
{
"nickname": "john doe",
"uid": "1234"
}

Unblock API

HTTP request
DELETE https://auth.mygame.com/block
Headers
Content-Type: application/json; charset=utf8
token: USER_TOKEN
Request body
Property nameTypeValueDescription
sourcestringthebackend-chat-apiRequested server name (BACKND's chat server)
uidstringuidUnique value of the user to be unblocked
nicknamestringnicknameNickname of the user to be unblocked
{
"source": "thebackend-chat-api",
"nickname": "john doe",
"uid": "1234"
}
Responses

Configure it to return a response with the correct format.
The user information must contain a nickname and uid in a string format.
The uid must be a unique value assigned to each user because users are distinguished using the uid.

The following is an example of the user information sent from the user unblock API to the chat server:

Status: 200 OK
{
"nickname": "john doe",
"uid": "1234"
}