Killing Floor 2

Killing Floor 2

View Stats:
PAINguin Feb 5, 2016 @ 1:13am
How To Automate Updating a KF2 Dedicated Server When a New Update is Released!!!
I am SICK of my server breaking every time TW releases a new update for KF2!!!


If you are lazy and do not wish to read the entire post then read this. I want to automate the server update process. I want an application/program running in the background that's sole purpose is to verify rather or not the official KF2 version has changed or not. If it has changed (either by going up a digit or being altered in any way other than what it is at that time) I wish for this script/batch file program/application to hoe to it and immediately begin the process of updating the server to the new version or to create and select a new folder, re-download the server, copy over my custom maps, start the server/close it (so that the PCServer-XXXXXX.ini files will be created and then alter the .ini files to enable the Web Srvr, insert the redirect (http://kf2.tripwirecdn.com/) and copy ALL of the custom map entries to the PCServer-KFGame.ini file, adequetely name the server with the same name my previous one had, change all of the server settings such as Team Collision, No Kick Voting, Time Between Matches, Map Select Time and most importantly create a new or activate an existing Map Cycle List with ALL of the custom maps I have." You should probably read the entire post.

I have 2 dedicated servers, only one can be up at a time if using the same Steam UID (I discovered that when I received an error stating so). Anyway, the reason I have 2 servers is because EVERY TIME a new update is released you can forget about it... Updating with
app_update 232130 or even app_update 232130 validate ends with an error which I forget at this moment but anyone who hosts a server has seen this before.

Something like, Update Failed with Error 0x0XX blah blah blah.

EVERY UPDATE, EVERY TIME!

And no...my server is not:
  • Up and running...
  • Running as a service...
  • Misconfigured...

This is what I have to do after updating fails. I have to open SteamCMD and login anonymously of course. I enter "force_install_dir X:\kf2srvr\" and press enter.

Then, I enter, "app_update 232130" and press enter. The process of downloading and applying the changes from the update begin. Everything will go as planned until you hit 100% and then boom! "Update Failed with Error 0x00XX blah blah blah". (The actual error is not 0x0XX btw) ;-)

Right now I have a batch file that I have written which simply checks to see if the kf2server.bat application is running. It will check this every 5 seconds in the background and if the server crashes due to a broken map or any other reason then the batch file sees that the application is no longer running and starts the kf2 server again (along with any parameters I add to it such as which map to begin with and what the login creds for the web interface shall be, etc.

I have setup a Task in "Task Manager" to start this batch file every time the computer powers off, reboots, etc. This way, no matter what, my server is up and people can play on it 23/6 (23 hours, 6 days a week allowing for anticipated downtime due to updates/etc).

In short, everything is completely automated. The computer I host my server on stays on 24/7 unless it needs to be rebooted for OS updates, application/virus definition updates/etc or the power goes out. Even in that case a UPS will keep the system, cable modem, router and VOiP boxes up and running without a hitch for a solid 2.5 to 3 hours.

I initially setup a VM for my KF2 dedsrvr with great success using VirtualBox (not a VMware fan unless it's in the Data Center) but after breaking my server by simply updating to the new version time and time again I thought that the issue could lie in the fact that I am running my KF2 dedsrvr on a VM with a shared NIC.

So I installed a fresh server on the secondary SSD on the host computer and guess what, it worked! But only for that one time.

When the next update was released and I updated my server using "app_update 232130" (after forcing the install directory) I get the same error I've been droning on about. I literally have to set up a brand new server in a new folder, reconfigure my PCServer-KFGame.ini with my maps list, enter the redirect in my PCServer-KFEngine.ini file, set bEnabled=true to enable the web server for admin access in the KFWeb.ini file, copy ALL of my custom maps over to the Maps folder and then update the "Map Cycle List" via the Admin Console just so the maps are visible and selectable between matches.

It's a lot of work which I have actually simplified a great deal but that is not the point. I should not have had to simplify it. These things should be taken care of for us and in fact, this updating error should not even occur. There are no answers to it ANYWHERE on the web in ANY of the KF2 or Tripwire forums... There are, however, many inquiries into why this error is occuring and how to prevent it from breaking a server.

I'm tired of my server breaking each time a large/small update is released which seems to be once every week or two these days. My main server with my fastest cable connect is still down after the previous update. This time I've created 3 new servers in 3 new folders copying my maps over 3 different times because the web server refused to let me log in.

I had this issue when I set up my first KF2 dedsrvr and quickly found the resolution here in the forums. But as of right now I have no idea why I cannot log in but that's a question for another time and I believe I can fix this, I am more concerned with the reason I started this thread.

So after all of that typing my question and hope is simple and is this:

Can I write a VBscript, Batch file or other type of script so that when Tripwire releases a new update (which we are on 1022 right now) that the program started by the script or the script itself will automatically shut down my server (properly) and update it to the new version without corrupting my files or receiving that annoying ERROR that comes up if you try to update your server using "app_update 232130" manually. Then, once done, will verify that my server's files (including the custom maps and modified .ini's) are in place and in tact (or in their updated form if that is the case) and then start my server up with the parameters which I add to the "KF2server.bat" file and just keep chugging along?

Now I can do the scripting myself...most of it... But how can I determine if a new version of KF2 has been released? For instance, we are on v1022 right now. I want an application/program or something that can access Steam's or Tripwire's API(s) and determine if v1023 has been released. Once this determination has been made then my server will shut itself down and begin the update process.

If I have to write my script so that a NEW folder is selected and a NEW server is installed each time an update is released (deleting the OLD server's folder once the appropriate .KFM's have been copied) then that's what I will do. But wow, what a process just to update your "DEDICATED" server.

It's not exactly "DEDICATED" if it is not up 24/7/365, am I right?

So, Tripwire, Steam, you guys need to be doing something about this. Or if I am doing something incorrect on my end (which I doubt simply because I have tried everything) then please let me know. Otherwise how can I automate the update process the very moment a new update has been released without me even having to touch a keyboard or login to a computer remotely?

Can this be done? Is there even a way to scrape for the data needed to determine when a new update is released without having to simply look for yourself online or see that your "DEDICATED" server is no longer in the "KF2 Servers List" indicating that an update has been released and my version of KF2 is not up-to-date?

I know that there are thousands of us out here whom are having the same problem and want a solution to this. And when I say solution I mean an actual "solution". Not a "work around" and especially not a BS excuse as to why there are even problems when trying to update ones "DEDICATED" server.

If there is a way to do what I have stated above then please share it with me. . Some of you out there may have a solution to this issue already and if you do please share it with me and the rest of the community because if we want to minimize our server downtime then something has to be done about this.

Thank you for reading my long post and I hope it opens some eyes and gains the attention of the individuals whom need to know this.

Let's automate this SoB and if it fails or that error pops up then that will be recognized and a new folder will be created, selected and a new server installed in that folder while copying all custom map files to the proper folder(s) and waiting to modify the .INI files until the server has created them after its first run.

Thanks again fellow gamers! Hope we can come to a solution.

Regards,

PAinguIN
Last edited by PAINguin; Feb 5, 2016 @ 1:26am
< >
Showing 1-4 of 4 comments
Vlad Feb 5, 2016 @ 2:06am 
Interestingly there is already code that should be doing that (KFSteamWebUpToDateCheck class). It issues a call to
http://api.steampowered.com/ISteamApps/UpToDateCheck/v1?appid=232130&version=1022
where 1022 is the version of the server you are running. If the server is out of date, the class does call StaticSetNeedsRestart, but what exactly that does is hidden in native code.
PAINguin Feb 5, 2016 @ 2:30am 
Hmmmm, nonetheless, this may be very helpful my friend. Assuming that this will be updated immediately upon the software update's release then it may serve as a marker for my script(s) to begin.

Do you have any idea why that error comes up when trying to update an existing dedicated server? I'm sure you've seen it before.

Thanks in advance for the info and your response!!!

PAinguIN
Vlad Feb 5, 2016 @ 2:44am 
Actually no, to be honest I'm not sure what the error is. I've been updating my server just fine, and never needed to create another folder.
Last edited by Vlad; Feb 5, 2016 @ 2:47am
PAINguin Feb 5, 2016 @ 4:20am 
I'll upload a screencap of it.
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Feb 5, 2016 @ 1:13am
Posts: 4