Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411512 Posts in 69376 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 06:48:08 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Online scoreboards?
Pages: [1]
Print
Author Topic: Online scoreboards?  (Read 4102 times)
Terry
TIGSource Editor
Level 10
******



View Profile WWW
« on: July 27, 2007, 04:14:59 AM »

I'm having trouble finding any information on how online scoreboards/downloadable content work, so I thought I'd ask here. Basically, I want my program to be able to check a certain txt file on my website to see the current list of custom levels available, and then download the relavent files if the user wants. Is there a C library available to do this sorta thing?

Actually, to be quite honest, I've never done any network programming at all, so I don't know where to start. Any pointers?
Logged

Impossible
Level 3
***



View Profile
« Reply #1 on: July 27, 2007, 01:03:11 PM »

A nice cross platform C library to do this is libcurl.
Logged
ravuya
Level 7
**


Yip yip yip yip yip


View Profile WWW
« Reply #2 on: July 27, 2007, 01:28:27 PM »

Yeah, I'd use libcurl or something to fetch the highscores list. Point it at a URL, dump the contents from libcurl into an ASCII buffer, clean it up a bit and you're golden.

Accepting the online high scores is pretty easy too; you could make a POST request using libcurl or just go to a special URL (e.g. http://yourgame.org/highscore_post.php?name=Ravuya+is+Awesome&score=1337).

My problem is how to make it secure. You've essentially got two problems: The user screwing with their score "on the wire" (by modifying the packet/request) or screwing with the game to make their score artificially high (by disabling damage).

SSL would probably clean up a lot of the first problem, especially if you sent hashes along with it.

I suppose you can get around the second attack by checksumming the game against an internal knowledge, but then we're getting into copy protection land.
« Last Edit: July 27, 2007, 01:30:25 PM by ravuya » Logged

Gravious
Level 2
**


"Swedish meatballs"


View Profile WWW
« Reply #3 on: July 27, 2007, 02:13:01 PM »

i use libcurl extensively with its PHP bindings on a daily basis for my job, once you get to know it, its exceptionally powerful and useful.
Logged

One day I'll think about doing something to stop procrastinating.
Terry
TIGSource Editor
Level 10
******



View Profile WWW
« Reply #4 on: July 27, 2007, 03:04:25 PM »

Cheers, I'll check this libcurl thing out Grin I was sorta half-heartedly looking at SDL_net...
Logged

Impossible
Level 3
***



View Profile
« Reply #5 on: July 27, 2007, 04:07:35 PM »

You could use SDL_Net. Its pretty straightforward to write your own HTTP Get using TCP sockets, but libcurl should be much easier to use. You won't have to worry about any low level details of setting up sockets, sending the right HTTP request, etc.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic