I have a problem with a switch statement. This switch statement would occur when the app fails to register a player via an email (email, username and password). When I tested it, I used a username and email address that I know had been taken, but only the "EmailAddressNotAvailable" error seems to run and it says "username available" even though I know its not. When I change the email to a new email address it then says "username not available".
I wanted both errors to occur at the same time but it only seems to detect the email address error. Seems not to go through all the cases and not in order either as I place the UsernameError first in the switch.
I am something is wrong with my switch case statements. Here is my code.
private void OnRegisterFailure(PlayFabError error) { Debug.LogError(error.GenerateErrorReport());
switch (error.Error)
{
case PlayFabErrorCode.UsernameNotAvailable:
RegisterUsernameErrorText.text = ("Username Taken");
Debug.LogWarning("Register Fail Username Taken");
break;
case PlayFabErrorCode.EmailAddressNotAvailable:
RegisterEmailErrorText.text = ("Email Already Registered");
Debug.LogWarning("Register Fail Email Already Registered");
break;
case PlayFabErrorCode.InvalidEmailAddress:
RegisterEmailErrorText.text = ("Invalid Email");
Debug.LogWarning("Register Fail Invalid Email");
break;
default:
RegisterUsernameErrorText.text = ("Username Available");
RegisterEmailErrorText.text = ("Email Available");
Debug.LogWarning("Register default");
break;
}
}
Thanks for any help.
↧