Chat message
The same callback is called even when a user has entered multiple channels at the same time.
You must make a logic that prints messages separately based on the channel information the messages carry.
Description
Callback methods, call methods, and information classes related to the channel.
Callback method
// This callback method is relayed when a chat message is received. It transfers the message information.
void OnChatMessage(BackndChat::MessageInfo messageInfo) { }
// This callback method is relayed when a whisper message is received. It transfers the message information.
void OnWhisperMessage(BackndChat::WhisperMessageInfo messageInfo) { }
// This callback method is relayed when a message is hidden in the console. It transfers the message information.
void OnHideMessage(BackndChat::MessageInfo messageInfo) { }
// This callback method is relayed when a message is deleted in the console. It transfers the message information.
void OnDeleteMessage(BackndChat::MessageInfo messageInfo) { }
Call methods
// This is the method that enters the chat messages. It passes the channel group, channel name, channel number, and message as arguments.
BackndChat::BDChatMain::SendChatMessage(string channelGroup, string channelName, uint64_t channelNumber, string message);
// This is the method that enters the whisper message. It passes the user's name (recipient of the whisper) and message as arguments.
BackndChat::BDChatMain::SendWhisperMessage(string gamerName, string message);
Information classes
MESSAGE_TYPE (enum)
Value | Description |
---|---|
SYSTEM_MESSAGE | Administrator message |
NORMAL_MESSAGE | General chat message |
struct MessageInfo
{
// Channel group name
string ChannelGroup;
// Channel name
string ChannelName;
// Channel number
uint64_t ChannelNumber;
// User name
string GamerName;
// Avatar name
string Avatar;
// Chat index
uint64_t Index;
// Chat message type
MESSAGE_TYPE MessageType;
// Chat message
string Message;
// Chat time information (UTC) yyyy-MM-dd HH:mm:ss e.g.) 2020-01-01 00:00:00
string Time;
// Message tag
string Tag;
};
struct MessageInfo
{
// Whisper index
uint64_t Index;
// Whisper sender's user name
string FromGamerName;
// Whisper sender's user avatar name
string FromAvatar;
// Whisper message
string Message;
// Whisper time information (UTC) yyyy-MM-dd HH:mm:ss e.g.) 2020-01-01 00:00:00
string Time;
// Message tag
string Tag
};