Client PersonalChat API Reference
The Personal Chat feature allows for one-on-one chat with other players.
API List
| API | Description |
|---|---|
| SendPersonalTextMsg | Send personal chat text message |
| SendPersonalCustomMsg | Send personal chat custom message |
| GetMyPersonalChatList | Get my personal chat list |
| GetPersonalMsgList | Get chat message list with a player |
| ActivePersonalChat | Active a personal chat. When activated, OnUnreadPersonalMsgCountNotifyEvt will be pushed, and subsequent personal chat messages currently in progress are automatically marked as read |
| GetActivePersonalChat | Get the activated personal chat. |
| ClearPersonalUnreadCount | Mark messages with someone as all read |
| RemovePersonalChat | Remove a personal chat, all message with this player will be removed |
Event List
| Event | Description |
|---|---|
| OnUnreadPersonalMsgCountNotify | The event will be triggered after login PGOS and when the unread count of personal message changed. |
| OnReceivePersonalMsg | The event will be triggered when receive personal chat message. |
API Details
SendPersonalTextMsg
Send personal chat text message
/// <summary>Send personal chat text message</summary>
/// <param name="pgos_params">Request struct for sending text message</param>
public void SendPersonalTextMsg(SendPersonalMsgParams pgos_params, PersonalChatDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | SendPersonalMsgParams | Request struct for sending text message |
| callback | PersonalChatDelegate0 |
Return: void
SendPersonalCustomMsg
Send personal chat custom message
/// <summary>Send personal chat custom message</summary>
/// <param name="pgos_params">Request struct for sending custom message</param>
public void SendPersonalCustomMsg(SendPersonalMsgParams pgos_params, PersonalChatDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | SendPersonalMsgParams | Request struct for sending custom message |
| callback | PersonalChatDelegate0 |
Return: void
GetMyPersonalChatList
Get my personal chat list
/// <summary>Get my personal chat list</summary>
public void GetMyPersonalChatList(PersonalChatDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| callback | PersonalChatDelegate1 |
Return: void
GetPersonalMsgList
Get chat message list with a player
/// <summary>Get chat message list with a player</summary>
/// <param name="peer_player_id">The peer player ID</param>
/// <param name="start_seq">The start sequence number of the message to query, 0 means start from the latest message.</param>
/// <param name="count">The count of message to get</param>
public void GetPersonalMsgList(string peer_player_id, Int64 start_seq, Int32 count, PersonalChatDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| peer_player_id | string | The peer player ID |
| start_seq | Int64 | The start sequence number of the message to query, 0 means start from the latest message. |
| count | Int32 | The count of message to get |
| callback | PersonalChatDelegate2 |
Return: void
ActivePersonalChat
Active a personal chat. When activated, OnUnreadPersonalMsgCountNotifyEvt will be pushed, and subsequent personal chat messages currently in progress are automatically marked as read
/// <summary>Active a personal chat. When activated, OnUnreadPersonalMsgCountNotifyEvt will be pushed, and subsequent personal chat messages currently in progress are automatically marked as read</summary>
/// <param name="peer_player_id">The player to set as active. If empty, it means no personal chat will be activated.</param>
public void ActivePersonalChat(string peer_player_id);
Parameters:
| Param | Type | Description |
|---|---|---|
| peer_player_id | string | The player to set as active. If empty, it means no personal chat will be activated. |
Return: void
GetActivePersonalChat
Get the activated personal chat.
/// <summary>Get the activated personal chat.</summary>
public string GetActivePersonalChat();
Parameters:
(No parameters)
Return: string
Player ID of the activated personal chat. If empty, it means no personal chat is activated.
ClearPersonalUnreadCount
Mark messages with someone as all read
/// <summary>Mark messages with someone as all read</summary>
/// <param name="peer_player_id">The player chat with. If empty, it means all players</param>
public void ClearPersonalUnreadCount(string peer_player_id, PersonalChatDelegate3 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| peer_player_id | string | The player chat with. If empty, it means all players |
| callback | PersonalChatDelegate3 |
Return: void
RemovePersonalChat
Remove a personal chat, all message with this player will be removed
/// <summary>Remove a personal chat, all message with this player will be removed</summary>
/// <param name="peer_player_id">The personal chat to remove. If empty, it means all players</param>
public void RemovePersonalChat(string peer_player_id, PersonalChatDelegate3 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| peer_player_id | string | The personal chat to remove. If empty, it means all players |
| callback | PersonalChatDelegate3 |
Return: void
Event Details
OnUnreadPersonalMsgCountNotify
The event will be triggered after login PGOS and when the unread count of personal message changed.
/// <summary>The event will be triggered after login PGOS and when the unread count of personal message changed.</summary>
public event PersonalChatDelegate4 OnUnreadPersonalMsgCountNotify;
Type Reference:
OnReceivePersonalMsg
The event will be triggered when receive personal chat message.
/// <summary>The event will be triggered when receive personal chat message.</summary>
public event PersonalChatDelegate5 OnReceivePersonalMsg;
Type Reference:
All Delegates
public delegate void PersonalChatDelegate0(PgosResult a0, PersonalMsgInfo a1);
public delegate void PersonalChatDelegate1(PgosResult a0, GetMyPersonalChatListResult a1);
public delegate void PersonalChatDelegate2(PgosResult a0, GetPersonalChatMsgListResult a1);
public delegate void PersonalChatDelegate3(PgosResult a0);
public delegate void PersonalChatDelegate4(UnreadMsgCountNotifyEvt a0);
public delegate void PersonalChatDelegate5(ReceivePersonalMsgEvt a0);
Type Reference: