Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by larsm0806 · Feb 26, 2017 at 05:58 PM · Player Datagame manager

How to check if a player loged in sucessfully ?

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 ?

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

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.

Comment

People who like this

0 Show 3 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image larsm0806 · Feb 27, 2017 at 03:25 PM 0
Share

Thanks for your fast answer, but how do i check now, if the playerlogin was sucessfull ?

avatar image larsm0806 · Feb 27, 2017 at 11:53 PM 0
Share

Thanks for your answer ! So the SessionTicket is delivered by/in the loginTask ?

avatar image Brendan ♦♦ larsm0806 · Feb 28, 2017 at 12:13 AM 0
Share

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.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Send push notification based on player behaviour? 1 Answer

    Is it possible to store data (tables), modifiable from the Playfab developer dash? 1 Answer

    Managing Games levels - how to - best practice? 1 Answer

    How Do You Create A Time Based Leaderboard (Taking The Player's Fastest Time To Complete, etc.)?,How do I create a time based Leaderboard with PlayFab? (Recording player's "Best Time") 1 Answer

    How to add statistics such as Level, EXP to new player? 2 Answers

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges