Unturned

Unturned

Not enough ratings
Dedicated Server Crash Workaround W7 Bat method
By Mr Xombie
I've noticed a few people including a few friends who host servers that crash after a certain period of time. I'm not going to go into the details of how to set up a dedicated server, for that go here, https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=286122957. This works on Windows 7. I don't have a W8 machine to test this out on, as cmd may use different commands. But hopefully this won't be relevant for too long with proper hosting tools coming.

My work around involves using two bat files.
   
Award
Favorite
Favorited
Unfavorite
Details
The first line is generic server details with one difference, Start, which without it the bat file will stop at starting the server.

The second line is a timer for 3 hours. Which seemed to be a decent point to go ahead and restart the server. You can change it to what works for you, but 4 hours seemed to be pushing it in terms of crashing.

The third line stops unturned. But windows thinks it crashes, so it launches an error.

The fourth line is a 10 second timer to wait for that error pop up.

The fifth stops the process that stops the error message. Without closing it out, it would keep the old server exe up, draining resources. And no one wants to come back to a fully crashed pc or a screen full of error messages.

The sixth line I make it wait another 10 seconds. To me making the pc wait a moment seems like a good idea, but you may change it.

The seventh line opens up a copy of this bat under a different name. Which is exactly the same except the other one would have Start unturnedserver2.bat to create an infinite loop. So your server will keep going until you close out the cmd box and stop unturned via taskmanager.

The eighth closes the cmd/bat. Without it the first cmd box closes on its own, but all the ones after it do not close automatically and revert to a usable state. Unless you want a screen full of cmd boxes, leave it in.

Bat file contents.
Start Unturned.exe -batchmode -nographics -pei -normal -sync -pvp -port:25444 -players:12 -sv -Xmx1028M -Xms1028M
TIMEOUT/t 10800 /NOBREAK
taskkill /IM Unturned.exe
TIMEOUT/t 10 /NOBREAK
taskkill /IM WerFault.exe
TIMEOUT/t 10 /NOBREAK
Start unturnedserver1.bat
Exit



If you made it this far I hope this helps and thanks for your patience. Or you just scrolled down for the bits inside the bat file.
What it should look like if done correctly.

Don't be confused I have mine set to 30 seconds, unless you wanted to actually sit here and wait three hours.