Forum Multiplayer (SOLVED) How do i call this method? Unity C#

Discussion and help relating to the PlayerIO Multiplayer API.

(SOLVED) How do i call this method? Unity C#

Postby lesterleal12 » February 4th, 2021, 5:47 am

Hello i really need help so i made a simple login/register/reset password form and it's doing fine but how do I call an error if the Username or Email is existing already I did this in my code

Code: Select all
   PlayerIO.Authenticate(
            GameID,            //Your game id
            "public",                               //Your SimpleUsers connection id
            new Dictionary<string, string> {        //Authentication arguments
                {"register", "true"},               //Register a user
                {"userId", userName.text},
                {"username", userName.text},         //Username - required
                {"password", userPassword.text},         //Password - required
                {"email", userEmail.text},    //Email - optional
            },
            null,                                   //PlayerInsight segments
            delegate(Client client) {
                Debug.Log("Succesfully Done!");
            },
            delegate(PlayerIOError error) {
                OnError(error); -- this is another method it's very simple calling an error
            }
        );


the OnError(error); method this is the code of it

Code: Select all
    void OnError(PlayerIOError error)
    {
        Debug.Log(error.ToString());
    }

It's pretty simple but my point is I made another Text Object that the player can see what is the error why they can't log on or register when I tried this

errorMes.text = "No Username Input" + error.Message;

this is happening to me it did show the error but the entire error from the console it just copied it IDK how to make it


like if the username already exists <- this will only show in the text, not the entire error

https://i.gyazo.com/305550e098ff9446268 ... 0080fd.gif


I FIGURED IT OUT I CHANGE THE SIMPLE USER AUTHENTICATION TO QUICKCONNECT METHOD
lesterleal12
 
Posts: 1
Joined: February 3rd, 2021, 6:41 am

Return to Multiplayer



cron