Homegrown Dedicated Server: DedCon 1.6.0_svn1038

Discuss your new mods and themes here

Moderator: Defcon moderators

User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Homegrown Dedicated Server: DedCon 1.6.0_svn1038

Postby bert_the_turtle » Tue May 29, 2007 12:37 am

I though it would be time for some serious code hacking, so I'm working on one :) It's nowhere near usable yet, but I managed to connect to it with two clients, start a game, and place some units:
Image
I don't know why the wrong territory is highlighted here. I probably made too many assumptions at one point or the other in the protocol. It's likely I need to flip one of those "this is always 1" numbers up to 2.

The nice thing about Defcon's network protocol is that I don't have to have the least clue about how the game commands work. If I'm happy to let all commands through unchecked, the server only has to record the client commands in a big queue and redistribute them to all clients in the proper order. The server is only responsible for the connections, the correct "beat" of ten ticks per second, for managing who can play, and for sending the active game settings to the clients. The rest is handled purely by the clients. Quite convenient for me. Connection management works, player management works half (the important half: adding players), the beat is currently too slow. Settings are a bit awkward on the network level; I'm planning to let the dedicated server fetch and store settings directly in the right format for the clients from the full game. Also missing is the communication with the metaserver and answering to score queries. They will never be fully functional because the server doesn't know about the scores, but at least, it will know who is playing. And I don't know at all how reconnection after you drop is supposed to work. So, don't ask when it will be done :)

What you see in the screenshot is also the biggest problem (and proof that I'm not just making stuff up) that I won't be able to get away, and that's why I'm already posting this, to get some early feedback. As you see, both players are in the game as demo players. That is because I used connections from a client with only a demo key when I analyzed the network protocol, so far, the actual player keys are completely ignored. Had I used a client with a full key, both players here would be full players. Not that it matters much, both are able to play. Whatever I will do about it, a reasonably skilled hacker will be able to remove it and play without demo restrictions. The same probably is true for the main Defcon program, but the dedicated server will be a lot smaller and the right places to modify will be much easier to find. Although I'm an Open Source guy, I won't be able to release the source for this thing.

Any version I distribute or run publicly will of course to some proper key checks. If I can't manage to decipher the metaserver key validity query messages (unlikely), I'll at least check for demo keys. But still, there is the risk that someone modifies the server in an evil way.

So, question, basically going out to the IV staff: Shall I stop right here before potentially easy to crack software gets set free? Shall I continue and at least run some of those servers myself? Or continue and release a binary? Would the benefits of having a dedicated server outweight the risk? The benefit would be lots of reliable servers that don't shut down until the last player quits, thus happy players and more customers by word of mouth. The risk would be a cracked dedicated server without demo restrictions. Making the binary only available for Linux would minimize the impact of that risk, I guess, without destroying the benefits too much.

Oh, and any good ideas for a name? I was thinking about SDI, Inofficial Dedicated Server (backwards), but you probably have better ideas.

Edit: the test releases can be fetched here: http://dedcon.simamo.de/
Last edited by bert_the_turtle on Tue Feb 21, 2012 1:13 pm, edited 13 times in total.
User avatar
caranthir.pkk
level3
level3
Posts: 265
Joined: Sun Jan 14, 2007 2:03 pm
Location: France
Contact:

Postby caranthir.pkk » Tue May 29, 2007 1:49 am

I don't understand what you are saying, but you wrote dedicated server and that sounds fantastic! Keep up the good work! 8)
User avatar
shinygerbil
level5
level5
Posts: 4667
Joined: Wed Dec 22, 2004 10:14 pm
Location: Out, finding my own food. Also, doing the shinyBonsai Manoeuvre(tm)
Contact:

Postby shinygerbil » Tue May 29, 2007 7:43 am

Keep it up, but I wouldn't release anything for now. ;)

(You might get more of a response if you email IV, but I expect you already have done!)
Here is my signature. Make of it what you will.
Image
User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Tue May 29, 2007 11:26 pm

Fleet placements gave me a bit of a headache. If you place a multi-ship fleet, the client sends that to the server with every ship in its own network packet, the server has to take care to combine them into one. Otherwise, ships will get semi-lost (they turn up again in your reserves, but they are not placed).

A sneak peek preview is now available. I'm running a dedicated server right now, with default settings (that's the only thing it can do right now) and not on the metaserver (still unimplemented). Demo players and paying players are distinguished (but nothing is done to stop three demo players from playing at once), everyone starts as a spectator. There are no AIs unless you count the replacements for players who quit.

Server IP: moosnet.homelinux.net
Server Port: 5020

Enter that into the manual connection form and you should get to it. The server runs in an endless loop and restarts the game when all clients have disconnected. Please report all problems you encounter if you test the thing.
User avatar
Chris
Introversion Staff
Introversion Staff
Posts: 1172
Joined: Sat Nov 25, 2000 7:28 pm
Location: Cambridge, UK
Contact:

Postby Chris » Wed May 30, 2007 12:29 am

I'm happy for you to continue investigating this for now. I don't see any major security problems - your dedicated server will still need to use a valid authentication key in order to register itself on our metaserver. This means if we start seeing bogus dedicated servers that allow full permissions for anyone, we can just ban the key used by the dedicated server.

We'd obviously hugely prefer it if your dedicated server _does_ perform full key authentication on all connecting clients, as Defcon servers currently do, and also refuse to allow demo users to play.

Good luck!
User avatar
Hank Scorpio
level2
level2
Posts: 178
Joined: Fri Feb 23, 2007 8:34 am

Postby Hank Scorpio » Wed May 30, 2007 1:31 am

<3 Bert, you legend. This is what we need for Tourneys etc!

Keep up the good work champ.
User avatar
hellcatv
level2
level2
Posts: 180
Joined: Sat Sep 30, 2006 8:58 pm
Contact:

Postby hellcatv » Thu May 31, 2007 12:11 am

what about giving him a blank check to release the source :-) it's clear there's nothing that needs to be closed about this--and it could allow us to all collaborate on it to some extent
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Thu May 31, 2007 9:03 am

There is need to stay closed. It's the server's responsibility to prevent (I hope I didn't forget anything)
- players entering with cracked keys
- players sharing the same key
- keeping demo players out of non-default games
- keeping more than the specified amount of demo players (it's actually a variable sent by the metaserver, IV could do "unlimited demo" days) out of default games
And every single one of these checks will be easy to locate and eliminate in the source code. I'll show the code to IV and let them decide. I'll also use this to rub in how easily my own cheats can be fixed :)

Chris: Thanks. I assume that if the server itself would be using a demo key, but settings no normal demo player could have, that it would simply not appear on the metaserver list? Or that this is at least a possibility? Would there be limitations on the number of servers that can be hosted at the same time using the same key? My understanding is that the function of the key is that it allows you to play, and that hosting should be more or less independent of that. The dedicated server uses so little resources that at least I would like to run several of them at the same time, and I also would like to play on my own or other servers without having to shut the dedicated servers down.

After testing: Hmm, looks like IV disagrees on that a bit. Only one server per key (or possibly key/IP pair) is listed on the metaserver. Sounds like the key entitles you to use the metaserver to advertise one game. Well, I'll give the server the option to stop advertising itself to the metaserver after the game started.

Progress report: Yesterday late at night, I had a two player game against the Emperor and snwcrsh watching, with me losing badly of course, on my dedicated server. The server was on the metaserver list. So, the basic functionality is finished. My understanding of the protocol has improved a lot since I started (It took a while to realize that all the 01, 03, and 04's in the data stream that seemed to have no meaning actually specify the data type of what comes next, duh), the code is in for some heavy refactoring.

The server ran in new instances for a couple of minutes after that test. Players who entered were visibly confused. I should add a fake host player that enters at the start, says some configurable stuff, then leaves.
User avatar
caranthir.pkk
level3
level3
Posts: 265
Joined: Sun Jan 14, 2007 2:03 pm
Location: France
Contact:

Postby caranthir.pkk » Thu May 31, 2007 4:30 pm

I saw your test server online yesterday evening and played around on it by myself. Placed everything, shot everything! Great! =)
Sirthomasthegreat
level3
level3
Posts: 466
Joined: Fri Oct 13, 2006 12:18 am

Postby Sirthomasthegreat » Thu May 31, 2007 10:30 pm

Yeah, the connection times where amazing.
User avatar
prophile
level5
level5
Posts: 1541
Joined: Fri Feb 18, 2005 4:17 pm
Location: Southampton, UK
Contact:

Postby prophile » Tue Jun 05, 2007 10:52 pm

This receives an official Prophile Seal of Approval.
User avatar
Smiling Buddha
level3
level3
Posts: 263
Joined: Fri Apr 20, 2007 7:35 pm
Location: Omnipresent Occupation: Supreme Buddha

Postby Smiling Buddha » Tue Jun 05, 2007 11:31 pm

prophile wrote:This receives an official Prophile Seal of Approval.


Your 'Seal of Approval' pales to insignificance when compared with xander's mighty Chuckle of Approval.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Tue Jun 05, 2007 11:41 pm

Smiling Buddha wrote:
prophile wrote:This receives an official Prophile Seal of Approval.


Your 'Seal of Approval' pales to insignificance when compared with xander's mighty Chuckle of Approval.


I would give this a Chuckle of Approval, but it is not funny, it is serious. The Chuckle is only for things that are funny. Thus, prophile's Seal of Approval is the best that bert can hope to get.

xander
User avatar
creator
level3
level3
Posts: 294
Joined: Wed Dec 20, 2006 10:57 pm
Location: Cornwall, England

Postby creator » Tue Jun 05, 2007 11:46 pm

I played this today, worked well until about half way through when every player got a connection error...and couldnt reconnect.
Sirthomasthegreat
level3
level3
Posts: 466
Joined: Fri Oct 13, 2006 12:18 am

Postby Sirthomasthegreat » Tue Jun 05, 2007 11:47 pm

How close are you to release?

Return to “Mod Projects”

Who is online

Users browsing this forum: No registered users and 8 guests