Cómo reiniciar automáticamente el servidor privado cuando falla en SCP: 5k

Asi que, considering how unstable the latest patch has made the game, I’ve encountered numerous issues with hosting my server. It crashes for no apparent reason, and I’ve heard similar complaints from others as well. Como resultado, I’ve decided to create a quick batch script that automatically checks if the server is running and, si no, restarts it after just 5 segundos.

Script Setup:

Si te enfrentas al mismo problema, and you want to fix it, there’s an issue with starting the server using a batch file, which makes it difficult to use Watchdog/Supervisor applications that usually handle such tasks. Afortunadamente, I’ve come up with a simple batch script that allows you to restart your server after a certain delay («X»), which you can adjust as needed, immediately after a crash.

Follow the steps below to set up an automatically restarting server:

  1. Create a new .bat file in your server’s directory. You can name it anything you like; the name doesn’t matter.
  2. Copia y pega el siguiente código:
@echo off
:A
Set "MyProcess=PandemicServer.exe"
set MAP=(ENTER MAP NAME HERE, CHECK FOR DEFAULTS BELOW)
set PORT=(ENTER SERVER PORT HERE, CHECK FOR DEFAULTS BELOW)
set QUERYPORT=(ENTER QUERY PORT HERE, CHECK FOR DEFAULTS BELOW)
colocar "SERVERNAME=(ENTER NAME OF YOUR SERVER HERE)"
set MAXPLAYERS=(ENTER MAXIMUM AMOUNT OF PLAYERS HERE)

title "%MAP%"
comienzo "" WindowsServer/PandemicServer.exe %MAP% -log -servername="%SERVERNAME%" -SteamServerName="%SERVERNAME%" -port=%PORT% -queryport=%QUERYPORT% -maxplayers=%MAXPLAYERS% -force_steamclient_link
goto B

:B
tasklist | find /i "%MyProcess%">nul || goto A
TIMEOUT /T 5
goto B
  1. Save the file and start it. Make sure to adjust the values accordingly; de lo contrario, YOUR SERVER WON’T START!

Default values:

MAP = Area12_PersistentLevel
PORT = 7777
QUERYPORT = 27015

The value

"SERVERNAME"

y

MAXPLAYERS

I’ve set it according to my own required values. You can adjust these as you prefer.

Por último, pero no menos importante, if you’d like to change the interval at which the watchdog checks whether the server is running or not, adjust the value.

TIMEOUT /T x

(dónde «X» is the number of seconds to wait), y guarda el archivo.

esta guía sobre SCP: 5k fue escrito por [LOKE]YourC3PH. Puedes visitar la publicación original desde este Enlace. Si tiene alguna duda sobre esta guía, por favor no dude en comunicarse con nosotros aquí.

Sobre el Autor