Beispiel #1
0
    /// <summary>
    /// When the corresponding button is clicked, login the gamer with a previously created account.
    /// </summary>
    public void Button_LoginWithCredentials()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string gamerID     = null;
        string gamerSecret = null;

        // Check the gamerID value
        if (loginWithCredentials_GamerID == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Login", "loginWithCredentials_GamerID"));
        }
        else if (!string.IsNullOrEmpty(loginWithCredentials_GamerID.text))
        {
            gamerID = loginWithCredentials_GamerID.text;
        }

        // Check the gamerSecret value
        if (loginWithCredentials_GamerSecret == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Login", "loginWithCredentials_GamerSecret"));
        }
        else if (!string.IsNullOrEmpty(loginWithCredentials_GamerSecret.text))
        {
            gamerSecret = loginWithCredentials_GamerSecret.text;
        }

        // Call the template method
        LoginFeatures.Handling_LoginWithCredentials(gamerID, gamerSecret);
    }
Beispiel #2
0
    /// <summary>
    /// When the corresponding button is clicked, login the gamer with email and password credentials. (create a new account if it doesn't exist yet)
    /// </summary>
    public void Button_LoginWithEmail()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string email    = "*****@*****.**";
        string password = "******";

        // Check the email value
        if (loginWithEmail_Email == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Login", "loginWithEmail_Email"));
        }
        else if (!string.IsNullOrEmpty(loginWithEmail_Email.text))
        {
            email = loginWithEmail_Email.text;
        }

        // Check the password value
        if (loginWithEmail_Password == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Login", "loginWithEmail_Password"));
        }
        else if (!string.IsNullOrEmpty(loginWithEmail_Password.text))
        {
            password = loginWithEmail_Password.text;
        }

        // Call the template method
        LoginFeatures.Handling_LoginWithEmail(email, password);
    }
Beispiel #3
0
    /// <summary>
    /// What to do once the CotcSdk's Cloud instance is initialized. (here we call an AutoLogin)
    /// </summary>
    /// <param name="cloud">The initialized Cloud instance.</param>
    private void OnCloudInitialized(Cloud cloud)
    {
        // Register to the GamerLoggedIn and GamerLoggedOut events
        LoginFeatures.Event_GamerLoggedIn  += OnGamerLoggedIn;
        LoginFeatures.Event_GamerLoggedOut += OnGamerLoggedOut;

        // Call the template method
        LoginFeatures.Handling_AutoLogin();
    }
Beispiel #4
0
    /// <summary>
    /// When the corresponding button is clicked, login the gamer to its email account with a short code previously received by email.
    /// </summary>
    public void Button_LoginWithShortCode()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string shortCode = null;

        // Check the password value
        if (loginWithShortCode_ShortCode == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Login", "loginWithShortCode_ShortCode"));
        }
        else if (!string.IsNullOrEmpty(loginWithShortCode_ShortCode.text))
        {
            shortCode = loginWithShortCode_ShortCode.text;
        }

        // Call the template method
        LoginFeatures.Handling_LoginWithShortCode(shortCode);
    }
Beispiel #5
0
 /// <summary>
 /// When the corresponding button is clicked, logout the current logged in gamer.
 /// </summary>
 public void Button_LogoutGamer()
 {
     // Call the template method
     LoginFeatures.Handling_LogoutGamer();
 }
Beispiel #6
0
 /// <summary>
 /// When the corresponding button is clicked, login the gamer with a new anonymous account.
 /// </summary>
 public void Button_LoginAsAnonymous()
 {
     // Call the template method
     LoginFeatures.Handling_LoginAsAnonymous();
 }