Skip to main content

OnJoinGuildChannel

public JoinChannelEventHandler OnJoinGuildChannel;

Arguments

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

args type names

ValueTypeDescription
argsJoinChannelEventArgsChat server connection success/failure

Description

This event is called whenever a user enters a chat channel.

  • It is called when users themselves or another user enters the channel.
  • It is also called when the users themselves reconnect to the channel.
  • A channel is removed from the server if it has been empty(0 members) for 30 seconds. In this case, the GetGroupChannelList() method must be called to load a new channel.

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

Note on the IP assignment issue in data communication environments
You may experience a connection error, due to the mobile IP address assignment issue, when connecting via a data communication network, such as 3G, LTE, or 5G.
It is a common issue that affects not only BACKND Chat, but also other services such as banking applications.
Instruct users who inquire about not being able to connect to the chat server to follow the steps below to renew their mobile IP addresses and resolve their issues.
  • Unable to connect to the chat server
    Upon the call of JoinChannel, the user should be connected to the channel after an automatic call of the  OnJoinGuildChannel  method; however, the  OnJoinGuildChannel  is not called and there has been no response for a continuous period.

  • Solutions

    • Turn on the airplane mode for 20 - 30 seconds, turn the mode off, and use the device.
    • Use the device after resetting the network
      iOS: Settings > General > Reset > Reset Network Settings
      Android: Settings > General management > Reset > Reset network settings
      * Note that resetting the network will also reset all network settings, including Wi-Fi and Bluetooth.

Example

//First way
Backend.Chat.OnJoinGuildChannel = (JoinChannelEventArgs args) =>
{
Debug.Log(string.Format("OnJoinGuildChannel {0}", args.ErrInfo));
//When entered successfully
if(args.ErrInfo == ErrorInfo.Success)
{
// When you connect
if(!args.Session.IsRemote)
{
Debug.Log("Connected to channel");
}
//When another user connects
else
{
Debug.Log(args.Session.Nickname + " connected");
}
}
else
{
//When an error occurs
Debug.Log("An error occurred while entering. : " + args.ErrInfo.Reason);
}
};

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

Argument cases

When connection to the chat server is successful args.ErrInfo: ErrorInfo.Success ErrInfo.Category: Success ErrInfo.Detail: Success ErrInfo.SocketError: Success

When connection to the chat server fails ErrInfo.Category : ErrorCode.Exception ErrInfo.Reason : reason for connection failure

When an attempt is made to connect to a guild channel of a guild that has not been joined(chat server connection failure) ErrInfo.Category: AuthenticationFailed ErrInfo.Detail: DisconnectFromRemote ErrInfo.Reason: Incorrect guild.

When the guild information lookup fails in the chat server(chat server connection failure) ErrInfo.Category: AuthenticationFailed ErrInfo.Detail: DisconnectFromRemote ErrInfo.Reason: fail to read guild info code: "code", reason: "reason"

When an attempt is made to connect to a guild channel that does not exist(chat server connection failure) ErrInfo.Category: AuthenticationFailed ErrInfo.Detail: DisconnectFromRemote ErrInfo.Reason: Invalid channel.

When the connection is terminated automatically ErrInfo.Category : ErrorCode.DisconnectFromRemote ErrInfo.Detail : ErrorCode.ChannelTimeout ErrInfo.Reason : Timeout message that you set