Device ID ? - online scores.

Monkey Forums/Monkey Programming/Device ID ? - online scores.

Paul - Taiphoz(Posted 2012) [#1]
Hay all.

Ok so I am thinking about online scores, and passing a players top score to a database, and displaying the worlds top 10, and the players local top 10.

Without wanting a user to have to register at all, I am wondering if there is a way to get a device id of some sort that's cross platform, something that's unique to that user and device that I can send along with the score to uniquely identify them on the score board.

thoughts?


Xaron(Posted 2012) [#2]
You could ping your server once from within your game and get a unique ID back from the server which you store then on the phone.

Or you use something like Openfeint.


Beaker(Posted 2012) [#3]
iOS will give a unique id, but android won't. Xaron has the right idea.


Aman(Posted 2012) [#4]
Keep in mind that only phones are required to have a Unique device ID. Many tablets and portable devices that doesn't have 3G/4G connection don't have one.

Xaron suggestion is the best way to go in this case.


Paul - Taiphoz(Posted 2012) [#5]
All I will get from a Ping is the current IP the user is connecting from this can change and worse change to another user of the game.

I could create a random number or key at runtime and save it to the device, then when a score is sent in, send the key along with it, if its a combination of numbers and letters and long enough it could be enough to work.

there would always be the chance two people would get the same key but it would be like winning the lottery, very very rare.

must be a better solution tho.


Paul - Taiphoz(Posted 2012) [#6]
What I am going to do is get the user (IN GAME) to enter a player gamer tag/name, and then their e-mail address.

I will then send both name and e-mail address along with their score, the e-mail will uniquely id them in the database while allowing them to have more than one name per game.


xlsior(Posted 2012) [#7]
All I will get from a Ping is the current IP the user is connecting from this can change and worse change to another user of the game.


I don't think he meant a literal ping -- just a "contact the server and ask it for a unique ID, then store that and use it for any future communications"


Paul - Taiphoz(Posted 2012) [#8]
Ah yeah that makes sense then. But think the e-mail idea will be best. My database primary key will either be an md5 of the e-mail and name combined or something like that.

That way the same device and user can have more than one name but still linked to the same e-mail.


c.k.(Posted 2012) [#9]
Taiphoz, I was considering a high score tracking system and was wondering if people minded giving up their email for a game. Have you found much resistance to giving up an email address?

I wouldn't want to reinvent the wheel, either, so I'm seriously considering OpenFeint integration. They seem to be the most popular and they are cross-platform. I think there's monkey code for it. How easy is it to use?


xlsior(Posted 2012) [#10]
Have you found much resistance to giving up an email address?


I for one wouldn't give my email address.


Difference(Posted 2012) [#11]
I think that you can create perfectly good Unique ID's on the device without a server, in the same way these pages does:

http://www.famkruithof.net/uuid/uuidgen
http://www.guidgenerator.com/

That way way you can have UID's even for local multiplayer.

I think I would use a timestamp and some userinput to generate an UID


pantson(Posted 2012) [#12]
Android unique ID
String AndroidId = Settings.Secure.getString(getContentResolver(),Settings.Secure.ANDROID_ID);

not reliable before 2.1