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.
/// <summary>Join a public chat.</summary>
/// <param name="channel_name">The name of the channel to join which can be retrieved from the portal, currently only the name 'Default' is valid.</param>
public void JoinPublicChat(string channel_name, PublicChatDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| channel_name | string | The name of the channel to join which can be retrieved from the portal, currently only the name 'Default' is valid. |
| callback | PublicChatDelegate0 |
Return: void
LeavePublicChat
Leave a public chat.
/// <summary>Leave a public chat.</summary>
/// <param name="channel_name">The channel to leave.</param>
public void LeavePublicChat(string channel_name, PublicChatDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| channel_name | string | The channel to leave. |
| callback | PublicChatDelegate1 |
Return: void
SendPublicChatTextMsg
Send public chat text message.
/// <summary>Send public chat text message.</summary>
/// <param name="pgos_params">Request parameters for sending text message.</param>
public void SendPublicChatTextMsg(SendPublicChatMsgParams pgos_params, PublicChatDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | SendPublicChatMsgParams | Request parameters for sending text message. |
| callback | PublicChatDelegate2 |
Return: void
SendPublicChatCustomMsg
Send public chat custom message.
/// <summary>Send public chat custom message.</summary>
/// <param name="pgos_params">Request parameters for sending custom message.</param>
public void SendPublicChatCustomMsg(SendPublicChatMsgParams pgos_params, PublicChatDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | SendPublicChatMsgParams | Request parameters for sending custom message. |
| callback | PublicChatDelegate2 |
Return: void
GetPublicChatMentionedInfo
Get latest record mentioning me in the channel.
/// <summary>Get latest record mentioning me in the channel.</summary>
/// <param name="channel_name">The name of the channel.</param>
/// <param name="dst">The latest record mentioned me.</param>
public bool GetPublicChatMentionedInfo(string channel_name, ref PublicChatMentionedInfo dst);
Parameters:
| Param | Type | Description |
|---|---|---|
| channel_name | string | The name of the channel. |
| dst | ref PublicChatMentionedInfo | The latest record mentioned me. |
Return: bool
True if there are any mentions of me.
ClearPublicChatMentionedInfo
Clear record mentioning me in the channel.
/// <summary>Clear record mentioning me in the channel.</summary>
/// <param name="channel_name">The name of the channel. If empty, it means all channels.</param>
public void ClearPublicChatMentionedInfo(string channel_name);
Parameters:
| Param | Type | Description |
|---|---|---|
| channel_name | string | 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.
/// <summary>The event will be triggered when receive public chat message.</summary>
public event PublicChatDelegate3 OnReceivePublicChatMsg;
Type Reference:
OnPublicChatNewMentioned
The event will be triggered when a new mention of a channel is received.
/// <summary>The event will be triggered when a new mention of a channel is received.</summary>
public event PublicChatDelegate4 OnPublicChatNewMentioned;
Type Reference:
All Delegates
public delegate void PublicChatDelegate0(PgosResult a0, JoinPublicChatResult a1);
public delegate void PublicChatDelegate1(PgosResult a0);
public delegate void PublicChatDelegate2(PgosResult a0, SendPublicChatMsgResult a1);
public delegate void PublicChatDelegate3(ReceivePublicChatMsgEvt a0);
public delegate void PublicChatDelegate4(PublicChatNewMentionedEvt a0);
Type Reference: