Exemplo n.º 1
0
 /// <summary>
 /// Called when the user press to logout
 /// todo: Move from here because login does not have this option only in the next scenes
 /// </summary>
 protected void Logout()
 {
     if (SocketController.IsConnected())
     {
         Debug.Log("Requesting to logout..");
         SocketController.Send(NetworkInstructions.LOGOUT_REQUEST, null);
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// Event for return key or submit button click
    /// </summary>
    public void SubmitValidation()
    {
        if (SocketController.IsConnected())
        {
            var p = new AuthData
            {
                username = usrField.text,
                password = pwdField.text
            };

            SocketController.Send(NetworkInstructions.LOGIN_REQUEST, p);

            LoginPanel.SetActive(false);

            var spin = Instantiate(Resources.Load <GameObject>("Prefabs/Modals/LoadingBox"), UI.transform) as GameObject;
            spin.name = "LoadingBox";
            spin.transform.Find("Text").GetComponent <Text>().text = "Authenticating..";
        }
        else
        {
            Debug.Log("Socket Controller has no instance or is not connected");
        }
    }