Skip to main content

Client PersonalChat API Reference

The Personal Chat feature allows for one-on-one chat with other players.

API List​

APIDescription
SendPersonalTextMsgSend personal chat text message
SendPersonalCustomMsgSend personal chat custom message
GetMyPersonalChatListGet my personal chat list
GetPersonalMsgListGet chat message list with a player
ActivePersonalChatActive a personal chat. When activated, OnUnreadPersonalMsgCountNotifyEvt will be pushed, and subsequent personal chat messages currently in progress are automatically marked as read
GetActivePersonalChatGet the activated personal chat.
ClearPersonalUnreadCountMark messages with someone as all read
RemovePersonalChatRemove a personal chat, all message with this player will be removed

Event List​

EventDescription
OnUnreadPersonalMsgCountNotifyThe event will be triggered after login PGOS and when the unread count of personal message changed.
OnReceivePersonalMsgThe 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:

ParamTypeDescription
pgos_paramsSendPersonalMsgParamsRequest struct for sending text message
callbackPersonalChatDelegate0

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:

ParamTypeDescription
pgos_paramsSendPersonalMsgParamsRequest struct for sending custom message
callbackPersonalChatDelegate0

Return: void

GetMyPersonalChatList​

Get my personal chat list

/// <summary>Get my personal chat list</summary>
public void GetMyPersonalChatList(PersonalChatDelegate1 callback);

Parameters:

ParamTypeDescription
callbackPersonalChatDelegate1

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:

ParamTypeDescription
peer_player_idstringThe peer player ID
start_seqInt64The start sequence number of the message to query, 0 means start from the latest message.
countInt32The count of message to get
callbackPersonalChatDelegate2

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:

ParamTypeDescription
peer_player_idstringThe 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:

ParamTypeDescription
peer_player_idstringThe player chat with. If empty, it means all players
callbackPersonalChatDelegate3

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:

ParamTypeDescription
peer_player_idstringThe personal chat to remove. If empty, it means all players
callbackPersonalChatDelegate3

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: