Freelancer network protocols
-
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
-
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.