question

Nicolas C avatar image
Nicolas C asked

Unity: Way to know if this is the first player connection

Hi,

Is there a way to know if this is the first time the player logs in to a specific Title?

Basically, if the "Title player account" has just been created for this player.

This only tells if the "Master player account" has just been created:

PlayFab.ClientModels.LoginResult.NewlyCreated

I noticed the following is an empty string after deleting the "Title player account".

PlayFab.ClientModels.LoginResult.LastLoginTime
  • Is this property providing the last login time to the master account or only to the current title account? From what I noticed it's the current title account otherwise LastLoginTime would not be null but I'm not sure.
  • Can I rely on that by checking if this string equals an empty string to know if the "Title player account" has just been created?

Finally, I don't understand the following behavior. There must be something I'm missing.

1.Player logs into the title without a master account. "Master player account" gets created along with the "Title player account". I can see the creation date of the master account corresponds to the first login of the title account, this is fine.

2. I then delete the "Title player account" using PlayFabAdminAPI.DeletePlayer()

3. I start the game again and I get a successful login result with NewlyCreated=false which is fine because I only deleted the title account, not the master account. When I go to the PlayFab panel I do see a different title Player ID for the same master Player ID, this is fine. However, the master player account Creation date changed and now corresponds to the first login of the new title account. Why? Was the master account recreated but with the same master Player ID?


Thanks a lot

unity3d
a9yho.png (100.8 KiB)
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nicolas C avatar image Nicolas C commented ·

Last image did not upload and I can't edit my post. Image for the 3rd point.

0 Likes 0 ·
Nicolas C avatar image Nicolas C Nicolas C commented ·

Did not work either. Direct link

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

1. to know if this is the first player connection, we may use a workaround solution. As title player account creation will generate a unique PlayStream Event, "player_added_title". It can be used as a trigger of Rules, to execute a cloud script so that you can store a timestamp and a flag somewhere, such as Player Read-only Data.

2. Thanks for the feedback about "Created" time, for now, I believe it shows the Title Player Account creation time. I have submitted a report to the team and will keep you informed when there are any updates.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nicolas C avatar image Nicolas C commented ·
  1. Thanks for your reply, I will investigate how to implement what you suggested
  2. It now makes sense if it shows the "Created" time but it's a bit confusing. Thanks for keeping me posted
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.