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 / Online highscore system for your AGK games

Author
Message
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Mar 2014 00:08 Edited at: 28th Mar 2014 04:36
Current threads on this forum has motivated me to work on a highscore system. Fortunately, the user system was already in place for an older project I started years ago.

Register your username/company/publisher here:
http://gamespace.zimnox.com/register.php

Once you've activated your user account through the confirmation email, you can log in and select your profile by clicking on your name in the top right corner of the site.

From your profile page, you can add new games. Each game provides you with a private key. You'll need this key to submit scores from AppGameKit using POST data, so keep it out of public source code!




Currently, the system limits you to only 10 scores per game. It will automatically bump the lowest score from the table when a higher score is submitted.

Here's an example of submitting your score through AGK. Spacebar to submit a score, ENTER to retrieve the scores in a CSV format. The first token in the response string is the number of score entries being returned. I've left an example key code in the demo for you to play with.


Attachments

Login to view attachments
ThrOtherJoJo
7
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 28th Mar 2014 04:43
Great! This is good news!

Joeisms
KG2Entertainment.com
f098f
5
Years of Service
User Offline
Joined: 28th Mar 2014
Location:
Posted: 28th Mar 2014 11:04 Edited at: 28th Mar 2014 22:13
nice
Ched80
8
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 28th Mar 2014 16:02
Awesome!

Ched80
8
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 28th Mar 2014 17:09
Hi,

I tried to register, but the email I received was empty...

Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Mar 2014 18:23
Quote: "I tried to register, but the email I received was empty..."

Weird me too. I tested this multiple times yesterday and it worked fine. It's not even something I touched at all yesterday, it was already in place.

I activated your account manually for you, and whoever registered as fatleg.

Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Mar 2014 19:11
Figured out the problem. The site was originally set up as zimnox.com/gamespace. I changed it to a subdomain gamespace.zimnox.com/ and that was causing an issue with loading the email template since the document root changed.

Any new accounts should receive the proper email now.

Ched80
8
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 28th Mar 2014 21:02
Cheers - it works now

Naphier
8
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 28th Mar 2014 21:56
Tokidokee
6
Years of Service
User Offline
Joined: 28th Oct 2012
Location:
Posted: 29th Mar 2014 23:20
---Hmm, This sounds really great, but I cannot seem to be able to register...tried various times but to no avail...

Any updates?
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Mar 2014 02:50
Did you receive the confirmation email? I'm not seeing any new records in the database. Any errors? I need more info to help you out.

Tokidokee
6
Years of Service
User Offline
Joined: 28th Oct 2012
Location:
Posted: 31st Mar 2014 10:51
Thanks for getting.back,

As I fill in all the data, tick the agreement and press submit, then nothing really happens. The form clears itself and no email is received.
....I have disablde any kind of adblock/redirect cleaner in the browser...

...will probably try it from another PC, just to check...

Cheers
Tokidokee
6
Years of Service
User Offline
Joined: 28th Oct 2012
Location:
Posted: 31st Mar 2014 15:21
Successfully signed up through my phone browser...


Cheers

Tokidokee
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Apr 2014 04:28
Good to hear. A lot of the form uses javascript for a first level validation, but even if your browser was having JS issues it still gets validated on the server side as well. I can't really say what might be causing the issue on your pc.

Jammy
16
Years of Service
User Offline
Joined: 15th Jan 2003
Location: Scotland
Posted: 2nd Apr 2014 16:43
Nice work Phaelax, I was having the same registration issues as above with Internet Explorer but it worked great with Chrome.

Very nice system. simple and powerful. However, is there a way to clear the high score table ?

Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Apr 2014 19:16
Quote: "However, is there a way to clear the high score table ?"

I was wondering when someone would ask. I just added it to the profiles. When you check your scores online, you can delete individual scores. I'll add a quick delete all button later on this evening. I have to go guard a vault now.

MASTER OF PUPPETS
15
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 2nd Apr 2014 23:09
This looks great! I feel so relieved to have found this!

Is there, or will there be a way to sub-categorize high-score tables?
For example, the program could gather location data, then post to various tables based on the users rank globally, nationally, state-wide, etc.

I suppose a simple solution could be to register the same game with an added suffix, such as "Game Name - Global" and "Game Name - National"

... Just thinking out loud I suppose.

|,,|, (Dead Knot Broken) ,|,,|
Jammy
16
Years of Service
User Offline
Joined: 15th Jan 2003
Location: Scotland
Posted: 2nd Apr 2014 23:14
Your the Man

Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Apr 2014 01:04
If you can tell me what kind of location data you're able to collect with AppGameKit, I could easily add it to the database as an option.

Jammy
16
Years of Service
User Offline
Joined: 15th Jan 2003
Location: Scotland
Posted: 3rd Apr 2014 01:52 Edited at: 3rd Apr 2014 04:00
Would this sort of thing be ok for recognition of your great work or would you like a link to a website or something more ?



I don't think location services have been added to AppGameKit yet, but nice idea.

Attachments

Login to view attachments
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Apr 2014 09:37 Edited at: 3rd Apr 2014 09:40
I don't think a link back to my website would help anyone without reading about how to use it on this forum, so that's not necessary. Although, if you'd like to trade that gold codemaster ribbon..... (next time!)

I assume once a game has been completed and/or published, there would be no need to manually erase any scores from within the app, hence the lack of support for it in the script.


I am open to any other ideas if someone has thoughts of improvements that would be useful to the site/script.

MASTER OF PUPPETS
15
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 3rd Apr 2014 10:20 Edited at: 3rd Apr 2014 10:21
After testing, it seems that what I'm saying is already possible(mostly).

To create the multi-layered databases I'm talking about, currently, it would require setting up multiple databases for the same game (with a slightly different name). Then, in code, adding several "GAME_KEY"'s.

The app could then be set up to determine which GAME_KEY to use with "submitObject = submitScore("*user_name*", str(score), GAME_KEY)" based on the information it has.

Does that sound accurate?

|,,|, (Dead Knot Broken) ,|,,|
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Apr 2014 20:29
You mean have more than one game share the same game key? So multiple games can share the same highscore table?

Mobiius
Valued Member
16
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Apr 2014 20:34
I think they mean multiple high score tables per game. One per location.

Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Apr 2014 21:26
Ohhh ok. You could always create new keys and name your game something like My Game US and My Game JPN

Ched80
8
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 3rd Apr 2014 22:23
In fact for Holey Cow! I use two high scores, one for PC abs one for mobile as the difficulty between the two mechanics makes a shared score board unfair.

Both keys are used in the same source code. When I'm posting or retrieving the high scores I do a test for the keyboard and use one key if the test is true and the other key if it is false. And it works great!

JimHawkins
9
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 3rd Apr 2014 23:27
I've got a keyboard on my Kindle Fire HD!

-- Jim - When is there going to be a release?
Ched80
8
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 3rd Apr 2014 23:30
There's always one!

Does AppGameKit recognise it as a keyboard?

MASTER OF PUPPETS
15
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 3rd Apr 2014 23:41 Edited at: 5th Apr 2014 17:31
@Mobiius - Thank you. That is what I meant.

@Ched80 - By the way, great work on Holey Cow thus far. I've been following the various entries for the competition.

@Phaelax - I started asking questions before adequately testing anything for myself. My apologies for any confusion.

|,,|, (Dead Knot Broken) ,|,,|
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Apr 2014 03:53
I'm making a lot of changes to the website and database, most of which should be transparent. I'll add an option to generate additional keys for each game so you can keep your scores separate from iOS/Android/PC.

I'm also going to change the name of the file eventually, but I'll let you guys know before I remove the test.php. How you use it won't change, just the server address.

Jeku
Moderator
15
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 6th Apr 2014 06:15
How cheatproof is this? I can run something like Charles and easily see all the POST variables sent to any URL from any app, so could I technically spoof it and submit a crazy high score?

Senior Developer - CBS Interactive Music Group
Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 7th Apr 2014 00:21 Edited at: 7th Apr 2014 00:22
This looks great and I already have a published game in desperate need of a high score table! I registered, clicked the link in the email which takes me to the 'whats new' page, but then I cannot log in with my details? I registered with the same user name as here... Any ideas Phaelax?
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Apr 2014 03:55 Edited at: 7th Apr 2014 04:56
I see what you mean Jeku. (that's a neat program btw) I'll have to work out an encryption method to obfuscate the data being sent then decrypt server side with a private key. If you know of a good scheme to use I'm all ears.

SSL would be fix, but as I'm on a shared hosting server I don't know a certificate would work in that regards. Does AppGameKit support https?

Edit: I can do an SSL connection to the script, but I don't know if AppGameKit can.

Funnell, I see your name was registered 3 times which may be causing the problem. Two of the entries are active but one is still inactive. While it should still find the active entry and let you login, I've cleared out two of them anyway. You should be able to login now for sure. When you login, it doesn't show any greeting, just takes you to the front page. These little things I'm currently in the process of fixing and should hopefully have the site up tonight.

Also, if anyone has an idea for a possible name for this site (something that has an available domain) let me hear it!

Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 7th Apr 2014 12:15 Edited at: 7th Apr 2014 12:56
I can log in now, thanks!! The two duplicates were additional attempts after I posted my issue (sorry about that!), was eager to try this out

EDIT: Ok, so it appears to be an IE10 issue... Works fine on chrome, but cannot log in with IE, no biggy...
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Apr 2014 17:21
Someone else said they had IE issues. I'll have to look into that. That's for the info.

Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 7th Apr 2014 21:03 Edited at: 7th Apr 2014 21:03
Phaelax, I can't thank you enough for this, it is excellent. Have finally got a leaderboard back on BoxShot (one of our early releases)! Thank you thank you, it worked like a charm!
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 8th Apr 2014 03:05 Edited at: 8th Apr 2014 03:43
Site is currently down. I tried uploading the changes and all hell broke loose and nothing is working now. I'll report back when it's back up and you can submit scores again.


Fixed. While you can create and manage you account online now (as well as create additional game keys), score submission is offline for a few more hours.

Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 8th Apr 2014 11:11
How are things going Phaelax? I'm sure you are aware, but just thought I'd drop you a note... I still cannot obtain any scores, nor can I log in (tried both Chrome and IE)... I am getting the following;

Username and/or password is incorrect, or this user may not have been activated yet.

My username and password are both correct...
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 8th Apr 2014 22:22
User your email for the login name now, I've changed it slightly.

The script for the scores is still off, I've been on guard duty. But it will be back online today for sure.

Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 9th Apr 2014 07:54
Because I have the worst ISP in the world I can't upload the script. I'll try tomorrow after work or just have to wait until the tech comes out.... Again.

Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 9th Apr 2014 21:00
Sorry to chase you up Phaelax, but any news on this? My app is already live so am just wondering whether its worth reverting this version until these issues are ironed out... Don't get me wrong, I cannot thank you enough for this service, I just don't want to leave my app out there with a broken leaderboard for too long
Ched80
8
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 9th Apr 2014 21:34
Just in case anyone is interested, you can plan for these sorts of outages by storing the high score list locally. Obviously you need the link to the high scores first, but you know what I mean.

So what I do is: when the app boots it looks for the high scores locally, if it finds some it checks them against the high scores on the server. If there are any scores, stored locally that should be in the top ten it submits them.

This way, there is always a high score for the player to battle against.

Just some thoughts.

Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th Apr 2014 00:32 Edited at: 10th Apr 2014 00:34
Sorry about that Funnell. I did try to get it online last night, but my internet connection was being poo! But everything is back up and working like before (only better, ughh invisibly).

I'm going to write up a help file on the site as well for how to use the highscore script. The only change that's expected in the future to require updates to your own AppGameKit code is after I've implemented an encryption scheme. If anyone has written a key-based encryption routine in AppGameKit already, please share.

Ched80, that is good advice.


While I've left the test.php file up for now, you should switch to using the new address in the code snippet below. I'll leave the old one up until I've finished the encryption method (so you don't have to update your app multiple times), at which point test.php will be removed.


Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 10th Apr 2014 12:07
@Phaelax, no problem at all! Thank you so much for getting it sorted! I'll be sure to change the address for the next update.
Ched80
8
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 10th Apr 2014 21:14 Edited at: 10th Apr 2014 21:15
Hi Phaelax,

Can you check the setup? The server request is currently crashing my app and using the new syntax didn't solve the problem either.

Edit. Just to be sure, these are the modified functions in my code:





Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Apr 2014 02:48
It looks identical to my snippet, which I just tested and was working fine. Maybe there's a bug where you're calling the functions?

SageTech
14
Years of Service
User Offline
Joined: 3rd Dec 2004
Location: Orlando, Florida
Posted: 11th Apr 2014 04:36
@Phaelax

I remember asking about ssl a while ago in this thread:

http://forum.thegamecreators.com/?m=forum_view&t=195987&b=41

It looks like there is a flag to do https in the set host command, so assuming AGK's implementation follows standards, by all means using it is crucial.

As Jeku mentioned, if this is currently using straight http without TLS encryption, then unfortunately cheating is incredibly easy, not to mention that a quick packet sniff would show me the game key, so anything the app developer can do, so could the hacker.

If your host does not support SSL, one thing you might consider is hosting your app on Amazon Web Services. They have a free tier which basically gives you a free virtual server for a year. I currently use it for all my client's hosted web sites and web applications...though as many of our projects require load balancing, we have a cluster of a dozen or so servers by this point, but for a simple high score system a single vps server should be more then up to the task. It does require knowledge of how to use a basic LAMP Stack (I assume this is done in PHP and MYSQL).

It would be nice if AppGameKit had a more rich HTTP command set, if they implemented allowed for manipulating headers and sending GET, POST, PUT, and DELETE requests, then you could do the service as a full RestAPI, which is quickly becoming the standard in exposing external services like this.

Great work though! I kept on telling myself I would get around to doing something like this, but I never could find the time. Glad to see there was someone else willing to step up to the plate ^_^.
Ched80
8
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 11th Apr 2014 07:25
Hi Phaelax,

Did you test with Android? the new setup seems to work with Windows, but seems to crash the game on Android. I am confident my commands are correct because the game was working before the changes were made on the server. Now the game just crashes.

I've had to revert back to local high scores just to prevent the game from crashing.

Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Apr 2014 19:16
Does the old script work for you Ched? I don't have an android to test. You can try adding index.php to the request. Maybe the android command needs a specific file.

Sage, yes I had originally wanted to do something like that. If agk can in fact do https then I'll test it tonight. It's a shared hosting server so it'll have a funny address.

Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 11th Apr 2014 21:27 Edited at: 11th Apr 2014 21:28
Phaelax, it crashed for me too (with old info)... One thing I think I've noticed is that are you returning more that 10 names now?? If so, that may be the issues, as I am parsing the data under the assumption that max 10 names will be returned (else it will go out of bounds). If you have changed this, then I will need to alter the code to accommodate...

Ched80, could this be the issue for you too? AppGameKit isn't that great with 'out of bound' errors and often just crashes.

Login to post a reply

Server time is: 2019-06-25 23:08:53
Your offset time is: 2019-06-25 23:08:53