OnGlobalChat
public GlobalChatEventHandler OnGlobalChat;
전달인자
Value | Type | Description |
---|---|---|
args | GlobalChatEventArgs | 운영자로부터 전송된 메세지 정보 |
GlobalChatEventArgs
Value | Type | Description |
---|---|---|
ErrInfo | ErrorInfo | 성공/실패 정보 |
From | SessionInfo | 공지 메시지를 송신한 사람의 정보 |
Message | String | 공지 메세지 내용 |
설명
운영자가 보낸 메세지를 수신합니다.
이벤트가 호출되기 위해서는 반드시 메시지 송수신 함수가 호출되어야 합니다.
Example
// 첫 번째 방법
Backend.Chat.OnGlobalChat = (GlobalChatEventArgs args) =>
{
Debug.Log(string.Format("OnGlobalChat {0}", args.ErrInfo));
if (args.ErrInfo == ErrorInfo.Success)
{
Debug.Log(string.Format("[User Notification] {0} : ", args.From.NickName, args.Message));
}
else
{
Debug.Log(string.Format("[Error] {0}", "운영자가 아닙니다"));
}
};
// 두 번째 방법
Backend.Chat.OnGlobalChat += (args) => {
// 첫 번째 방법과 동일한 로직
}
ArgumentCase
운영자로부터 메세지가 올 경우
args.ErrInfo : ErrorInfo.Success
ErrInfo.Category: Success
ErrInfo.Detail : Success
ErrInfo.SocketError: Success
공지를 보냈는데, 운영자가 아닐 경우
ErrInfo.Category: InvalidOperation
ErrInfo.Detail : BannedChat
ErrInfo.SocketError: Success
ErrInfo.Reason: You are not admin.