Freelancer network protocols
-
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
-
Here’s a few programs to muck about with packets. PacketStats calls IServerImpl::DumpPacketStats, generating EXE\flservertrace.txt (I was lazy, just using an existing name in common.dll). PacketStatsExit is a plugin to dump the stats when FLServer shuts down, generating EXE\PacketStats-YYYY-MM-DD.hhmmss.txt (the time when the server started). PacketLog is a plugin to log all outgoing packets (didn’t find the incoming ones, yet) to EXE\PacketLog-time.txt. I’ve decoded a few, the rest can wait.
-
New version on my site. I’ve split it into two: PacketLog now just writes the raw binary data; PacketDump converts that to text. Client packets are included; most packets are decoded (albeit with a lot of unknowns). There’s no direct hash translation, but Flunhash (and an updated CreateID) takes care of it.
-
Oh wow, nice job with all that, adoxa!
Just a slight thing I noticed which could be improved on. (I think.)
The server news’ reversal is broken.
18:17:37.106: size = 58, FLPACKET_SERVER_MISCOBJUPDATE, offset = 0x25C28
flag = 0x0010
name = abcdefghijklm
001E: 6E 00 6F 00 70 00 71 00 72 00 73 00 74 00 75 00 n.o.p.q.r.s.t.u.
002E: 76 00 77 00 78 00 79 00 7A 00 v.w.x.y.z. -
Figuring out of the network protocols etc. might give knowledge enough to program a Linux server.
Another thought, IPv4 is really close to dying, and IPv6 is also faster. Figuring out of this could also allow to make FL compatible with IPv6, even though DirectPlay 8 doesn’t like IPv6.