跳到主要内容

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​

APIDescription
JoinPublicChatJoin a public chat.
LeavePublicChatLeave a public chat.
SendPublicChatTextMsgSend public chat text message.
SendPublicChatCustomMsgSend public chat custom message.
GetPublicChatMentionedInfoGet latest record mentioning me in the channel.
ClearPublicChatMentionedInfoClear record mentioning me in the channel.

Event List​

EventDescription
OnReceivePublicChatMsgThe event will be triggered when receive public chat message.
OnPublicChatNewMentionedThe 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:

ParamTypeDescription
channel_namestringThe name of the channel to join which can be retrieved from the portal, currently only the name 'Default' is valid.
callbackPublicChatDelegate0

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:

ParamTypeDescription
channel_namestringThe channel to leave.
callbackPublicChatDelegate1

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:

ParamTypeDescription
pgos_paramsSendPublicChatMsgParamsRequest parameters for sending text message.
callbackPublicChatDelegate2

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:

ParamTypeDescription
pgos_paramsSendPublicChatMsgParamsRequest parameters for sending custom message.
callbackPublicChatDelegate2

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:

ParamTypeDescription
channel_namestringThe name of the channel.
dstref PublicChatMentionedInfoThe 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:

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