question

logande4610 avatar image
logande4610 asked

Check if an ip has more then one account in unity

There was an issue we had where we lost our keystore file (A file that verifies you can upload an update to an oculus/google playstore app) and we had to make a new one in a new app. For some reason, this caused everyone that had an account to be forced to create a new one.

We want to add a feature that detects when a player has more than one account and show what account the user is currently on and give the user a choice on what account to delete by PlayFabID (I can handle getting the PlayFabID that the user typed in). I want the account to also be deleted by cloud script, but I don't know any javascript so if anyone could please help me that would be great, I have no idea on how to do this and there is no info online.

sdksAccount ManagementCloudScript
10 |1200

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

Xiao Zha avatar image
Xiao Zha answered

How do you set the Custom ID in your code? If you are using SystemInfo.deviceUniqueIdentifier to get the device ID and set it as Custom ID, since in Android 8.0 (API level 26) and above, SystemInfo.deviceUniqueIdentifier returns the md5 of ANDROID_ID, and ANDROID_ID depends on the signing key of the application. Therefore, if you change the signature of the application (for example, you create a new keystore because you lost the keystore file), then the Android ID obtained through SystemInfo.deviceUniqueIdentifier will also change (factory resetting the device will also change the ANDROID_ID). That could be the reason why the players of your game are forced to create a new account.

As I mentioned above, there is no way for PlayFab to detect whether different accounts belong to the same person. If you are only using deviceUniqueIdentifier as a custom Id to authenticate and log in players, this is an anonymous login and in order to log back into the old playfab account, the only way is to get the old deviceUniqueIdentifier. Therefore, we suggest that you might consider contacting Google support team or Unity support team to see if they can figure out the old deviceUniqueIdentifier with something like keystore or signing key etc. If they can, then you may log the player in with the old deviceUniqueIdentifier, then let the player choose to save which account. If the player chooses to save the old account, you can call UnlinkCustomId to unlink the old customId, then call LinkCustomId to link the new customId to the old account, then delete the new account. If the player chooses to save the new account, you can delete the old account directly.

Additionally, we recommend that you may add some recoverable login mechanisms to your game so that players can still log into their accounts even if there is a problem logging in to the device.

10 |1200

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

Xiao Zha avatar image
Xiao Zha answered

What do you mean by “For some reason, this caused everyone that had an account to be forced to create a new one.”? Can both accounts be logged in or only the newly created account? If only the newly created account can be logged in, could you share more information about why the old account cannot be logged in?

And PlayFab doesn’t provide such feature to detecting whether different accounts belong to the same person. Also, check if an IP has more than one account is not a good idea since different person may use the same IP and same person may use different IPs.

In addition, for deleting player with PlayFabId, you may call Admin API DeleteMasterPlayerAccount in AzureFunction which supports C#.

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.

logande4610 avatar image logande4610 commented ·

Only the newest created account can be logged into, we use a custom ID to log into an account and doing anything like factory resetting the device will create a new account as well. Deleting and reinstalling the game does not create a new account though

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.