Skip to main content
Version: 5.9.6

OnSessionListInChannel

public SessionListInChannelHandler OnSessionListInChannel;

Argument

ValueTypeDescription
argsSessionListInChannelEventArgsWhen joining a channel, a list of users who exist in the channel

SessionListInChannelEventArgs

ValueTypeDescription
ErrInfoErrorInfoSuccess/failure information
SessionListListInformation list of all gamers connected to the channel

Description

Looks up the information of all users currently connected to the channel.
It is called only once after successfully entering a chat channel.

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

Example

Backend.Chat.OnSessionListInChannel = (SessionListInChannelEventArgs args) =>
{
Debug.Log($"OnSessionListInChannel {args.ErrInfo}");
List<string> nameList = new List<string>();
//When successful
if(args.ErrInfo == ErrorInfo.Success)
{
// Adds gamer information to the participant list
foreach(SessionInfo session in args.SessionList)
{
nameList.Add(session.NickName);
}
string nameString = "List of users in the chat room: ";
foreach(var name in nameList)
{
nameString += nameString + "\n";
}
Debug.Log(nameString);
}
else
{
//When failed
Debug.LogError("An error occurred while loading the user list : " + args.ErrInfo.Reason);
}
};

Argument cases

When the user information is loaded successfully ErrInfo.Category: Success ErrInfo.Detail: Success ErrInfo.SocketError: Success