GLBasic forum

Main forum => Off Topic => Topic started by: Kuron on 2008-Aug-22

Title: online high scores tutorial
Post by: Kuron on 2008-Aug-22
Does anybody know of any good sites with tutorials on how to setup online high scores on websites?
Title: Re: online high scores tutorial
Post by: Hemlos on 2008-Aug-23
Quote from: Kuron on 2008-Aug-22
Does anybody know of any good sites with tutorials on how to setup online high scores on websites?

1. make GLBASIC server/client game software using glbasic "networking" command list.
2. Have game Client connect to GLBASIC server and post highscore.
3. Make the glbasic server use OPENFILE() command list to build a highscore.html, and save to an open port 80 directory on an HTML WEBSERVER.

Keep in mind, server software should be used hidden, i could add a gbal API to hide programs....let me know if you need it, ill whip it up for ya.
Title: Re: online high scores tutorial
Post by: Kuron on 2008-Aug-23
Thank you, I really appreciate it, but, those really don't answer my questions.  I know how to create high scores in a game.  It is the web-side of it that I do not understand.  I am not a web guru and generally use a WYSIWYG editor for web development.  I am trying to find a way to integrate the scores into my games page and make it secure.  I found this tutorial (for another language):

http://www.clickteam.com/eng/resources/online_score/onlinescoreboards.html

But based on my lack of experience with SQL and databases in general, I might be better off saving up some money and trying to hire somebody.
Title: Re: online high scores tutorial
Post by: Moru on 2008-Aug-23
Read the help on the command "NETWEBGET()", there is some info on how to get a free webscore, mabe Gernot can release the source code of the web-page too? It needs to be made secure first though, if you plan some serious usage of it :-)
Title: Re: online high scores tutorial
Post by: Hemlos on 2008-Aug-23
You dont need a database, if youre hosting the webserver...glbasic does data.

All you need is a HTTP webserver....with this it opens a directory you spcify, to the public basically...
when someone plugs in the address, it trys to open "index.html" inside that directory.
If index.html isnt available, then it opens the directory (if you allow it to)..and thats secure enough.

And to make a program with glbasic to handle posting the data...
With glbasic you make a program that has both network commands (to communicate with the game) and openfile commands to be open for communication with your games and to retrieve high score information.
If you havent already, you will have to study those command sets, and apply the good ole elbow grease..."Trial and error" to get it working to make html scorelists....ill help with that.

The program you make with glbasic is just to retrieve, store and post the highscores.
The webserver hosts the internet of the directory you post to...nothing more.


Make the glbasic server post files with openfile() that look like this:
Code (glbasic) Select

<html>
<body>
Scores:<br>
1. Data_Name1 Data_Score1
2. etc....
</body>
</html>


Thats a very basic webpage....it need to be saved as an html document with openfile().

Its really simple.

The webserver hosts the directory, Its a directory ported on 80 on your computer, thats where index.html is found.


Thats all you need to host the files...the html doesnt need to be secure server either...
Make the glbasic highscore server repost the html every 10 minutes or hour or every once a day.
Generated by data from your program, not a human, so if a hacker were to say alter the score list, he wasted his time.....You can make your program setup to post that webpage again in a specified amount of time.

Once you have a webserver hosting your port 80.
You program the glbasic program to openfile/closefile in that same directory.
html is easy to make, and easy to make glbasic make html..

The question is , are you hosting the webserver yourself? If not, then this is likely not possible, as you will have to maintain the glbasic program and make sure it is running.

If you are setting up the webserver, then im sure we will be able to help you through making the highscore generator no problem.

If its a sql thing, youre gonna need a good IT man, i recommend, Schranz0r ;)


Title: Re: online high scores tutorial
Post by: Schranz0r on 2008-Aug-23
 :whistle:  :good:
Title: Re: online high scores tutorial
Post by: Kuron on 2008-Aug-23
It sounds like it would be best to write a CGI app to place on my server to communicate with the GLBasic game.  I am not sure if my hosting service allows custom CGI apps.  I will have to check for the details on that.
Title: Re: online high scores tutorial
Post by: Moru on 2008-Aug-23
What's wrong with PHP? Most hosts allow this, even if they run a windows server :-)

Have a look at the Scramble source code in the samples directory (_Projects_).

Edit: Also have a look at the highscore table why you need some sort of security check before entering just anything into the table...
Title: Re: online high scores tutorial
Post by: Kitty Hello on 2008-Aug-25
See the "Scramble" example game.
Just copy/paste the highscrore get/write part.
Upload your game in the showroom.
Send me an email to initialize a highscore list for you.

See example:
http://www.glbasic.com/showroom.php?game=Quantum&site=games (http://www.glbasic.com/showroom.php?game=Quantum&site=games)
OK, some script kids might "crack" that list, but they always do don't they?
Title: Re: online high scores tutorial
Post by: Schranz0r on 2008-Aug-25
LOL cheater on highscore!

Highscore = 2147483647 .... thats the bigest signed integer value  ...

WTF?
Title: Re: online high scores tutorial
Post by: Moru on 2008-Aug-25
Well, what did I say in the start? ;-P
Title: Re: online high scores tutorial
Post by: Kuron on 2008-Aug-25
Quote from: Moru on 2008-Aug-23
What's wrong with PHP?
Mainly, I am not familiar with it =D  I did find another tutorial (again PHP and SQL), but it is a bit easier to understand.  For now, I am going to leave a space for it in my site design, but just put something else in that "space" until I can get it figure out.

QuoteUpload your game in the showroom.
I really appreciate that Gernot, but some of these games are not made with GLBasic ;)
Title: Re: online high scores tutorial
Post by: Hemlos on 2008-Aug-25
Like i said, start a webserver on your computer, unlock port 80 to a unique directory.
Also Run a glbasic-highscore-server.exe to recieve the data input...it cant be cracked if you dont release your games code...because you can store the data in a separate directory NOT available through the internet.

html code is as easy as it gets, and i will help you with it if you want, send me an email.
Title: Re: online high scores tutorial
Post by: Kuron on 2008-Aug-26
Like I said, I need something I can integrate into my site.  Running a server off of my computer wouldn't work as that is a violation of the TOS for my DSL service.  Apologies for asking here, as it isn't the place.
Title: Re: online high scores tutorial
Post by: bigsofty on 2008-Sep-14
Is there any reason you can manually create your own little HTML Form as a string, with hidden fields (or use 'get' method URL with encoded fields)containing the highscore data and post it (using GLB comands) to a PHP form processing page(or whatever script language) and from there to wherever, DB, web page, etc...? No extra server side stuff needed?


Title: Re: online high scores tutorial
Post by: Moru on 2008-Sep-15
Why make it so complicated? Just make your game access this url: "www.yourpage.com/highscore/index.php?game=maze&name=Moru&score=54321"

In PHP you pick up the variables and write them to a file or a database.

The GL-Basic code is in the samples directory already, just have a look at it.
Title: Re: online high scores tutorial
Post by: bigsofty on 2008-Sep-17
Quote from: Hemlos on 2008-Sep-15

can=cant?


Woops! hehe, Im sure I fixed that with an 'edit', nm... thanks bud.

Yep, FTP should be just as good IMHO.
Title: Re: online high scores tutorial
Post by: Moru on 2008-Sep-17
In this thread, first page both me and Gernot is pointing out wich command in the helpfile and what game in the samples directory has the important parts. You don't even need to know anything outside GL-Basic because Gernot has it all prepared already.

The idea of letting the game access an FTP-server is too insecure, that would mean anyone could change your entire homepage by using just a normal firewall to see what page you are accessing since that gives away both the username and password. You can't even change the password since that would break your game.
Title: Re: online high scores tutorial
Post by: Hemlos on 2008-Sep-17
Quote from: Moru on 2008-Sep-17

The idea of letting the game access an FTP-server is too insecure, that would mean anyone could change your entire homepage by using just a normal firewall to see what page you are accessing since that gives away both the username and password.

Youre right, firewalls can produce names and passwords in a log file...some firewalls, not all...

Results of such URL reporting software existing: About serverside security:
1. call to update the PHP to update a score, is insecure at the executable game level. result: cheatable
2. call to ftp is even less secure revealing name and password of website. result: cheatable, hackable

And while we're on this subject...
Results of such URL reporting software existing: About user side security:
1. We can assume malicious programmers exist because malicious players exist?
Example: A game with a file reader/writer to pass NETWEBGET() the reportbacktomyphp.php?log=morusfirewallsecurity.log&website=ftp.aol.com&user=moru&pwd=morurulz and add something to delete the lines from that log, to hide the url webget tracers.

Ultimately my Observations are not settling.... Access to the internet via ANY GLBasic application using NETWEBGET() is insecure for both a user, and for a server at some level.
I would like to expunge my ideas for adding NETWEBPUT(). heh. (im deleting my previous post)
I would like to vote for removing the netwebget() command in place of some more secure method of transfering data over the internet: telnet? hahah, i am no longer going to dwell on this subject, i found it unsettling for my stomach.
Title: Re: online high scores tutorial
Post by: Kitty Hello on 2008-Sep-17
No, do _not_ use FTP. When you upload something, script kids can backtrace what you send, thus they have your FTP password. They will eventually delete all your content.
PHP is the way to go.
As mentioned: There is a GLBasic.com hosted online highscrore for games in the showroom, just contact me.
I can also send you the php code for the server part if you want. It's really easy.
Title: Re: online high scores tutorial
Post by: Moru on 2008-Sep-17
It would be nice with some hash-function in GL-Basic, this would make it slightly less easy to cheat/hack. I have created my own but since I'm no cryptoanalyzer I don't know how secure it is. But at least there won't be a scriptkiddy able to hack this too easily :-) I have now tested a PHP-GL-Basic solution with my simple hash algorithm and it seems to work nicely in my game.
Title: Re: online high scores tutorial
Post by: bigsofty on 2008-Sep-17
You can create an anonymous non-executable/domain restricted/upload size restricted (now that's a mouthful! :D) FTP folder quite easily? Its all down to your permissions/FTP server settings.
Title: Re: online high scores tutorial
Post by: bigsofty on 2008-Sep-17
Quote from: Moru on 2008-Sep-15
Why make it so complicated? Just make your game access this url: "www.yourpage.com/highscore/index.php?game=maze&name=Moru&score=54321"

In PHP you pick up the variables and write them to a file or a database.

The GL-Basic code is in the samples directory already, just have a look at it.

Hehe that what I suggested, that's actually posting a form using the http 'get' method with an encoded field in the URL... obviously sending the high score with some sort of checksum to stop cheating would be a good thing ;)
Title: Re: online high scores tutorial
Post by: Hemlos on 2008-Sep-17
Aye for highscores...ftp is not the answer. FTP could have some uses elsewhere tho, with login names and passwords being sent by individual user to directly access thier own personal websites. I thought the ability to upload using glbasic was a good idea. But for this intention of highscores..no...just a brainstorm for kurons situation.

PHP with encryption as moru suggests is a fantastic and viable idea.

However, in Kurons case, he doesnt really have access or ability to build a data reader using it, or am i wrong?

In a case where someone has permission to have a webserver, i still suggest making a highscoreserver.exe using glbasics direct play command library. Ive done this myself((i have a skeleton somewhere precoded)) and it works fast and efficiently..no need to add encryption as far as i know, and you can solely rely on glbasic to handle all scores internally without internet software.
Title: Re: online high scores tutorial
Post by: Kitty Hello on 2008-Sep-17
OK, who's gonna wrap MD5 then? :P
Title: Re: online high scores tutorial
Post by: Hemlos on 2008-Sep-17
Quote from: Kitty Hello on 2008-Sep-17
OK, who's gonna wrap MD5 then? :P

LOL hk, not enough time here...

Though md5 and other encryption algorithms are available on the net...
If i need to do encryption, im going to use my ovaltine decoder ring heheh :)

Isnt the internet wonderful, you can find so much usele err useful info..
The Ovaltine Magic Decoder Ring:
(http://www.businessweek.com/the_thread/techbeat/archives/decoder_ring.jpg)