Unique Highscore identifier

Hi all,

I currently have a script that posts a score to an online highscore system passing over the players name and players score. The problem I have is that if two people with the same name submit a score, the higher score will always be taken rather than having two separate scores.

Is there a way to get some form of unique ID per potential player that persists or is generated identically each time they start the game?

For example I play my game on Monday, my ID is 1334.

My highscore then shows:

ID 1334 Martin 10,000

Another guy called Martin plays 5 minutes later on a different machine and scores 9000 so the highscore looks like this:

ID 1334 Martin 10,000
ID **** Martin 9,000

EDIT: I’ve got a feeling this may involve writing to some form of config file, but any other ideas would be grand :smiley:

Use:

to get a unique id for the machine where the player is running on. Then submit this, and the player’s name to the server. The server then looks up these in the database, and returns the id (1334) in your example. If this pair is not found, then create a new id and add this to your database. Return the new id. Now you have an id, so submit the high score.

However, I think the way that all games work is to avoid two people using the same name. The first Martin to submit a score gets to use that name. The second Martin needs to come up with a new name.

Note that all this stuff is more about databases and PHP or server-side script code rather than Unity.