Hey there !
Im currently developing an mutliplayer game using Playfab. When the player types in his username and password, it is using this :
//---------------------------// // Register Tasks // //---------------------------// PlayFabSettings.TitleId = "5A81"; PlayFabClientModels.RegisterPlayFabUserRequest registerUserRequest = new PlayFabClientModels.RegisterPlayFabUserRequest(); registerUserRequest.DisplayName = "genarTheAdmin"; registerUserRequest.Username = "genarTheAdmin"; registerUserRequest.Password = "------"; registerUserRequest.TitleId = "YouWontSeeIt"; registerUserRequest.RequireBothUsernameAndEmail = false; registerTask = RegisterPlayFabUserAsync(registerUserRequest); Thread registerThread = new Thread(registerTask); registerThread.start(); //---------------------------// // Login Tasks // //---------------------------// PlayFabClientModels.LoginWithPlayFabRequest playFabRequest = new PlayFabClientModels.LoginWithPlayFabRequest(); playFabRequest.Username = "genarTheAdmin"; playFabRequest.Password = "------"; playFabRequest.TitleId = "YouWontSeeIt"; loginTask = LoginWithPlayFabAsync(playFabRequest); Thread thread = new Thread(loginTask); thread.start();
For signing in. As far as i know, Playfab checks if the Account is already created, if not it just creates a new one, if theres already one, the task will just be ignored.
But when i try to login in, how do i check if the player is loged in sucessfully ?
Answer by Brendan · Feb 26, 2017 at 06:49 PM
On a successful login, the response will contain a SessionTicket for the player, which will be good for the ticket lifetime (currently 24 hours). All Client API calls, apart from login and password reset, require the session ticket.
However, the LoginWithPlayFab API call does not create accounts. Unlike the other login calls, it has a different path for account creation - RegisterPlayFabUser. We'll be updating in a future release with new versions of the username/password and email/password login processes, to align those login paths with the other login calls.
Thanks for your fast answer, but how do i check now, if the playerlogin was sucessfull ?
Thanks for your answer ! So the SessionTicket is delivered by/in the loginTask ?
That's correct - all successful login calls return a session ticket. If you're using our SDKs, they are designed to automatically record that as the current player's ticket and apply it to the Client API calls subsequently.