Results 1 to 3 of 3

Thread: Highscores to existing html file

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    5

    Highscores to existing html file

    Hi, I've created a music-based quiz program that randomly generates musical notes on a picturebox or through your speakers and you have to choose the correct note from a list of buttons on the screen or using your keyboard.

    Basically a note is generated randomly and for every question you get correct you get points added to your final score. Point multipliers and time limits allow you to get higher scores than just getting every question correct would.

    A view of what I mean is below:
    Name:  MUITKpM.png
Views: 372
Size:  70.2 KB

    Now currently I am using a very basic local highscores form to display the current game and the actual top highscores at the end. For the current game highscore I am just displaying the highscores for that game but for the top highscore, that is being written to a text file on the users machine using the streamwriter command and then is being read from that file via the streamreader command. If the current highscore is higher than the one in the text file, the text file will be overwritten with the new score.

    An example of the current highscore system is below (I've only opened it once on this PC, hence the highscores are the same):
    Name:  jslOyT1.png
Views: 433
Size:  55.1 KB

    This program I wrote for my highschool Software Design and development major project, but now I am going to TAFE and for our linux assignment we can choose to do a project of our choice and I choose to resurrect this program and port it over to linux using a similiar programming language to VB called Gambas.

    You might be wondering why I am asking for help on VB if I am using a different language. Well the languages are really very similar that if someone can point me in the right direction, I should be able to figure out a similar way to implement this for Linux as well. I also wish to have both programs identical on both platforms and work together, so that they can both update the highscore databases.

    What I basically am wanting to do is instead of having these highscores stored locally is have the top 10 highscores sent to a html file on a web server. I know I will need to use ftp to send it over but I am wondering if anyone knows a way to get these highscores to create or edit an existing html file and store the top 10 highscores in a table.

    I've created a very basic and rather quite terrible website for it (I am by no means a web developer), that will just be used for displaying the highscores here: http://www.gimbo.pw/highscores.html
    This is only for a TAFE project like I said so I don't care too much about the quality of the website as that is not what I will be marked on. I am only going to be marked on the elements that involve linux in some way. So as long as it's a functional website, it doesn't really matter if it's not the best interface.


    So that's where I'd like to store the highscores if it's possible. I'll also need to be able to read from that html file as well in order to use a sort algorithm that will organise the highscores from highest to lowest and if necessary overwrite the previous one(s).

    If this is not possible or would be extremely difficult to do, I may have to resort to just using streamwriter to write to a text file and then having that text file ftp over to the web server. And then ftp the file back to the computer to have it display the highscores in the program instead, which is fine. But it would be cool to have it go to the website itself as well.

    So if anyone could point me in the right direction or give me some advice for this, I'd be very grateful.


    Thanks in Advance!,
    masterg174
    Last edited by masterg174; May 28th, 2013 at 04:26 AM.

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Highscores to existing html file

    Well obviously the 'proper' way to do this would be to write a server level program (php or similar) to interact with a database kept on the server. If you want to retain the simple html model, however, it is just another text file so you can download and upload with ease (no need for ftp) and using String.Format it is easy to maintain a template into which values simply need to be slotted.

    The problem with that, of course, if you have many users, is concurrency, While there is no problem with multiple downloads, uploads won't play well together and synchronisation could very easily be lost. Ultimately the only reliable method is the one that I started with though I appreciate you may not want to be learning yet another language to implement that at this stage.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    5

    Re: Highscores to existing html file

    Quote Originally Posted by dunfiddlin View Post
    Well obviously the 'proper' way to do this would be to write a server level program (php or similar) to interact with a database kept on the server. If you want to retain the simple html model, however, it is just another text file so you can download and upload with ease (no need for ftp) and using String.Format it is easy to maintain a template into which values simply need to be slotted.

    The problem with that, of course, if you have many users, is concurrency, While there is no problem with multiple downloads, uploads won't play well together and synchronisation could very easily be lost. Ultimately the only reliable method is the one that I started with though I appreciate you may not want to be learning yet another language to implement that at this stage.
    Hmm you may be right, php/DB would probably be the best method as its natively supported by VB. I will look into that method, as I would like it to be as fast and efficient as possible and I'm sure there are many methods available online that would help me With the scenario I am wanting to do. I'm guessing if its involving a DB, I would also need to use SQL, which I know a little of already cos i used it at school last year.

    On the other hand, at this stage it is just for a simple TAFE project, and will only be used by a small minority of users, but its something worth implementing now if I can figure it out.

    Im wondering in this case, whether or not I would need to use a highscores.php file than a HTML file though? Or would I just have a separate php file that interfaces with the currently existing HTML file. I suppose having the one php file would be easier to manage.

    In regards to not needing FTP with the HTML model, I'm a little confused at how I would update the text file on the web server without authenticating the website?. And i do agree it is quite slow, even just me trying it once with VB was very slow to open the port etc.

    I will try the php method though as I think that would be the most efficient way.

    Thanks a lot for your help,
    Masterg174

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width