question

Paul Boutros avatar image
Paul Boutros asked

Multiple player on the same account, customID is N/A


Hi,
From itch.io I was seeing multiple players playing... then I could not find new player created in my Title data. Game is a WebGL game.

Currently I am using LoginWithCustomID, and in the request I set
CustomId = SystemInfo.deviceUniqueIdentifier

An other very strange thing: why is it that this account has an N/A custom ID?

I suspect the following: LoginWithCustomID will create a new account if it can't find an existing one with the CustomID of the request. But if SystemInfo.deviceUniqueIdentifier generates "N/A" all the time
then every different user will use the data of the user with the customID "N/A" sort of speak.


Now apparently SystemInfo.deviceUniqueIdentifier does not work with WebGL and that may be the reason of this.

My question is, what SystemInfo.deviceUniqueIdentifier alternative could I use for WebGL?
Could I use a randomly generated number, that would be saved in Unity PlayerPref?

What is the recommended approach, Thanks

playfabissue.jpg (247.4 KiB)
10 |1200

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

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

Yes, the SystemInfo.deviceUniqueIdentifier does not work for WebGL. In WebGL, it always returns “n/a” as a result and that’s why this account has a “n/a” custom ID. Refer to Can't get SystemInfo.deviceUniqueIdentifier to work on WebGL builds. - Unity Forum.

If you want to keep the LoginWithCustomId as the login method, you can use a randomly generated number, but you need to make sure each number is unique. Typically, we can use GUID as custom ID.

10 |1200

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

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.