Skip to content

gamemann/Pterodactyl-Game-Server-Watch

Repository files navigation

Pterodactyl Game Server Watch

Description

A tool programmed in Go to automatically restart 'hung' (game) servers via the Pterodactyl API (working since version 1.4.2). This only supports servers that respond to the A2S_INFO query (a Valve Master Server query). I am currently looking for a better way to detect if a server is hung, though.

Command Line Flags

There is only one command line argument/flag and it is -cfg=<path>. This argument/flag changes the path to the Pterowatch config file. The default value is /etc/pterowatch/pterowatch.conf.

Examples include:

./pterowatch -cfg=/home/cdeacon/myconf.conf
./pterowatch -cfg=~/myconf.conf
./pterowatch -cfg=myconf.conf

Config File

The config file's default path is /etc/pterowatch/pterowatch.conf (this can be changed with a command line argument/flag as seen above). This should be a JSON array including the API URL, token, and an array of servers to check against. The main options are the following:

  • apiurl => The Pterodactyl API URL (do not include the / at the end).
  • token => The bearer token (from the client) to use when sending requests to the Pterodactyl API.
  • apptoken => The bearer token (from the application) to use when sending requests to the Pterodactyl API (this is only needed when addservers is set to true).
  • debug => The debug level (1-4).
  • reloadtime => If above 0, will reload the configuration file and retrieve servers from the API every x seconds.
  • addservers => Whether or not to automatically add servers to the config from the Pterodactyl API.
  • defenable => The default enable boolean of a server added via the Pterodactyl API.
  • defscantime => The default scan time of a server added via the Pterodactyl API.
  • defmaxfails => The default max fails of a server added via the Pterodactyl API.
  • defmaxrestarts => The default max restarts of a server added via the Pterodactyl API.
  • defrestartint => The default restart interval of a server added via the Pterodactyl API.
  • defreportonly => The default report only boolean of a server added via the Pterodactyl API.
  • defmentions => The default mentions JSON for servers added via the Pterodactyl API.
  • servers => An array of servers to watch (read below).
  • misc => An array of misc options (read below).

Egg Variable Overrides