Skip to main content

OnLeaveGuildChannel

public LeaveChannelEventHandler OnLeaveGuildChannel;

Argument

ValueTypeDescription
argsLeaveChannelEventArgsWhether leaving the channel succeeded/failed

LeaveChannelEventArgs

ValueTypeDescription
ErrInfoErrorInfoSuccess/failure information
SessionSessionInfoSessionInfo of the gamer who left the channel

Description

It is called when the user's connection to the chatting channel ends.

  • It is called when the user themselves or another user explicitly calls the LeaveChannel method.
  • It is called when the user failed to reconnect after being disconnected due to reasons such as the user's or another user's poor communication environment.

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

Example

// First way
Backend.Chat.OnLeaveGuildChannel = (LeaveChannelEventArgs args) =>
{
Debug.Log(string.Format("OnLeaveGuildChannel {0}", args.ErrInfo));

// When the user leaves successfully
if(args.ErrInfo == ErrorInfo.Success)
{
// When you are the user who left
if(!args.Session.IsRemote)
{
Debug.Log("Left the channel.");
}
// When another user left
else
{
Debug.log(args.Session.Nickname + " left");
}
}
else
{
// When an error occurs
Debug.Log("An error occurred while leaving : " + args.ErrInfo.Reason);
}
};

//Second way
Backend.Chat.OnLeaveGuildChannel += (args) => {
// Same logic as the first way
}

Argument cases

When you or another user leaves the channel ErrInfo.Category: Success ErrInfo.Detail: Success ErrInfo.SocketError: Success

When the client's connection with the chat server is disconnected for 1 minute and 30 seconds or over(for example, not using the poll method) ErrInfo.Category: Exception ErrInfo.Detail: DisconnectFromRemote ErrInfo.SocketError: Success ErrInfo.Reason: Disconnected from server.

When force disconnected locally via the ResetConnect() method ErrInfo.Category: Exception ErrInfo.Detail: DisconnectFromLocal ErrInfo.SocketError: Success