Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] High Score server

Started by fubz Apr 19, 2006 at 12:54 PM 4 replies 850+ views
Original Post
fubz
fubz
Is there a way to make highscore table that will use my website for a server? or posibly MyJavaServer.com? Do they run little java apps on them allowing me to connect my game to it so i can send and receive high score data?
Son of Cain
Son of Cain
You can create a Servlet that queries a database table (or any other means of persistence) and returns the result to the caller. In your game, you connect to your Servlet via the HttpConnection object, keep tracking of its InputStream to read data from it.

Son Of Cain
a.k.a javabeats at yahoo.ca
5MinuteGaming
5MinuteGaming
I have been wondering about this too. Since I have an applet game that I'd like to add a highscores list to.

Though I don't believe that HttpConnection works within an applet loaded from the internet. I tried it once and got a Security Exception. I was going to attempt to use cgi or php to do it but haven't figured out a way to make the highscores list secure.

Even a script called from the Applet itself is easily hackable.
fubz
fubz
I'm gonna look into that serverlet some more, I also thought of this during my pondering times.

1. the game will encypt the data with a custom algorthm, which can be and probuly will be defeated by a quick decompile. Then it would send it to a php page, which would do the database handling.

2. Then the game willl take a screenshot of the scoreing area, and upload it along with the scores, this way they can be compared for cheats, which could also be hacked, but that will make it harder.
Son of Cain
Son of Cain
- 5MinuteGaming:

To do what you want, you may need to read this.

- OP:

I don't understand your need for encryption; If you're sending data through the streams, that'd be hard to capture, and also, you could encrypt it with your own protocol and decrypt it on servlet side. Also, there's no need for the PHP layer, if you're already using a servlet, why not let it also query the database? Just my opinion though, YMMV.

a.k.a javabeats at yahoo.ca
capn_midnight
capn_midnight
you probably want to use some sort of Web Service paradigm. You're application would make a HTTP Request to the Web Service, just as a normal web browser would make of any website. That way, your implementation of the High Score Server is completely independant of the game itself. You could write the game in Java and the score tracker in PHP, Perl, or any other server-side language.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.