suriyun-production / turnbase-rpg-docs

This is document for Turnbase RPG project (https://www.assetstore.unity3d.com/#!/content/107578?aid=1100lGeN)
https://suriyun-production.github.io/turnbase-rpg-docs
12 stars 3 forks source link

Confirm Password + EMail... #111

Closed brabaris closed 3 years ago

brabaris commented 3 years ago

Hello Suriyun! Added password confirmation to the UIAuthentication file, but it doesn't work... Help with password verification confirmation and preferably add it to the release build... Thank you in advance! `using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI;

public class UIAuthentication : UIBase { public InputField inputUsername; public InputField inputPassword; public InputField inputConfirmPassword; public UnityEvent eventLogin; public UnityEvent eventRegister; public UnityEvent eventError;

public string Username
{
    get { return inputUsername == null ? "" : inputUsername.text; }
    set { if (inputUsername != null) inputUsername.text = value; }
}

public string Password
{
    get { return inputPassword == null ? "" : inputPassword.text; }
    set { if (inputPassword != null) inputPassword.text = value; }
}
public string ConfirmPassword { 
    get { return inputConfirmPassword == null ? string.Empty : inputConfirmPassword.text; } 
}

public bool ValidatePassword()
{
    if (string.IsNullOrEmpty(Password))
        return false;
    if (inputConfirmPassword != null && !Password.Equals(ConfirmPassword))
        return false;
    return true;
}

public bool IsRememberLogin
{
    get { return GameInstance.Singleton.isRememberLogin; }
    set { GameInstance.Singleton.isRememberLogin = value; }
}

public void OnClickLogin()
{
    var gameService = GameInstance.GameService;
    gameService.Login(Username, Password, OnLoginSuccess, OnError);
}

public void OnClickRegister()
{
    var gameService = GameInstance.GameService;
    gameService.Register(Username, Password, OnRegisterSuccess, OnError);
}

public void OnClickRegisterOrLogin()
{
    var gameService = GameInstance.GameService;
    gameService.RegisterOrLogin(Username, Password, OnLoginSuccess, OnError);
}

public void OnClickGuestLogin()
{
    var gameService = GameInstance.GameService;
    var duid = SystemInfo.deviceUniqueIdentifier;
    gameService.GuestLogin(duid, OnLoginSuccess, OnError);
}

private void OnLoginSuccess(PlayerResult result)
{
    var gameInstance = GameInstance.Singleton;
    gameInstance.OnGameServiceLogin(result);
    eventLogin.Invoke();
}

private void OnRegisterSuccess(PlayerResult result)
{
    var gameInstance = GameInstance.Singleton;
    eventRegister.Invoke();
}

private void OnError(string error)
{
    var gameInstance = GameInstance.Singleton;
    gameInstance.OnGameServiceError(error);
    eventError.Invoke();
}

} `

brabaris commented 3 years ago

It would also be nice to add Email for the 1.56 release. Thank you in advance!

dclgamingtr commented 3 years ago

Yes I coded the email reset system. But now she has to define herself an e-mail address by logging into the site with only user information. I think it would be great if your email address was entered while registering in the game.