Пример #1
0
    private IEnumerator UserLoginCoroutine(string user, string password, SimpleDelegate <MeridianData.UserLoginResult> userLoginDelegate)
    {
        // Build json by hand
        string jsonString = "{ mail:'" + user + "', password:'******' }";

        WWW www = MeridianCommunications.POST("/Catalog/Login", jsonString);

        yield return(www);

        MeridianData.UserLoginResult result = null;

        if (www.error == null)
        {
            // Since JSon comes in the form of an array we must wrap data around a class.
            result = JsonUtility.FromJson <MeridianData.UserLoginResult>("{\"userList\":" + www.text + "}");
        }
        else
        {
        }

        if (userLoginDelegate != null)
        {
            userLoginDelegate(result);
        }
    }
Пример #2
0
    private void GetAdminUserDelegate(MeridianData.UserLoginResult loginResult)
    {
        if (loginResult != null)
        {
            _adminUser = loginResult.userList[0];

            if (adminUserReadyDelegate != null)
            {
                adminUserReadyDelegate();
            }
        }
    }
Пример #3
0
 private void UserLogin(MeridianData.UserLoginResult loginResult)
 {
     if (loginResult != null)
     {
         if (loginResult.userList[0].Estatus == 1)
         {
             MeridianApp.SetCurrentUser(loginResult.userList[0]);
             EnterDecorator();
         }
         else
         {
             resultLabel.text = "Error: Nombre de usuario o contraseña invalida";
             resultPanel.gameObject.SetActive(true);
         }
     }
     else
     {
         resultLabel.text = "Error: Nombre de usuario o contraseña invalida";
         resultPanel.gameObject.SetActive(true);
     }
 }