online lobby

Blitz3D Forums/Blitz3D Programming/online lobby

Chevron(Posted 2006) [#1]
Hi,
I have been palying with the idea for creating an on line lobby where players can locate opponents and join games etc.

My idea for a simple lobby was when the player opens the game it acceses a predefined site via ftp, downloads a file containing a list of current players, adds the local players info to this list, ip info etc and uploads it back.

The infomation of other players will then be displayed in the local program.

Can anyone see a flaw in this idea?


WolRon(Posted 2006) [#2]
-How does the list get updated if you leave?
-How can you download the file if it's in the process of being updated? I bet this would get out of hand in a large scenario.
-How do the other players know that you've joined?


Boiled Sweets(Posted 2006) [#3]
use ETNA instead!!!


Chevron(Posted 2006) [#4]
Some good points there Wolron.
-How does the list get updated if you leave?

I suppose the other players could send a ping to each of the players periodically and if there is no reply for a successive number of cycles their name is removed. If the player leaves by the correct route then of course their name could be taken of in from there machine.

-How can you download the file if it's in the process of being updated? I bet this would get out of hand in a large scenario.

The FTP would check to see if the file was in use, and retry, wouldnt take long to download,update and upload, so this shouldnt be a prob. Bit as you say, i will need to look into how practical this is in real terms.

-How do the other players know that you've joined?
When you have the list, you send the info to the other players to say that you have joined.

I know this isnt the best way to acheive this, but I just wanted to look into it as a solution for people that want to run online games but dont want to use a dedicated server or a 3rd party application.
More out of interest than anything else.


jfk EO-11110(Posted 2006) [#5]
I would try to sove it this way: You can download the list and see who's where etc. But then you are not able to edit the list. You have to join a game that is listed. The gameserver machine will then send the info about you to the server that is hosting the list and list script. The game server will send the infos frequently, or at least whenever something has chanched. The gameserver also has to send a frequent livesign ping (say every 2 minutes). If that ping is missing, the game will be removed from the list.

This can be done, although you should be prepared for pauses due to single threading of blitz apps. So when a server responds slowly, the game will hang for some time, for all players, unless you try to work around this problem somehow (eg by using external threads).

But basicly, the most sensitive part will be: make this entire thing sabotage proof. Make sure it cannot be DOSed, crashed or fooled etc by some stupid people, cause it's likely somebody will try to do that.

You need to work with data autentification etc. (use hard to guess checksums, probably encryption)