Esempio n. 1
0
    /** DEFAULT LOGIN **/
    public void LoginUser()
    {
        checkInternet();
        errorLogin.SetActive(false);
        errorLoginImg.SetActive(false);
        validateFields();
        if (isValidated)
        {
            // Show loading screen
            loader.enableLoader();
            // Try to Login, if there is no access we are starting the waitForConnection
            if (i_access)
            {
                // Login with email and password, store session token
                GamedoniaUsers.LoginUserWithEmail(email.ToLower(), password, OnLogin);
                if (errorMsg != "")
                {
                    Debug.Log(errorMsg);
                }

                if (statusMsg != "")
                {
                    Debug.Log(statusMsg);
                }
            }
            else
            {
                loader.disableLoader();
                loader.enableBackground();
                errorPopup.SetActive(true);
                // Wait for connection, if there is a connection we try to login again
                //StartCoroutine (waitForConnection (waitForConnectionTime));
            }
        }
    }
Esempio n. 2
0
    void OnGUI()
    {
        GUI.skin = skin;

        GUI.DrawTexture(UtilResize.ResizeGUI(new Rect(0, 0, 320, 480)), backgroundImg);

        GUI.enabled = (statusMsg == "");
        //Login Controls
        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 10, 220, 20)), "eMail", "LabelBold");
        email = GUI.TextField(UtilResize.ResizeGUI(new Rect(80, 30, 220, 40)), email, 100);

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 75, 220, 20)), "Password", "LabelBold");
        password = GUI.PasswordField(UtilResize.ResizeGUI(new Rect(80, 100, 220, 40)), password, '*');


        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 150, 220, 50)), "Login"))
        {
            GamedoniaUsers.LoginUserWithEmail(email.ToLower(), password, OnLogin);
        }

        GUIStyle fbButton = GUI.skin.GetStyle("ButtonFacebook");

        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 205, 220, 50)), "Facebook", fbButton))
        {
            statusMsg = "Initiating Facebook session...";
            FacebookBinding.OpenSessionWithReadPermissions(READ_PERMISSIONS, OnFacebookOpenSession);
        }

        GUIStyle separator = GUI.skin.GetStyle("separator");

        GUI.Box(UtilResize.ResizeGUI(new Rect(80, 277, 220, 1)), "", separator);

        //Sign Up
        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 300, 220, 50)), "Sign Up"))
        {
            //print ("you clicked the text button");
            Application.LoadLevel("CreateAccountScene");
        }

        //Password Recovery
        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 355, 220, 50)), "Remember Password"))
        {
            Application.LoadLevel("ResetPasswordScene");
        }

        if (errorMsg != "")
        {
            GUI.Box(new Rect((Screen.width - (UtilResize.resMultiplier() * 260)), (Screen.height - (UtilResize.resMultiplier() * 50)), (UtilResize.resMultiplier() * 260), (UtilResize.resMultiplier() * 50)), errorMsg);
            if (GUI.Button(new Rect(Screen.width - 20, Screen.height - UtilResize.resMultiplier() * 45, 16, 16), "x", "ButtonSmall"))
            {
                errorMsg = "";
            }
        }

        GUI.enabled = true;
        if (statusMsg != "")
        {
            GUI.Box(UtilResize.ResizeGUI(new Rect(80, 240 - 40, 220, 40)), statusMsg);
        }
    }
Esempio n. 3
0
 void OnCreateUser(bool success)
 {
     if (success)
     {
         GamedoniaUsers.LoginUserWithEmail(email.ToLower(), password, OnLogin);
     }
     else
     {
         errorMsg = Gamedonia.getLastError().ToString();
         Debug.Log(errorMsg);
     }
 }
Esempio n. 4
0
 void OnCreateUser(bool success)
 {
     if (success)
     {
         GamedoniaUsers.LoginUserWithEmail(email.text, password.text, OnLogin);
     }
     else
     {
         Loader.I.disableLoader();
         if (GamedoniaBackend.getLastError().code == 10001)
         {
             emailImg.DOColor(errorColor, 1);
             errorMsgText.text = "Dit e-mailadres is al in gebruik";
             errorMsgText.DOFade(1, 1);
         }
     }
 }