Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 11:15:53 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Faucet Lobby: Hosting your Versus compo game lobby
Pages: [1]
Print
Author Topic: Faucet Lobby: Hosting your Versus compo game lobby  (Read 2448 times)
MedO
Level 1
*


View Profile
« on: January 31, 2011, 03:44:09 AM »

I've read that people are looking for a lobby server for their Versus compo games, to allow players to find running servers. Since our own lobby service at ganggarrison.com is rather bored, I'd like to offer everyone to use it for their Versus compo game. It has a "protocol id" mechanism that will only show servers to clients with the same id, so it can be used for several games (and several incompatible versions of the same game) without a problem.

I'm offering this only for this compo - if your game remains popular for months, with more than a dozen servers or so online at once, please try to find your own solution instead. I can give you the source code and jar file for the lobby. It could be helpful if you don't point to ganggarrison.com directly, but use a dynamic dns service, so that you have the option to switch to your own lobby server later without changing the game.

If you want to use this please post here with the unique ID of your game, so that I have some overview in case things get out of hand. The ID should be randomly generated, e.g. with a random UUID generator. If you want to, you can donate to help us cover our server costs.

Now, how do you use this mysterious lobby? When you have a game server running, it should send a UDP packet to the lobby (ganggarrison.com, port 29942) every 30 seconds with the following content:
Code:
#Bytes	Meaning
6 Magic Numbers which have to go at the start of every registration packet: 4, 8, 15, 16, 23, 42
1 Lobby protocol version: 128
16 Game Protocol ID. Clients will only see servers with the same Protocol ID.
2 The port number the game server is running on (Little endian, i.e. least significant byte first)
1 Length of the server name
0-255 Server name

On registration, the lobby checks whether the game server is actually reachable by starting a TCP connection to the given port and instantly closing it again. That means your game should be able to ignore connections where nothing is sent. If the connection succeeds, the game server is added to the server list where it will remain for 60 seconds. That timer will be reset with the next registration packet. The server name may differ between registrations, so you can update the description.

Clients will use the lobby by opening a TCP connection (again on port 29942). They have to send a byte with the lobby protocol version(128), followed by the 16 byte Game Protocol ID. The lobby will then reply with a list of servers in this format:

Code:
#Bytes	Meaning
1 Number of servers in the list
For every server
1 Length of the server name
0-255 Server name
4 Server IP
2 Server port (Little endian, i.e. least significant byte first)

Have fun Smiley
« Last Edit: February 01, 2011, 09:20:36 AM by MedO » Logged
Evan Balster
Level 10
*****


I live in this head.


View Profile WWW
« Reply #1 on: February 01, 2011, 05:38:46 AM »

Awesome of you to share your service.  Smiley

(I run my own server for things like this so I won't actually use it, but awesome of you anyway)
Logged

Creativity births expression.  Curiosity births exploration.
Our work is as soil to these seeds; our art is what grows from them...


Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
Mega
Level 1
*



View Profile
« Reply #2 on: February 01, 2011, 02:57:57 PM »

Quote
Awesome of you to share your service.

I second
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic