Ejemplo n.º 1
0
    public void AttemptCreateAccount()
    {
        string user = txtUsername.text;
        string pass = txtPassword.text;

        UICanvas.Get().TurnOnDarkenator();
        DatabaseHandler.Get().CreateAccount(user, pass, CreateAccountCallback);
    }
Ejemplo n.º 2
0
    private void CreateAccountCallback(bool _success, DatabaseHandler.ErrorResult _message)
    {
        UICanvas.Get().TurnOffDarkenator();

        if (_success)
        {
            MasterManager.instance.PanelManager.ChangePanels(EGameScreens.GS_Login);
        }
    }
Ejemplo n.º 3
0
    void PasswordChangeCallback(bool _success, DatabaseHandler.ErrorResult _error)
    {
        UICanvas.Get().TurnOffDarkenator();

        if (_success)
        {
            Close();
        }
    }
Ejemplo n.º 4
0
    public void Accept()
    {
        if (oldPassword.text == "" || newPassword.text == "")
        {
            PopupSingleTextSingleOption.Data data = new PopupSingleTextSingleOption.Data("Password Error", "Please fill in both password fields", "Okay");
            PopupManager.Get().QueuePopup(EPopupTypes.SingleTextSingleOption, data);
            return;
        }

        DatabaseHandler.Get().ChangePassword(oldPassword.text, newPassword.text, PasswordChangeCallback);
        UICanvas.Get().TurnOnDarkenator();
    }
Ejemplo n.º 5
0
    private void LoginCallback(bool _success, DatabaseHandler.ErrorResult _message)
    {
        bLoginInProgress = false;
        UICanvas.Get().TurnOffDarkenator();

        if (_success)
        {
            Debug.Log("Login Success");

            PanelManager.Get().ChangePanels(EGameScreens.GS_MainMenu);
        }
    }
Ejemplo n.º 6
0
    //Show profile
    private void ViewProfileRetrieved(bool _success, DatabaseHandler.ErrorResult _error, NameValueCollection _collection)
    {
        UICanvas.Get().TurnOffDarkenator();

        if (_success)
        {
            UIViewProfile profileView = PanelManager.Get().GetScreen(EGameScreens.GS_ViewProfile).PanelContent.GetComponent <UIViewProfile>();

            if (profileView)
            {
                profileView.SetProfile(new ProfileData(_collection));
                PanelManager.Get().ShowPanel(EGameScreens.GS_ViewProfile);
            }
        }
    }
Ejemplo n.º 7
0
    public void AttemptLogin()
    {
        if (bLoginInProgress)
        {
            return;
        }

        bLoginInProgress = true;

        string user = txtUsername.text;
        string pass = txtPassword.text;

        UICanvas.Get().TurnOnDarkenator();
        DatabaseHandler.Get().Login(user, pass, LoginCallback);
    }
Ejemplo n.º 8
0
 public void ViewProfile()
 {
     UICanvas.Get().TurnOnDarkenator();
     DatabaseHandler.Get().GetProfileInfo(FriendName, ViewProfileRetrieved);
 }