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.