Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Southclaws authored and Southclaws committed Sep 22, 2017
1 parent 7fb6a57 commit 88c7008
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,32 @@

A small utility for launching a SA:MP server with better settings handling.

May include subcommands for common tasks too.
## Usage

Proposed usage:
`sampctl run` Will run a server in your current directory. If there are no binaries, it will automatically download them.

`sampctl --gamemode0=ScavengeSurvive --filterscripts="rcon,objectloader,base" --rcon_password="0xdeadbeef"`
`sampctl download` Just downloads the binaries to the current directory.

And env vars
## Config

`GAMEMODE0=ScavengeSurvive FILTERSCRIPTS=rcon,objectloader,base RCON_PASSWORD=0xdeadbeef sampctl`
If your current directory has a JSON file named `samp.json`, the values will be used to generate a `server.cfg` file. The setting names are the same.

Or JSON/Yaml too probably
You can also use environment variables to configure, just prefix them with `SAMP_` and uppercase the rest.

`sampctl --config=server.json`
For example: `rcon_password`'s environment variable is `SAMP_RCON_PASSWORD`.

As well as some other nice features like log rotation, pre-flight checks for common mistakes and watchdog restarts.
## Crashloops and Exponential Backoff

Crashes, crashlooks and backoff timing is handled by the app. If the server crashes, it will be restarted. If it crashes repeatedly, it will be restarted with an exponentially increasing amount of time between tries - in case it's waiting for a database to spin up or something. Once the backoff time reaches 15s, it quits.

## Roadmap

The main focus of this project was to bring SA:MP server management into the present with a modern system `*ctl` tool (think systemd, kubectl, caddy, etc).

Another primary focus was to ease the use of SA:MP in a Docker container, this project is at: https://github.com/Southclaws/docker-samp

The future will include:

- processing of logs to extract meaningful information such as runtime errors
- a RESTful API to control the server that's better than RCON in every possible way
- auto-restart when gamemode .amx files are updated

0 comments on commit 88c7008

Please sign in to comment.