Client PublicChat API Reference
The Public Chat is a service that allows all the players to join the same global chat channel and take free talk with each other.
API List
| API | Description |
|---|---|
| JoinPublicChat | Join a public chat. |
| LeavePublicChat | Leave a public chat. |
| SendPublicChatTextMsg | Send public chat text message. |
| SendPublicChatCustomMsg | Send public chat custom message. |
| GetPublicChatMentionedInfo | Get latest record mentioning me in the channel. |
| ClearPublicChatMentionedInfo | Clear record mentioning me in the channel. |
Event List
| Event | Description |
|---|---|
| OnReceivePublicChatMsg | The event will be triggered when receive public chat message. |
| OnPublicChatNewMentioned | The event will be triggered when a new mention of a channel is received. |
API Details
JoinPublicChat
Join a public chat.
/**
* Join a public chat.
*
* @param ChannelName The name of the channel to join which can be retrieved from the portal, currently only the name 'Default' is valid.
* @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 JoinPublicChat(
const FString& ChannelName,
TFunction<void(const FPgosResult& Ret, const FPgosClientJoinPublicChatResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ChannelName | const FString& | The name of the channel to join which can be retrieved from the portal, currently only the name 'Default' is valid. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientJoinPublicChatResult* Data)> | 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. |
Return: void
LeavePublicChat
Leave a public chat.
/**
* Leave a public chat.
*
* @param ChannelName The channel to leave.
* @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 LeavePublicChat(
const FString& ChannelName,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ChannelName | const FString& | The channel to leave. |
| ResultCallback | TFunction<void(const FPgosResult& Ret)> | 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. |
Return: void
SendPublicChatTextMsg
Send public chat text message.
/**
* 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 FPgosClientSendPublicChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientSendPublicChatMsgResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSendPublicChatMsgParams& | Request parameters for sending text message. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientSendPublicChatMsgResult* Data)> | 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. |
Return: void
SendPublicChatCustomMsg
Send public chat custom message.
/**
* 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 FPgosClientSendPublicChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientSendPublicChatMsgResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSendPublicChatMsgParams& | Request parameters for sending custom message. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientSendPublicChatMsgResult* Data)> | 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. |
Return: void
GetPublicChatMentionedInfo
Get latest record mentioning me in the channel.
/**
* Get latest record mentioning me in the channel.
*
* @param ChannelName The name of the channel.
* @param Dst The latest record mentioned me.
* @return True if there are any mentions of me.
*/
bool GetPublicChatMentionedInfo(
const FString& ChannelName,
FPgosClientPublicChatMentionedInfo& Dst) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ChannelName | const FString& | The name of the channel. |
| Dst | FPgosClientPublicChatMentionedInfo& | The latest record mentioned me. |
Return: bool
True if there are any mentions of me.
ClearPublicChatMentionedInfo
Clear record mentioning me in the channel.
/**
* Clear record mentioning me in the channel.
*
* @param ChannelName The name of the channel. If empty, it means all channels.
*/
void ClearPublicChatMentionedInfo(
const FString& ChannelName) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ChannelName | const FString& | The name of the channel. If empty, it means all channels. |
Return: void
Event Details
OnReceivePublicChatMsg
The event will be triggered when receive public chat message.
/**
* OnReceivePublicChatMsg:
* The event will be triggered when receive public chat message.
*
* @param Event Result of the event receive public chat message.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnReceivePublicChatMsg, const FPgosClientReceivePublicChatMsgEvt& /*Event*/);
FOnReceivePublicChatMsg& OnReceivePublicChatMsg() { return ReceivePublicChatMsgDelegate; }
Type Reference:
OnPublicChatNewMentioned
The event will be triggered when a new mention of a channel is received.
/**
* OnPublicChatNewMentioned:
* The event will be triggered when a new mention of a channel is received.
*
* @param Event Event results received for new channel mentions.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnPublicChatNewMentioned, const FPgosClientPublicChatNewMentionedEvt& /*Event*/);
FOnPublicChatNewMentioned& OnPublicChatNewMentioned() { return PublicChatNewMentionedDelegate; }
Type Reference: