OnRecentChatLogs
public RecentChatLogsEventHandler OnRecentChatLogs;
Argument
Value | Type | Description |
---|---|---|
args | RecentChatLogsEventArgs | Information on recent chat history |
RecentChatLogsEventArgs
Value | Type | Description |
---|---|---|
ErrInfo | ErrorInfo | Success/failure information |
channelType | ChannelType(enum) | Type of the channel. ChannelType.Public(normal) or ChannelType.Guild(guild) |
LogInfos | List< RecentChatLogsInfo > | History of recently sent messages |
RecentChatLogsInfo
Value | Type | Description |
---|---|---|
NickName | string | Message sender's nickname |
Message | string | Content of the sent message |
Description
It is an event called upon entering the chat channel; it is not related to the asynchronous 'load recent chat history' method.
This event is called when entering a general/guild channel.
- Only chats from the public/guild channel are loaded; whispers, announcements, and all chat are not included.
- Up to 30 chats can be loaded for the message history.
- When 30 seconds pass with no members in the channel, the log record of that channel is erased, and loading earlier logs will be unavailable.(This part can be supplemented with the asynchronous 'load recent chat history' method.)
In order for an event to be called, the message sending/receiving method must be called.
Example
// First way
Backend.Chat.OnRecentChatLogs = (RecentChatLogsEventArgs args) => {
Debug.Log(args.ErrInfo.ToString());
Debug.Log("Type of the entered channel : " + args.channelType.ToString());
// Prints in reverse order(oldest history at the top of the log)
for(int i=args.LogInfos.Count - 1;i >= 0; i--)
{
Debug.Log("Nickname : " + args.LogInfos[i].NickName);
Debug.Log("Message : " + args.LogInfos[i].Message);
}
};
// Second way
Backend.Chat.OnRecentChatLogs += (args) => {
// Same logic as the first way
}