darkdks / KF2ServerTool

Killing Floor 2 Server Tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMD -addmap breaks server config

Lartza opened this issue · comments

commented

Describe the bug
After adding a map with the CMD tool, server listens on port 0

To Reproduce
Steps to reproduce the behavior:

  1. Setup a server fresh and confirm it's working
  2. Run KF2ServerToolCMD -addmap https://steamcommunity.com/sharedfiles/filedetails/?id=643383080 (or any other map)
  3. Run the server
[0000.02] Log: Automatically setting Steam query port to 19238 (server port is 0)
[0000.02] Log: Automatically setting Steam port to 12783 (server port is 0)

Expected behavior
Tool doesn't break the server config. Server should keep running on default ports.

Desktop (please complete the following information):

  • OS: Arch Linux
  • Version of the tool 1.2.5?

Additional context
Diff of config folders. DownloadManagers modified manually other changes by the tool.
https://gist.github.com/Lartza/53d523f09d2fec3064a04afa205e546d

Hello Lartza,
There is only one line the app should touch in this section, the DownloadManagers. It's strange, maybe the server is generating strange config by wrong DownloadManager setup changed by the tool. I will investigate what is happening. Once I have some probable fix or i need help reproducing the bug I'll be back here. Thanks for the report.

commented

I realized I started the server after running the tool, and a lot of the changes came from there. These are the changes the tool does and the server deems invalid and then "fixes" them https://gist.github.com/Lartza/a865dc34492d35342140e339ac8f5153

Working on it I found the main problem.
Looking at the hex I saw when the tool touches configuration and saves it, 3 hexadecimal values are added to the beginning of the file.
EF BB BF
This is a BOM for UTF8 encoding, and is just added on Linux (that explain why i never had problem with that(since the tool is used 99% windows, my guess.).
Either way, this extra hex causes the server to see an invalid first line(header section), restarts the section, and redo it at the end of the file (even in a text editor looking identical).
For the other problems I believe has already been solved without major problems.
I hope to post a release soon and not break your server again. Thank's for your help.

@Lartza
Can you confirm if the version in Beta branch resolve this issue?
https://github.com/darkdks/KF2ServerTool/blob/beta-debug/code/KF2ServerToolCMD

commented

Server does indeed seem to work correctly now