123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|588|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> On Topic -> Test : Online highscores (!)

Thu, 21 Feb 2008, 09:55
Jayenkai
Alien Deathmatch - Now with online highscores - The "beta testing online stuff" edition!

I'm not 100% sure it's stable, but it is at least 50%, so that's not bad!!

Play, earn highscores, upload occasionally, sorted..
(hopefully!)

If there are any issues, let me know.

-=-=-
''Load, Next List!''
Thu, 21 Feb 2008, 13:00
Phoenix
Time well spent

Seems to work without problems -- nice work!
Sat, 23 Feb 2008, 05:35
Yo! Wazzup?
This makes me A LOT more competitive...

It was hard before, and it's still hard now, but it makes me want to get a good score and it makes me want to get better

-=-=-
Hi everyone! I'm new to Blitz and only 10 years old so all things coding is gush to me
Sat, 23 Feb 2008, 06:13
mole
beautiful. Except, I don't like 'Dragon'; his hi-score on Trainer is ridiculous ^_^
Sat, 23 Feb 2008, 06:19
Jayenkai
Yeah, except TAM managed to completely clobber that score!
Whoever that is... *shrugs*

-=-=-
''Load, Next List!''
Sat, 23 Feb 2008, 06:22
Yo! Wazzup?
I hate Tam. He/She hogs up all of the hiscores. .

I say Tam HACKED IT!!! JK

-=-=-
Hi everyone! I'm new to Blitz and only 10 years old so all things coding is gush to me
Sat, 23 Feb 2008, 08:03
shroom_monk
I've been thinking... what's to stop someone from editting one of the maps, then playing that and submitting the score. That would rather unbalance things... a lot.

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Sat, 23 Feb 2008, 08:24
Jayenkai
I had implimented a secondary checksum on maps, but it had to be removed temporarily when I did the online scoreboard.. (mostly because it couldn't check the layout of the level, because the scoreboard doesn't hold it!!)

However, the next release will include level up and downloading, so it should be quite a bit safer.
I've got a system setup to ask people to upgrade once the new system's ready, so all should work nice and smoothly

In the meantime, don't cheat, or it'll be blindingly obvious to all.. and I'll be able to kick you off the scoreboard with ease..

(apologies for possible mis-spellings.. the keyboard at work keeps missing the odd few keypresses!)

-=-=-
''Load, Next List!''
Sat, 23 Feb 2008, 08:27
mole
I've been thinking... what's to stop someone from editting one of the maps, then playing that and submitting the score. That would rather unbalance things... a lot.


That's true. Those maps with loads of doors and narrow corridors now seem a lot easier ^_^

Need some way of checking the map is identical to the one a hiscore is being applied for...
Sat, 23 Feb 2008, 10:47
Yo! Wazzup?
Even just renaming a map is like changing it.
Wed, 27 Feb 2008, 14:56
Jayenkai
Okeydoke..
First up, make sure your scores are safe.
In my case there's a checksum which reads the full line of data, including the user's name, and then gives it a value. If the scorefile is tampered with, the checksum should show it. (assuming no-one figures out the checksum!)
Next, give each player a number which "should" be their own.
When you check the highscore lists, check that number to see that they have no duplicate highscores on the list. (stops the person flooding the scoreboard.)

Now to the uploading.
Head over to this showcase. It'll teach you everything you need to know about web access.

When you request the page, you can add a ?myscores=x:y:z|a:b:c type parameter to the end.
On the other side, create a simple PHP.
Read the parameters, convert them to usable data, check the checksums, check the player's number, and then update the scoreboards as detailed.
Once updated, send the data back using plain echo "Level:Score:User:\n" type stuff.
Remembering that it's important to leave \n's on the end, otherwise Blitz reads all your output as a single input line.

At that point, debuglog everything that the php is outputting, and you can use the blitz debugger to kinda debug your php, too!

Once sorted, and you know it's working, then you can start to integrate the thing into a MySQL database, or even a flat-file database if it's not too complex.
In my case, the MySQL contains a single "Highscores" text field, and all the data's just plonked into it, all in one. Saves having a bunch of fields * 10 scores.

Um, so.. Yeah.. Should be easy enough!

-=-=-
''Load, Next List!''
Wed, 27 Feb 2008, 15:15
Jayenkai
Then, in that case, thank the Shroom!
Thu, 28 Feb 2008, 10:59
shroom_monk
Jayenkai If the scorefile is tampered with, the checksum should show it. (assuming no-one figures out the checksum!)

Erm.. but didn't you post the checksum code as a Code Snippet a few weeks ago?

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Thu, 28 Feb 2008, 14:55
Jayenkai
I posted the original checksum as a code snippet, but I've since tweaked, prodded and poked the thing, mostly due to PHP's annoying habits, but also because Blitz was doing strange things on my celeron PC.

So, actually, word of advice.. That checksum's a little dodgy on Celeron processors!!

-=-=-
''Load, Next List!''
Fri, 29 Feb 2008, 00:08
shroom_monk
Hmm... but you still deleted the original checksum, and replaced it with a random string of letters and numbers.

Linky

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Fri, 29 Feb 2008, 02:46
Jayenkai
No I haven't. That appears to be a very peculiar test, or something.. The actual snippet's down at the bottom, where it says "Simple Checksum"

-=-=-
''Load, Next List!''