Skip to main content
Version: 5.11.8

OnMatchChat

public MatchChatEventHandler OnMatchChat;

Argument

ValueTypeDescription
argsMatchChatEventArgsChat information

MatchChatEventArgs

ValueTypeDescription
ErrInfoErrorCodeError information
ReasonstringReason for error
FromSessionInfoInformation on the session that sent the chat message
ChatModeTypeMatchChatModeTypeChat message type - MatchChatModeType.Team(team) or MatchChatModeType.All(all)
MessagestringChat message

Description

This event handler is called when the server broadcasts a chat message sent from a client.
It is also called when you send a message.

Team message is also broadcasted to all clients.
You must apply a filter in the client to identify whether it is a team message or an all-user message.

In order for an event to be called, the message sending/receiving method must be called.

Example

Backend.Match.OnMatchChat = (MatchChatEventArgs args) => {
// TODO
};

Argument cases

When someone sent an all–user message
ErrInfo : ErrorCode.Success
Session : "session that sent the chat message"
ChatModeType : MatchChatModeType.All

When someone sent a team message
ErrInfo : ErrorCode.Success
Session : "session that sent the chat message"
ChatModeType : MatchChatModeType.Team