The writecharfile FLHook command
-
Hi,
For FW:TOW we want to be able to create (cap) ships from the web interface, so through FLHook socket. I intended to use writecharfile for that.But I cannot get the writecharfile command to work.
I know the string to write with must have the CRLF replaced as \n and I know that the player ship must be logged out (kicked) before the command is given.
If I do readcharfile the output looks like this:
l l [Player] l description = 00310031002f00310033002f00310031002000300039003a00350038003a0030 0038 l
So there is an l (L) and a space before each line. I tried it with "l " and without at no avail.
The ship_archetype and equip lines have hashed identifiers. I know how to translate nick names to hash.
What I tried is taking the hashed names from an existing charfile (with readcharfile) and replacing those in the writecharfile string of the target ship, which does not change that ship (after login).
FriendlyFire suggested that using actual nicknames instead of hash code should work as well. I tried that too but it doesn’t work.Has anyone got this actually to work? Do you have a solution?
-
I found the solution.
Not only should the player log out with his ship, but close Freelancer entirely, for this command to work.Instead of using writecharfile, I could also directly change the ship’s fl file on the server. However this has the same problem; the player of the target ship must close his Freelancer entirely.
-
Disconnecting from the server should be all that is required. There is no difference between a disconnect (not going to the character selection screen, an actual server disconnect) and closing the game entirely.
The kick function does just that.