Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Unique device identifier

Author
Message
badkneecap
14
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 2nd Jan 2012 21:25
I decided to write and host my own high score server app. Right now, it actually works. When my app finished a game, it submits the player, score, and level to the server. Then, on my app main menu, I can select "High Scores" where it goes out to the server and downloads the scores and displays.

Has anyone done anything like this themselves? If so, I'm wondering how to handle the "player" or username. It should be unique. I can write code where the player can pick a name, check the server to see if it exists, etc. But I think it all boils down to uniquely identifying the device from others. That way, a player cannot hijack another players username.

Anyone have a better way or suggestion on how to handle?
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 2nd Jan 2012 22:38
How did you communicate with the server?

Did you use the networking commands?
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 2nd Jan 2012 23:40
Quote: "Did you use the networking commands?"


Is there an other way?
badkneecap
14
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 2nd Jan 2012 23:53
Yep, I used the networking commands.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 3rd Jan 2012 10:07
maybe he used some http commands in t2
badkneecap
14
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 3rd Jan 2012 14:31
Nope, I used the network commands in T1.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 3rd Jan 2012 21:11
how?

badkneecap
14
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 3rd Jan 2012 23:02
Were you looking for code, or how I configured my computer as a server?
badkneecap
14
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 5th Jan 2012 02:46
So, anyone with an idea on how to uniquely identify a device using AppGameKit? I don't think it can be random.
anwserman
13
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 5th Jan 2012 08:13
I think you're looking at this the wrong way.

Have you app store a single value somewhere, let's say -1. Call this "UID". When you submit high-scores, transmit the "UID" value with it as well. If the server notices that the device is sending a "UID" of -1, make the server send a new value back. Once the device gets the new value, set the "UID" to it.

So....

User device submits highscore and UID of -1
Server notices user sent a UID of -1, sends out a new value
User device gets updated UID, replaces -1 with new value

Tada! Increment a number on the server for each UID it sent out, and viola! Use the updated number for the next UID it sends out.

Hi there. My name is Dug. I have just met you, and I love you.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 5th Jan 2012 11:47
On the PC the Mac address is unique, and so very useful. Don't know if you can do it on iOS or Android.

-- Jim
badkneecap
14
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 5th Jan 2012 14:20
Answerman, I totally get your approach. I was thinking of something like this, but my concern was about security and the fact that I wanted to allow the player to pick a unique player name.

When the user picks a username, it needs to check if that username already exists. If so, then it needs to check if the requestor is in fact the original player who created it. Not that my games are that popular, but you know how hackers get. My concern was that a player would simply change their username to one that already existed and I would have no idea if they were indeed that person. So, that's why I was looking for a device name or something unique that I could use to say "yes, that's the same device that originally requested it, so it's ok".

But I think your suggestion would work with a couple of adjustments. First, when requesting a username, the server would respond with a random character string and store it along with the desired username. Then, when the player requests a username, if it already exists, it must match the previous random string (that must be stored on the device). If they get creative and delete the file stored on their device, or uninstall, or lose it for some reason, they are out of luck.

It's not the exact solution I was looking for, but it will work for the application I am working on.

Jim, I believe the Android has a unique identifier somewhere because I see it when I compile my app and test on my phone. It shows up in the console window. I just don't know if AppGameKit has any functions to retrieve it.

Thanks for the input everyone.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 5th Jan 2012 14:36
Quote: "On the PC the Mac address is unique, and so very useful. Don't know if you can do it on iOS or Android."

All MAC addresses should be unique. It's just a matter of getting them from AppGameKit code. C++ only I'd guess...

My signature is NOT a moderator plaything! Stop changing it!
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 6th Jan 2012 13:35
So when your users buy a new phone (like once every 1-2 years) they have to create a new account? Doesn't sound like a good idea to me. The old and tested username and password (encrypted) is the best solution. And you want the user to provide an email in case they loose their login information.

Login to post a reply

Server time is: 2024-11-22 20:36:31
Your offset time is: 2024-11-22 20:36:31