Hello, as I promised I writing the article about Public Online Scoreboard 0.5 (http://theclickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=125177#Post1251 77) and linking it with MMF2 game. So, here we go!
[size:14pt]Required objects (extensions)[/size]
- Url Encoder
- QuickHash (or another objects that supports SHA1 hash algorithm)
- The Big Box
NOTE: This article isn't about installing Public Online Scoreboard - there are instructions in archive. At the end of article I attached the archives of POS.
[size:17pt]Adding objects to frame and renaming[/size]
So first we add Url Encoder. Then we renaming it into UrlEnc
Then add The Big Box and rename it into "box". After that add quickhash, call it qhash and finally add EditBox and call it name.
[size:17pt]Alterable Values renaming[/size]
Go to the name's properties. Click Values (a-z icon) and in Alterable Strings click 3 times New. Now rename Alterable String A into hash, Alterable Value B into quote, and Alterable Value C into specialstring. Then edit quote value and assign it a single quotation mark ("). After all set specialstring to THE SAME string what you entered in $specialstring variable while Public Online Scoreboard instalation (by editing config.php)
[size:17pt]Time for events[/size]
Well, so far, so good. Now it's the harder part.
Add event and in name's column add actions:
Set text: "John Doe"
Set focus on
Now in UrlEnc's column add action
Encode spaces as "+"
Then add event "name" has just been modified (name is our EditBox, remember?)
To this event add action in name's column action
Set alterable string hash to get SHAOne Hash$( "qhash", Edittext$( "name" )+specialstring("name")+Str$(score( "Player 1" )))
Then hardest part - executing the submit script. Very well.
We create event Upon Pressing a key ENTER event. Now in box's column we add action open a file/website with parameter (expresion):
"http://your.site.address.net/submit.php?name="+quote( "name" )+urlEncode$( "UrlEnc", Edittext$( "name" ))+quote( "name" )+"&score="+Str$(score( "Player 1" ))+"&h="+quote( "name" )+hash ( "name" )+quote( "name" )
Where your.site.net is an address of your website (if POS is installed in subdir of your website, what is recomended, include it into addres, eg. http://your.site.address.net/scores/submit.php?...)
And all folks! Submit.php executed, score added to database!
And one little note about HighScores option. When you execute it you must use The Big Box object too, but enter in address something like: "http://your.site.address.net/view.php".
Tomorrow I will add some pictures like in my previous article. Today is 11:54 PM, and I am very tired.