Client InstantChat API Reference
Instant Chat is used for instant text chatting among multiple people. All players who join a given channel can chat with each other. When all the players in a chat leave the channel or go offline, the channel is automatically deleted.
API List
| API | Description |
|---|---|
| JoinInstantChat | Join a text channel chat. |
| LeaveInstantChat | Leave a text channel chat. |
| SendInstantChatTextMsg | Send instant text chat message. |
| SendInstantChatCustomMsg | Send instant custom chat message. |
| GetInstantChatMembers | Get all players in a channel. |
| GetInstantChatMemberIDs | Get all player IDs in a channel. |
| GetInstantChatMemberCount | Get the num of players in a channel. |
Event List
| Event | Description |
|---|---|
| OnReceiveInstantChatMsg | The event will be triggered when receive channel chat message. |
| OnInstantChatMemberJoined | The event will be triggered when new players joined the chat channel. |
| OnInstantChatMemberLeft | The event will be triggered when player left the chat channel. |
API Details
JoinInstantChat
Join a text channel chat.
/// <summary>Join a text channel chat.</summary>
/// <param name="chat_channel_id">A custom unique ID used to identify the channel (in game scope), must be 127 characters or less, can use battle-session-id which base on UUID with 36 characters.</param>
public void JoinInstantChat(string chat_channel_id, InstantChatDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| chat_channel_id | string | A custom unique ID used to identify the channel (in game scope), must be 127 characters or less, can use battle-session-id which base on UUID with 36 characters. |
| callback | InstantChatDelegate0 |
Return: void
LeaveInstantChat
Leave a text channel chat.
/// <summary>Leave a text channel chat.</summary>
/// <param name="chat_channel_id">The chat channel id to leave.</param>
public void LeaveInstantChat(string chat_channel_id, InstantChatDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| chat_channel_id | string | The chat channel id to leave. |
| callback | InstantChatDelegate1 |
Return: void
SendInstantChatTextMsg
Send instant text chat message.
/// <summary>Send instant text chat message.</summary>
/// <param name="pgos_params">Request struct for sending instant chat message.</param>
public void SendInstantChatTextMsg(SendInstantChatMsgParams pgos_params, InstantChatDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | SendInstantChatMsgParams | Request struct for sending instant chat message. |
| callback | InstantChatDelegate2 |
Return: void
SendInstantChatCustomMsg
Send instant custom chat message.
/// <summary>Send instant custom chat message.</summary>
/// <param name="pgos_params">Request struct for sending instant chat message.</param>
public void SendInstantChatCustomMsg(SendInstantChatMsgParams pgos_params, InstantChatDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | SendInstantChatMsgParams | Request struct for sending instant chat message. |
| callback | InstantChatDelegate2 |
Return: void
GetInstantChatMembers
Get all players in a channel.
/// <summary>Get all players in a channel.</summary>
/// <param name="chat_channel_id">The chat channel id.</param>
public void GetInstantChatMembers(string chat_channel_id, InstantChatDelegate3 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| chat_channel_id | string | The chat channel id. |
| callback | InstantChatDelegate3 |
Return: void
GetInstantChatMemberIDs
Get all player IDs in a channel.
/// <summary>Get all player IDs in a channel.</summary>
/// <param name="chat_channel_id">The chat channel id.</param>
public void GetInstantChatMemberIDs(string chat_channel_id, InstantChatDelegate4 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| chat_channel_id | string | The chat channel id. |
| callback | InstantChatDelegate4 |
Return: void
GetInstantChatMemberCount
Get the num of players in a channel.
/// <summary>Get the num of players in a channel.</summary>
/// <param name="chat_channel_id">The chat channel id.</param>
public void GetInstantChatMemberCount(string chat_channel_id, InstantChatDelegate5 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| chat_channel_id | string | The chat channel id. |
| callback | InstantChatDelegate5 |
Return: void
Event Details
OnReceiveInstantChatMsg
The event will be triggered when receive channel chat message.
/// <summary>The event will be triggered when receive channel chat message.</summary>
public event InstantChatDelegate6 OnReceiveInstantChatMsg;
Type Reference:
OnInstantChatMemberJoined
The event will be triggered when new players joined the chat channel.
/// <summary>The event will be triggered when new players joined the chat channel.</summary>
public event InstantChatDelegate7 OnInstantChatMemberJoined;
Type Reference:
OnInstantChatMemberLeft
The event will be triggered when player left the chat channel.
/// <summary>The event will be triggered when player left the chat channel.</summary>
public event InstantChatDelegate8 OnInstantChatMemberLeft;
Type Reference:
All Delegates
public delegate void InstantChatDelegate0(PgosResult a0, JoinInstantChatResult a1);
public delegate void InstantChatDelegate1(PgosResult a0);
public delegate void InstantChatDelegate2(PgosResult a0, ChatMsgInfo a1);
public delegate void InstantChatDelegate3(PgosResult a0, GetInstantChatMembersResult a1);
public delegate void InstantChatDelegate4(PgosResult a0, GetInstantChatMemberIDsResult a1);
public delegate void InstantChatDelegate5(PgosResult a0, GetInstantChatMemberCountResult a1);
public delegate void InstantChatDelegate6(ReceiveInstantChatMsgEvt a0);
public delegate void InstantChatDelegate7(InstantChatMemberJoinedEvt a0);
public delegate void InstantChatDelegate8(InstantChatMemberLeftEvt a0);
Type Reference: