TSS Developer Doc
1. Overview
TSS is provided by Tencent ACE team, TSS needs to submit relevant information when calling some APIs involving user input. This document introduces how game client development engineers submit information in different scenarios.
Please set the TSS configuration first on the portal.
The following table lists the request parameters that require content moderation for all API requests in PGOS. Each of these request parameters defines a scenario.
Developers can judge the function of the scene according to the func_name
and field requiring content moderation
.
- | module | func_name | scene_name | func_params example | field requiring content moderation |
---|---|---|---|---|---|
1 | Friend | AddFriend | Friend_AddFriend_message | {"player_id": "86593774", "message": "str"} | message |
2 | Friend | BatchAddFriend | Friend_BatchAddFriend_message | {"player_ids": ["str1", "str2", "str3"], "message": "str"} | message |
3 | Friend | SearchPlayers | Friend_SearchPlayers_search_key | {"search_key": "str", "offset": 15, "count": 15} | search_key |
4 | Friend | SearchPlayersWithFilter | Friend_SearchPlayersWithFilter_search_key | {"search_key": "str", "search_filter": 0, "offset": 15, "count": 15} | search_key |
5 | Friend | SetFriendRemark | Friend_SetFriendRemark_remark | {"player_id": "86593774", "remark": "str"} | remark |
6 | Group | CreateGroup | Group_CreateGroup_name | {"name": "str", "icon": "str", "description": "str", "tags": ["str1", "str2", "str3"], "join_rule": 0, "is_public": false} | name |
7 | Group | CreateGroup | Group_CreateGroup_description | {"name": "str", "icon": "str", "description": "str", "tags": ["str1", "str2", "str3"], "join_rule": 0, "is_public": false} | description |
8 | Group | CreateGroup | Group_CreateGroup_tags | {"name": "str", "icon": "str", "description": "str", "tags": ["str1", "str2", "str3"], "join_rule": 0, "is_public": false} | tags |
9 | Group | SearchGroup | Group_SearchGroup_tags_filter | {"official_filter": 0, "left_room_filter": 0, "tags_filter": ["str1", "str2", "str3"], "order_by": 0, "order_type": 0, "offset": 15, "count": 15} | tags_filter |
10 | Group | InvitePlayersToGroup | Group_InvitePlayersToGroup_invite_msg | {"group_id": "1016", "invite_msg": "str", "player_ids": ["str1", "str2", "str3"]} | invite_msg |
11 | Group | SetMyGroupNickname | Group_SetMyGroupNickname_nickname | {"group_id": "1016", "nickname": "str"} | nickname |
12 | Group | SetGroupName | Group_SetGroupName_group_name | {"group_id": "1016", "group_name": "str"} | group_name |
13 | Group | SetGroupDesc | Group_SetGroupDesc_group_description | {"group_id": "1016", "group_description": "str"} | group_description |
14 | Group | SetGroupAnnouncement | Group_SetGroupAnnouncement_group_announcement | {"group_id": "1016", "group_announcement": "str"} | group_announcement |
15 | Group | SetGroupTags | Group_SetGroupTags_tags | {"group_id": "1016", "tags": ["str1", "str2", "str3"]} | tags |
16 | Group | SetGroupMemberRemark | Group_SetGroupMemberRemark_remark | {"group_id": "1016", "player_id": "86593774", "remark": "str"} | remark |
17 | Group | BatchSetGroupMemberRemark | Group_BatchSetGroupMemberRemark_remark | {"group_id": "1016", "player_ids": ["str1", "str2", "str3"], "remark": "str"} | remark |
18 | Group | SendGroupTextMsg | Group_SendGroupTextMsg_content | {"group_id": "1016", "content": "str", "custom_data": "str"} | content |
19 | Group | SendGroupCustomMsg | Group_SendGroupCustomMsg_content | {"group_id": "1016", "content": "str", "custom_data": "str"} | content |
20 | InstantChat | SendInstantChatTextMsg | InstantChat_SendInstantChatTextMsg_content | {"chat_channel_id": "channel_4567_team", "content": "str", "custom_data": "str"} | content |
21 | InstantChat | SendInstantChatCustomMsg | InstantChat_SendInstantChatCustomMsg_content | {"chat_channel_id": "channel_4567_team", "content": "str", "custom_data": "str"} | content |
22 | Lobby | CreateLobby | Lobby_CreateLobby_name | {"lobby_config": "str", "name": "str", "privacy": 0, "password": "str", "enable_chatting": false, "kv_data": {"key1": "value1", "key2": "value2", "key3": "value3"}} | name |
23 | Lobby | EditLobbyInfo | Lobby_EditLobbyInfo_name | {"name": "str", "privacy": 0, "password": "str", "kv_data": {"key1": "value1", "key2": "value2", "key3": "value3"}} | name |
24 | Lobby | SendLobbyChatTextMsg | Lobby_SendLobbyChatTextMsg_content | {"content": "str", "custom_data": "str"} | content |
25 | Lobby | SendLobbyChatCustomMsg | Lobby_SendLobbyChatCustomMsg_content | {"content": "str", "custom_data": "str"} | content |
26 | Party | CreateParty | Party_CreateParty_party_name | {"party_name": "str", "max_player": 15, "enable_chatting": false} | party_name |
27 | Party | SendPartyChatTextMsg | Party_SendPartyChatTextMsg_content | {"content": "str", "custom_data": "str"} | content |
28 | Party | SendPartyChatCustomMsg | Party_SendPartyChatCustomMsg_content | {"content": "str", "custom_data": "str"} | content |
29 | PersonalChat | SendPersonalTextMsg | PersonalChat_SendPersonalTextMsg_content | {"peer_player_id": "86593774", "content": "str", "custom_data": "str"} | content |
30 | PersonalChat | SendPersonalCustomMsg | PersonalChat_SendPersonalCustomMsg_content | {"peer_player_id": "86593774", "content": "str", "custom_data": "str"} | content |
31 | PlayerProfile | SetMyName | PlayerProfile_SetMyName_display_name | "display_name" | display_name |
32 | PublicChat | SendPublicChatTextMsg | PublicChat_SendPublicChatTextMsg_content | {"channel_name": "channel_4567_team", "content": "str", "custom_data": "str"} | content |
33 | PublicChat | SendPublicChatCustomMsg | PublicChat_SendPublicChatCustomMsg_content | {"channel_name": "channel_4567_team", "content": "str", "custom_data": "str"} | content |
2. How to Report TSS Information
When the APIs listed in the table above are called, PGOS SDK will throw an event callback to the game, and game developers can fill in TSS information in the callback according to the game's needs.
The event callback is described as follows:
2.1 Description of the Event Callback
/**
* OnTssHandled:
* When some apis are called, if the api requires TSS information, this event will be triggered, and the game needs to return TSS information in this event.
*
* @param In Context information of the API that triggered the event callback.
* @param Out TSS information that needs to be filled.
*/
DECLARE_DELEGATE_TwoParams(FOnTssHandled, const FClientTssHandledIn& /*In*/, FClientTssHandledOut& /*Out*/);
FOnTssHandled& OnTssHandled() { return TssHandledDelegate; }
FClientTssHandledIn: Contextual information of the API.
- scene_name: Each API request parameter that requires content moderation will define a scenario.
- module: The module to which the API belongs.
- func_name: API's name.
- func_params: API request parameters are serialized as json strings. Developer can parse this json to get the information when calling the api.
FClientTssHandledOut: TSS information that needs to be filled. The game needs to fill the corresponding TSS information according to
FClientTssHandledIn
.- scene_id: The scene id defined by the game in the TSS system.
- account_info: Account info required by TSS.
- extra: Extra info required by TSS. Generally, it is a string in json format. When converting to a json string, avoid extra newlines and indentation when generating the json string.
Here are two scenes to illustrate FClientTssHandledIn:
Scene 1:Friend_AddFriend_message
The corresponding API is
AddFriend
, and the field that needs to content moderation ismessage
in the request parameter of this API. Then the meaning of this scene means "request information when adding a friend". The request parameter ofAddFriend
isFClientAddFriendParams
, func_params is the string of the request parameter (FClientAddFriendParams
) after the json serialization when the API triggers the event callback.void SomeUObjectClass::AddFriend()
{
FClientAddFriendParams Params;
Params.player_id = "123456";
Params.message = "hello, i'm mike";
auto friend = IPgosSDKCpp::Get().GetClientFriendAPI();
if (friend)
{
friend->AddFriend(Params, [](const FPgosResult& Ret) {
UE_LOG(LogTemp, Log, TEXT("OnAddFriend: err_code=%d"), Ret.err_code);
});
}
}The request parameters when calling
AddFriend
to add friends are as above code, and the value of func_params at this time is{"player_id": "123456", "message": "hello, i'm mike"}
scene 2:PlayerProfile_SetMyName_display_name The corresponding API is
SetMyName
, and the field that needs to content moderation isdisplay_name
in the request parameter of this API. Then the meaning of this scene means "modify the name of the current player". The request parameter ofSetMyName
isDisplayName
, func_params is the json serialized string of the request parameter (DisplayName
) when the API triggers the event callback.void SomeUObjectClass::SomeFunction()
{
auto PlayerProfile = IPgosSDKCpp::Get().GetClientPlayerProfileAPI();
if (PlayerProfile)
{
FString DisplayName = TEXT("ConfusedGirl");
PlayerProfile->SetMyName(DisplayName, [](const FPgosResult& Ret) {
UE_LOG(LogTemp, Log, TEXT("SetMyName: err_code=%d"), Ret.err_cod);
});
}
}The request parameters when calling
SetMyName
to modify the current player name are as the above code, at this time the value of func_params is"ConfusedGirl"
Call OnTssHandled
from System module as follows:
#include "PgosSDKCpp.h"
void SomeClass::RegisterTssCallback()
{
IPgosSDKCpp::Get().GetClientSystemAPI()->OnTssHandled().BindLambda([this](const FClientTssHandledIn& In, FClientTssHandledOut& Out) {
UE_LOG(LogTemp, Log, TEXT("OnTssHandled: scene_name=%s, func_name=%s"), *In.scene_name, *In.func_name);
});
}
❗ Note: All scene names have defined macros. It is recommended to use macros when using them. The definition of macros is in PgosTssDefine.h
The event callback and the PGOS API that triggers the event callback are executed in the same thread, and most of these APIs are executed on the game thread. In order to avoid getting stuck in the game thread, it is forbidden to perform time-consuming operations in the event callback
2.2 Example
Here is an example of using PGOS's TSS event callback to report TSS information. The general steps when using are as follows:
- Register the global event callback
IPgosSDKCpp::Get().GetClientSystemAPI()->OnTssHandled()
, for example, in the Subsystem.
- Register the global event callback
- In the callback function, handle different scenarios separately by using macros in
PgosTssDefine.h
to avoid errors caused by changes in scene names.
- In the callback function, handle different scenarios separately by using macros in
- The
func_params
field inFClientTssHandledIn
contains the API request parameter structure for different scenarios.
- The
- Fill the required information, such as the scene ID, according to the needs. Refer to the TSS official documentation to fill in
FClientTssHandledOut
.
- Fill the required information, such as the scene ID, according to the needs. Refer to the TSS official documentation to fill in
- The
extra
field inFClientTssHandledOut
generally requires a JSON-formatted string. When converting to a JSON string, it is recommended to useTCondensedJsonPrintPolicy<TCHAR>
to avoid generating unnecessary line breaks and indentation.
- The
#pragma once
#include "CoreMinimal.h"
#include "Subsystems/GameInstanceSubsystem.h"
#include "TssSubsystem.generated.h"
UCLASS()
class PGOSSHOOTER_API UTssSubsystem : public UGameInstanceSubsystem
{
GENERATED_BODY()
public:
static UTssSubsystem* Get()
{
return Instance;
}
void Init();
protected:
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
virtual void Deinitialize() override;
private:
void RegisterTssCallback();
static UTssSubsystem* Instance;
};
#include "TssSubsystem.h"
#include "PgosSDKCpp.h"
UTssSubsystem* UTssSubsystem::Instance;
void UTssSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
Super::Initialize(Collection);
Instance = this;
}
void UTssSubsystem::Deinitialize()
{
Super::Deinitialize();
Instance = nullptr;
const auto SystemAPI = IPgosSDKCpp::Get().GetClientSystemAPI();
if (SystemAPI) {
SystemAPI->OnTssHandled().Unbind();
}
}
void UTssSubsystem::Init() {
RegisterTssCallback();
}
// It is recommended to call the registration function after successfully logging in to PGOS
void UTssSubsystem::RegisterTssCallback()
{
const auto SystemAPI = IPgosSDKCpp::Get().GetClientSystemAPI();
if (!SystemAPI) {
return;
}
SystemAPI->OnTssHandled().BindLambda([this](const FClientTssHandledIn& In, FClientTssHandledOut& Out) {
Out.account_info.account = "1234567";
Out.account_info.role_name = "display_name";
Out.account_info.area_id = 1;
Out.account_info.plat_id = 3;
// ...
if (In.scene_name == TssScenePlayerProfileSetMyNameDisplayName)
{
// set player's display_name
// API name is "SetMyName"
// The corresponding request parameter(DisplayName)'s type is FString
// func_params is a string in this format: "\"display_name\""
Out.scene_id = 101;
FString ExtraJsonString;
TSharedPtr<FJsonObject> ExtraJsonObject = MakeShareable(new FJsonObject);
const auto JsonWriter = TJsonWriterFactory<TCHAR, TCondensedJsonPrintPolicy<TCHAR>>::Create(&ExtraJsonString);
FJsonSerializer::Serialize(ExtraJsonObject.ToSharedRef(), JsonWriter);
Out.extra = ExtraJsonString;
}
else if (In.scene_name == TssSceneGroupSetGroupNameGroupName)
{
// modify group's name
// API name is "SetGroupName"
// The corresponding request parameter(Params)'s type is FClientSetGroupNameParams
// func_params is the json formatted by the structure FClientSetGroupNameParams
Out.scene_id = 2003;
const auto ParamsJson = In.FuncParamsAsJson();
if (ParamsJson && ParamsJson->Type == EJson::Object)
{
const auto ParamsJsonObject = ParamsJson->AsObject();
const auto TalkGroupId = ParamsJsonObject->GetStringField("group_id");
FString ExtraJsonString;
TSharedPtr<FJsonObject> ExtraJsonObject = MakeShareable(new FJsonObject);
ExtraJsonObject->SetStringField("talk_group_id", TalkGroupId);
const auto JsonWriter = TJsonWriterFactory<TCHAR, TCondensedJsonPrintPolicy<TCHAR>>::Create(&ExtraJsonString);
FJsonSerializer::Serialize(ExtraJsonObject.ToSharedRef(), JsonWriter);
Out.extra = ExtraJsonString;
}
}
else if (In.scene_name == TssScenePersonalChatSendPersonalTextMsgContent || In.scene_name == TssScenePersonalChatSendPersonalCustomMsgContent)
{
// Multiple scenes in PGOS may correspond to the same scene in the game
Out.scene_id = 2002;
const auto ParamsJson = In.FuncParamsAsJson();
if (ParamsJson && ParamsJson->Type == EJson::Object)
{
const auto ParamsJsonObject = ParamsJson->AsObject();
const auto PeerPlayerId = ParamsJsonObject->GetStringField("peer_player_id");
FString ExtraJsonString;
TSharedPtr<FJsonObject> ExtraJsonObject = MakeShareable(new FJsonObject);
ExtraJsonObject->SetStringField("peer_player_id", PeerPlayerId);
ExtraJsonObject->SetNumberField("msg_type", 0);
const auto JsonWriter = TJsonWriterFactory<TCHAR, TCondensedJsonPrintPolicy<TCHAR>>::Create(&ExtraJsonString);
FJsonSerializer::Serialize(ExtraJsonObject.ToSharedRef(), JsonWriter);
Out.extra = ExtraJsonString;
}
}
// ...
});
}
3. Referenced APIs
3.1 AddFriend
/**
* Add the player to my friend list.
* If the peer player is online, he will receive an OnAddFriendRequest event.
* If the peer player is not online, he can call GetReceivedFriendRequests API when he goes online later to know that someone wants to add him as a friend.
* Only after the peer player accepts your friend request can the two of you become friends with each other.
*
* @param Params Request struct for add friend
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void AddFriend(
const FClientAddFriendParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
struct FClientAddFriendParams
{
/** The player id to add */
FString player_id;
/** Request message */
FString message;
};
3.2 BatchAddFriend
/**
* Add players to my friend list.
*
* @param Params Request struct for batch add friend
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void BatchAddFriend(
const FClientBatchAddFriendParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientBatchAddFriendRsp* Data)> ResultCallback) const;
struct FClientBatchAddFriendParams
{
/** The player ids to add */
TArray<FString> player_ids;
/** Request message */
FString message;
};
3.3 SearchPlayers
/**
* Search for players.
*
* @param Params Request struct for search players.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SearchPlayers(
const FClientSearchPlayersParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientPlayerSearchInfoList* Data)> ResultCallback) const;
struct FClientSearchPlayersParams
{
/** Key words to for searching, now only supports searching based on player id and player name. Search results are paged back. */
FString search_key;
/** Index of the first data in all search results. */
int32 offset;
/** Maximum count of results returned in one page, the maximum value of 'count' is 50 */
int32 count;
};
3.4 SearchPlayersWithFilter
/**
* Search for players with filter.
*
* @param Params Request struct for search players with filter
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SearchPlayersWithFilter(
const FClientSearchPlayersWithFilterParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientPlayerSearchInfoList* Data)> ResultCallback) const;
struct FClientSearchPlayersWithFilterParams
{
/** Key words to for searching, now only supports searching based on player id and player name. Search results are paged back. */
FString search_key;
/** Filter by OS etc.. */
FClientSearchPlayerFilter search_filter;
/** Index of the first data in all search results. */
int32 offset;
/** Maximum count of results returned in one page, the maximum value of 'count' is 50 */
int32 count;
};
3.5 SetFriendRemark
/**
* Set remark to your friend, for example, "Tommy, a humorous man, met in the battle.", Max remark length: 32 characters.
*
* @param Params Request struct for set friend remark
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetFriendRemark(
const FClientSetFriendRemarkParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
struct FClientSetFriendRemarkParams
{
/** Player's ID */
FString player_id;
/** remark to the friend */
FString remark;
};
3.6 CreateGroup
/**
* Creat a new group.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void CreateGroup(
const FClientCreateGroupParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientGroupDetail* Data)> ResultCallback) const;
struct FClientCreateGroupParams
{
/** The group name. */
FString name;
/** Uri of the group. */
FString icon;
/** The description of the group. */
FString description;
/** Custom tags of the group. */
TArray<FString> tags;
/** The rules for players to join the group. */
EClientGroupJoinRule join_rule;
/** Could or couldn't be seen by player not in the group. */
bool is_public;
};
3.7 SearchGroup
/**
* Search for groups that meet the specified criteria.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SearchGroup(
const FClientSearchGroupParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientSearchGroupRsp* Data)> ResultCallback) const;
struct FClientSearchGroupParams
{
/** The search count */
EClientGroupOfficialFilterType official_filter;
/** The search count */
EClientGroupRoomFilterType left_room_filter;
/** The search count */
TArray<FString> tags_filter;
/** The search count */
EClientGroupOrderBy order_by;
/** The search count */
EClientGroupOrderType order_type;
/** The starting position of the search */
int32 offset;
/** The search count */
int32 count;
};
3.8 InvitePlayersToGroup
/**
* Invite some players to the group. Each player be invited will receive a OnGroupInvitation event.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void InvitePlayersToGroup(
const FClientInvitePlayersToGroupParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientInvitePlayersToGroupRsp* Data)> ResultCallback) const;
struct FClientInvitePlayersToGroupParams
{
/** */
FString group_id;
/** */
FString invite_msg;
/** */
TArray<FString> player_ids;
};
3.9 SetMyGroupNickname
/**
* Set player's nickname of the group.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetMyGroupNickname(
const FClientSetMyGroupNicknameParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
struct FClientSetMyGroupNicknameParams
{
/** */
FString group_id;
/** */
FString nickname;
};
3.10 SetGroupName
/**
* Set name of the group. Group name could only be set by the group owner.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetGroupName(
const FClientSetGroupNameParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientUpdateGroupRsp* Data)> ResultCallback) const;
struct FClientSetGroupNameParams
{
/** Group ID. */
FString group_id;
/** Group name. */
FString group_name;
};
3.11 SetGroupDesc
/**
* Set description of the group. Group description could only be set by the group owner or administrator.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetGroupDesc(
const FClientSetGroupDescParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientUpdateGroupRsp* Data)> ResultCallback) const;
struct FClientSetGroupDescParams
{
/** */
FString group_id;
/** */
FString group_description;
};
3.12 SetGroupAnnouncement
/**
* Set announcement of the group. Group announcement could only be set by the group owner or administrator.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetGroupAnnouncement(
const FClientSetGroupAnnouncementParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientUpdateGroupRsp* Data)> ResultCallback) const;
struct FClientSetGroupAnnouncementParams
{
/** */
FString group_id;
/** */
FString group_announcement;
};
3.13 SetGroupTags
/**
* Set tags of the group. Group tags could only be set by the group owner or administrator.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetGroupTags(
const FClientSetGroupTagsParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientGroupDetail* Data)> ResultCallback) const;
struct FClientSetGroupTagsParams
{
/** */
FString group_id;
/** */
TArray<FString> tags;
};
3.14 SetGroupMemberRemark
/**
* Group owner and group administrator could use this api to set a group member's remark.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetGroupMemberRemark(
const FClientSetGroupMemberRemarkParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
struct FClientSetGroupMemberRemarkParams
{
/** */
FString group_id;
/** */
FString player_id;
/** */
FString remark;
};
3.15 BatchSetGroupMemberRemark
/**
* Batch set remark for group members.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void BatchSetGroupMemberRemark(
const FClientBatchSetGroupMemberRemarkParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
struct FClientBatchSetGroupMemberRemarkParams
{
/** */
FString group_id;
/** */
TArray<FString> player_ids;
/** */
FString remark;
};
3.16 SendGroupTextMsg
/**
* Send group chat text message
*
* @param Params Request struct for sending text message
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendGroupTextMsg(
const FClientSendGroupMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientSendGroupMsgResult* Data)> ResultCallback) const;
struct FClientSendGroupMsgParams
{
/** Group ID */
FString group_id;
/** Content, content length cannot exceed 1024 characters */
FString content;
/** Additional information added by the game, content size cannot exceed 8KB (in utf8 encoding) */
FString custom_data;
};
3.17 SendGroupCustomMsg
/**
* Send group chat custom message
*
* @param Params Request struct for sending custom message
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendGroupCustomMsg(
const FClientSendGroupMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientSendGroupMsgResult* Data)> ResultCallback) const;
struct FClientSendGroupMsgParams
{
/** Group ID */
FString group_id;
/** Content, content length cannot exceed 1024 characters */
FString content;
/** Additional information added by the game, content size cannot exceed 8KB (in utf8 encoding) */
FString custom_data;
};
3.18 SendInstantChatTextMsg
/**
* Send instant text chat message.
*
* @param Params Request struct for sending instant chat message.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendInstantChatTextMsg(
const FClientSendInstantChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientChatMsgInfo* Data)> ResultCallback) const;
struct FClientSendInstantChatMsgParams
{
/** The chat channel ID */
FString chat_channel_id;
/** The message content to be sent */
FString content;
/** Additional information added by the game */
FString custom_data;
};
3.19 SendInstantChatCustomMsg
/**
* Send instant custom chat message.
*
* @param Params Request struct for sending instant chat message.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendInstantChatCustomMsg(
const FClientSendInstantChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientChatMsgInfo* Data)> ResultCallback) const;
struct FClientSendInstantChatMsgParams
{
/** The chat channel ID */
FString chat_channel_id;
/** The message content to be sent */
FString content;
/** Additional information added by the game */
FString custom_data;
};
3.20 CreateLobby
/**
* Create a new lobby
*
* @param Params The information needed to create the lobby.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void CreateLobby(
const FClientCreateLobbyParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientLobbyDetailInfo* Data)> ResultCallback) const;
struct FClientCreateLobbyParams
{
/** Lobby configuration name of current lobby */
FString lobby_config;
/** The name of the lobby. */
FString name;
/** Lobby privacy type: Dummy, Invisible, or Invisible */
EClientLobbyPrivacy privacy;
/** Password needed to join the lobby */
FString password;
/** If true, the lobby members can use SendLobbyChatTextMsg/SendLobbyChatCustomMsg/SetOnReceiveLobbyChatMsg */
bool enable_chatting;
/** Lobby data */
TMap<FString, FString> kv_data;
};
3.21 EditLobbyInfo
/**
* Edit detail information of a lobby, only available for lobby owner
*
* @param Params The lobby information that needs to be updated. these data will overwrite the previous data.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void EditLobbyInfo(
const FClientEditLobbyInfoParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientLobbyDetailInfo* Data)> ResultCallback) const;
struct FClientEditLobbyInfoParams
{
/** The name of the lobby. */
FString name;
/** Lobby privacy type: Dummy, Invisible, or Invisible */
EClientLobbyPrivacy privacy;
/** Password needed to join the lobby */
FString password;
/** Lobby data */
TMap<FString, FString> kv_data;
};
3.22 SendLobbyChatTextMsg
/**
* Send a message to the lobby's chat channel.
* Only enable_chatting in CreateLobbyParams is True when the lobby was created
*
* @param Params Request struct for sending lobby chat message
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendLobbyChatTextMsg(
const FClientSendLobbyChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientChatMsgInfo* Data)> ResultCallback) const;
struct FClientSendLobbyChatMsgParams
{
/** The message content to be sent */
FString content;
/** Additional information added by the game */
FString custom_data;
};
3.23 SendLobbyChatCustomMsg
/**
* Send a message to the lobby's chat channel.
* Only enable_chatting in CreateLobbyParams is True when the lobby was created
*
* @param Params Request struct for sending lobby chat message
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendLobbyChatCustomMsg(
const FClientSendLobbyChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientChatMsgInfo* Data)> ResultCallback) const;
struct FClientSendLobbyChatMsgParams
{
/** The message content to be sent */
FString content;
/** Additional information added by the game */
FString custom_data;
};
3.24 CreateParty
/**
* Create a new party
*
* @param Params Request struct for create party
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void CreateParty(
const FClientCreatePartyParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientPartyInfo* Data)> ResultCallback) const;
struct FClientCreatePartyParams
{
/** Optional name of the new party */
FString party_name;
/** The maximum limit on the count of party members, pass 0 if you don't want to limit */
int32 max_player;
/** If true, the party members can use SendPartyChatTextMsg/SendPartyChatCustomMsg/SetOnReceiveChatMsg */
bool enable_chatting;
};
3.25 SendPartyChatTextMsg
/**
* Send party chat text message.
* Only enable_chatting in CreateParty is True when the lobby was created
*
* @param Params Request struct for sending party chat message
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendPartyChatTextMsg(
const FClientSendPartyChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientChatMsgInfo* Data)> ResultCallback) const;
struct FClientSendPartyChatMsgParams
{
/** The message content to be sent */
FString content;
/** Additional information added by the game */
FString custom_data;
};
3.26 SendPartyChatCustomMsg
/**
* Send party chat custom message.
* Only enable_chatting in CreateParty is True when the lobby was created
*
* @param Params Request struct for sending party chat message
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendPartyChatCustomMsg(
const FClientSendPartyChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientChatMsgInfo* Data)> ResultCallback) const;
struct FClientSendPartyChatMsgParams
{
/** The message content to be sent */
FString content;
/** Additional information added by the game */
FString custom_data;
};
3.27 SendPersonalTextMsg
/**
* Send personal chat text message
*
* @param Params Request struct for sending text message
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendPersonalTextMsg(
const FClientSendPersonalMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientPersonalMsgInfo* Data)> ResultCallback) const;
struct FClientSendPersonalMsgParams
{
/** Peer player's ID */
FString peer_player_id;
/** Content */
FString content;
/** Additional information added by the game */
FString custom_data;
};
3.28 SendPersonalCustomMsg
/**
* Send personal chat custom message
*
* @param Params Request struct for sending custom message
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendPersonalCustomMsg(
const FClientSendPersonalMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientPersonalMsgInfo* Data)> ResultCallback) const;
struct FClientSendPersonalMsgParams
{
/** Peer player's ID */
FString peer_player_id;
/** Content */
FString content;
/** Additional information added by the game */
FString custom_data;
};
3.29 SetMyName
/**
* Update current player's display name.
*
* @param DisplayName Set the current player's display name. The display name length is limited to 2 to 64 characters.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetMyName(
const FString& DisplayName,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
3.30 SendPublicChatTextMsg
/**
* Send public chat text message.
*
* @param Params Request parameters for sending text message.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendPublicChatTextMsg(
const FClientSendPublicChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientSendPublicChatMsgResult* Data)> ResultCallback) const;
struct FClientSendPublicChatMsgParams
{
/** The name of the channel on which the message was sent. */
FString channel_name;
/** The content of the message to be sent. */
FString content;
/** Custom data for message. */
FString custom_data;
};
3.31 SendPublicChatCustomMsg
/**
* Send public chat custom message.
*
* @param Params Request parameters for sending custom message.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendPublicChatCustomMsg(
const FClientSendPublicChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FClientSendPublicChatMsgResult* Data)> ResultCallback) const;
struct FClientSendPublicChatMsgParams
{
/** The name of the channel on which the message was sent. */
FString channel_name;
/** The content of the message to be sent. */
FString content;
/** Custom data for message. */
FString custom_data;
};