Skip to main content
Version: 5.11.6

UserIsConnectByIndate

public void UserIsConnectByIndate(string gamerIndate);

Parameter

ValueTypeDescription
gamerIndatestringgamerIndate of the user whose connection status to the real-time notification server is to be checked

Description

Checks whether the user with the corresponding gamerIndate is connected to the real-time notification server.
The result is sent to the OnIsConnectUser event handler.

You must call the Backend.Notification.Connect() method in advance.
This is an upgraded version of CheckUserIsConnect() method / OnIsConnect handler.

Caution
  • The used to be checked must be connected to the real-time notification server for this method to work properly.
  • You can connect to the real-time notification server via Backend.Notification.Connect().
  • Example

    // Connect to the real-time notification server.  
    Backend.Notification.Connect();

    // Find the inDate of the user whose nickname is "a1".
    BackendReturnObject bro = Backend.Social.GetUserInfoByNickName("a01");
    string gamerIndate = bro.GetFlattenJSON()["row"]["inDate"].ToString();

    // Define OnIsConnectUser handler that will react when the UserIsConnectByIndate method is called.
    Backend.Notification.OnIsConnectUser= (bool isConnect, string nickName, string gamerIndate) => {
    Debug.Log($"{nickName} / {gamerIndate} connection status : " + isConnect);
    };

    // The OnIsConnectUser handler defined above is called when this method is called.
    Backend.Notification.UserIsConnectByIndate(gamerIndate);

    OnIsConnectUser

    public OnIsConnectUser OnIsConnectUser;

    Description

    Shows whether a user is connected or not by sending a bool value to the event handler when the UserIsConnectByIndate method is called.
    If the nickname does not exist, string.Empty is returned.
    The handler will not be called if there is no user with the given inDate.

    Example

     Backend.Notification.OnIsConnectUser = (bool isConnect, string nickName, string gamerIndate) => {
    Debug.Log($"{nickName} / {gamerIndate} connection status : " + isConnect);
    };

    Response cases:

    ValueTypeDescription
    isConnectboolWhether the user is connected(true if connected)
    nickNamestringUser's nickname
    gamerIndatestringUser inDate

    Nickname and inDate arguments are always provided, regardless of the user's connection status.