Skip to main content
Version: 5.9.6

[deprecated] OnSessionOnlineChannel

public SessionOnlineEventHandler OnSessionOnlineChannel;

Deprecation notice
  • This feature is no longer supported in BACKND versions 5.5.0 or later. The connection is completely destroyed on failure, and OnLeaveChannel handler is called instead.

Argument

ValueTypeDescription
argsSessionOnlineEventArgsWhether reconnecting to the chat server succeeded/failed

SessionOnlineEventArgs

ValueTypeDescription
ErrInfoErrorInfoSuccess/failure information
SessionSessionInfoSessionInfo of the user disconnected from the channel

Description

An event that is called when another user reconnected after being temporarily disconnected from the general channel.

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

Example

// First way
Backend.Chat.OnSessionOnlineChannel = (SessionOnlineEventArgs args) =>
{
Debug.Log(string.Format("OnSessionOnlineChannel {0}", args.ErrInfo));
// When reentered successfully
if(args.ErrInfo == ErrorInfo.Success)
{
// When you connect
if(!args.Session.IsRemote)
{
Debug.Log("Reconnected to the channel.");
}
// When another user connects
else
{
Debug.log(args.Session.Nickname + " reconnected.");
}
}
else
{
// When an error occurs
Debug.Log("An error occurred during re-entrance : " + args.ErrInfo.Reason);
}
};

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

Argument cases

When the user's reconnection to the chat server is successful ErrInfo.Category: Success ErrInfo.Detail: NetworkOnline ErrInfo.SocketError: Success ErrInfo.Reason: Session Reconnect