Freelancer network protocols
-
Hiya,
I was just wondering if anyone has done any work on documenting the Freelancer network protocols. I’m interested in both the client–>lobby server protocol and the client–>game server protocol.
I’m guessing that whoever built fllistserver knows some things I want to find out.
I’m about to start dumping and digging with Wireshark, and I’d prefer not to duplicate effort “discovering” something that’s already known.
If anyone knows anything, I’d be grateful for your help.
-
Maybe you should try to contact crazy, he built the fllistserver:
http://fllistserver.com/news/index.php/contact/Other persons I could think of who might have done some work with the network code are Wodka (-> GLS WOrkaround), M0tah and Adoxa, maybe also Cannon…
-
I’ve contacted Crazy, as suggested. Who’d have thunk, using the contact link might work… Facepalm!
I’ll let this thread percolate for a while before I start harassing people too much.
It’s interesting, there’s a ton of source code and documentation for just about everything floating around, but Google comes up dry for FL network protocols. Y’all have been busy, and I’ve got a virtual stack of tutorials and code to read. Fun stuff!
-
Started work on the GUN protocol tonight.
I did a pcap of the FLServer->fllistserver GUN conversation. Started the server, ran it for a bit, shut it down.
I’ve stepped through it packet by packet. I now have a rough overview of the conversation and things look reasonably simple, though I need to run several similar captures to see what varies and what doesn’t. I have an awful lot of ‘unknown’ bits in there.
I’m a wondering a bit about the purpose of the RSA key that the GUN server sends to FLServer during registration. Signed messages? Encrypted blobs? Private keys buried in DLLs somewhere? Oh, the horrors that await me.
I’m assuming that Freelancer is a DirectPlay 8 game?
As always, any insight is welcome.
-
Here’s a GUN protocol question. The following is sent from FLServer to the GUN server during the registration process.
<hostdata cx="0x0"><hostdata> </hostdata></hostdata>
Anyone know what the GameOpts field contains? It’s a “:” separated list of values. The “13” is the max players for the server being registered, and I’m guessing the 1’s correspond to the PvP toggle, etc in the FLServer UI - but not sure which position maps to which checkbox yet.
The 2302, a7472e28-e0d5e38a-3b0c0e04-33c3b10d, and -1488507352 values are a mystery to me at this early date.
Also, GameV, NumP and Cx are not understood yet. Locale and Cx always seem to be 0 and “0x0” respectively. So zero. Yeah.
Interesting stuff.
-
Since I know the least, I’ll give you everything I know right away…!!
2302 is the standard server port number for players to connect to it. It can be changed by editing the shortcut to add /Pxxxx after the command. It needs to be passed by firewalls and routers.
Port 2300 is used as standard by all FL servers to talk to the Global List Server.
The range of ports 2300-2400 are used by FL and FL Servers.
Over and out, can’t help more, only distract!
-
2302 is the standard server port number for players to connect [to flserver]
Thanks, I should have caught that! It’s 1:45AM here and I’ve been at this for too long.
Almost made it through the binary handshake at the beginning of the GUN registration now.
-
Hmm, and I just realized “a7472e28-e0d5e38a-3b0c0e04-33c3b10d” is the player’s account ID for multiplayer, the one you’re supposed to copy down in case you have to reinstall FL. Perfect.
Gotta wonder why they’re sending that to the directory when you start your own server.
-
I’m a wondering a bit about the purpose of the RSA key that the GUN server sends to FLServer during registration. Signed messages? Encrypted blobs? Private keys buried in DLLs somewhere? Oh, the horrors that await me.
As far as I remember, the RSA key is not used at all, you can simply ignore it.
-
ariaxu wrote:
<hostdata cx="0x0"><hostdata> </hostdata></hostdata>
Also, GameV, NumP and Cx are not understood yet. Locale and Cx always seem to be 0 and “0x0” respectively. So zero. Yeah.
Interesting stuff.
About the GameOpts:
It is a combination of the params you can select when you start your server.
I can’t remember the order but it’s Port, max players, allow new players (yes, no), allow player to harm other players (yes, no) and passworded (yes, no).As far as I remember … NumP is the “page” number you are requesting. Means… Page 0 will give you the first server, page 1 the second etc. Cx could be the server count but I’m not sure right now.
Also, the original listserver used dome dynamic values as time etc. But as the doesn’t seem to have any effect I’m always using the same time value.
-
ariaxu wrote:
Hmm, and I just realized “a7472e28-e0d5e38a-3b0c0e04-33c3b10d” is the player’s account ID for multiplayer, the one you’re supposed to copy down in case you have to reinstall FL. Perfect.Gotta wonder why they’re sending that to the directory when you start your own server.
It’s server’s key, not the player’s. It’s stored in the accounts.cfg in some other form.
-
A few months back I looked for directplay implementations but I could not find any.
I have implemented a fragment of the directplay. I lost motivation as I intensely hate implementing windowed protocols. The fragment was sufficient to pretend to be a FL server, i.e. show up in the multiplayer server window but nothing else.
Why are you interested in the FL network protocol?
-
A few months back I looked for directplay implementations but I could not find any.
Some incomplete work at Google Code, including a run at creating a Wireshark protocol plugin. Microsoft’s protocol seems fairly well documented.
I have implemented a fragment of the directplay. I lost motivation as I intensely hate implementing windowed protocols. The fragment was sufficient to pretend to be a FL server, i.e. show up in the multiplayer server window but nothing else.
If you are willing to share that fragment, I would appreciate it. I’d like to move on to the in-game stuff. Right now I’m just trying to identify fields and message types in the binary UDP exchange prior to the XML “game registration” with gun.fllistserver.com.
Why are you interested in the FL network protocol?
Most of it is just curiosity. I’ve been spending a lot of time trying to get my bearings within the structure of the game, and part of that is documenting things as I learn them, and reading other people’s work.
The fact that there doesn’t seem to be any publicly available information about the protocol is a motivator. I know some people know how it works, and I don’t, and that’s enough to get me going on the problem. I’d love to see an open-source, extensible Freelancer server and server directory, or a packet-inspection system that allowed for advanced anti-cheat (yay pie-in-the-sky). Given time and luck, I might be able to lay the groundwork for stuff like that.
Or maybe someone who knows more will lay the groundwork out, and I can get to work on something cooler.
This might be the wrong approach; completely replacing the game protocol with something a little more sane might be workable too. No idea if that would be even remotely feasible.
-
This is quite the noble endeavour. I’ll definitely be following your work. And, if you ever need a mod to be your guinea pig to test your thoughts/ideas on, feel free to shoot me a PM