> For the complete documentation index, see [llms.txt](https://docs.linuxgsm.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.linuxgsm.com/features/player-warnings.md).

# Player Warnings

LinuxGSM can warn players in-game before it stops, restarts or updates a server, so they have time to finish what they are doing.

```
Server restarting in 15 minutes
Server restarting in 10 minutes
Server restarting in 5 minutes
Server restarting in 3 minutes
Server restarting in 1 minute
```

## Enabling warnings

Set `warnplayerstimer` to the number of minutes of warning to give, in `common.cfg` or an instance config. It is off (`0`) by default.

```properties
warnplayerstimer="15"
```

LinuxGSM works out the warnings from the timer, counting down through 60, 30, 15, 10, 5, 3 and 1 minutes:

| `warnplayerstimer` | Warnings at (minutes) |
| ------------------ | --------------------- |
| `15`               | 15, 10, 5, 3, 1       |
| `10`               | 10, 5, 3, 1           |
| `5`                | 5, 3, 1               |
| `1`                | 1                     |
| `7`                | 7, 5, 3, 1            |

The command waits for the countdown to finish before stopping the server, so a `restart` with `warnplayerstimer="15"` takes about 15 minutes.

## When players are warned

| Command                               | Message                  |
| ------------------------------------- | ------------------------ |
| `stop`                                | Server stopping in ...   |
| `restart`                             | Server restarting in ... |
| `backup` (with `stoponbackup="on"`)   | Server restarting in ... |
| `update` (when an update is found)    | Server updating in ...   |
| `workshop-update` (when mods changed) | Server updating in ...   |

There are no warnings when:

* `monitor` restarts a crashed server.
* `force-update` or `validate` is used.
* The server is empty. If everyone leaves during the countdown, LinuxGSM stops waiting and carries on straight away.

{% hint style="warning" %}
Checking for players requires [gamedig](https://docs.linuxgsm.com/requirements/gamedig.md) (which needs Node.js 16 or newer) and a working query (`querymode` 2 or 3). Without it, LinuxGSM can't tell whether the server is empty, so it always warns and always waits the full `warnplayerstimer`, and shows `unable to check for players` with the reason.
{% endhint %}

If the countdown is cancelled with CTRL+c, players are told the stop or restart was cancelled.

## Supported games

Warnings are sent with the game's own chat command, typed into the server console, so they work for game servers with an interactive console:

| Game servers                                                                                                                 | Chat command       |
| ---------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| Source, Source 2 and GoldSrc games, Quake and Call of Duty games, Xonotic, Minecraft, Terraria, Unturned, Barotrauma, Hytale | `say`              |
| Project Zomboid                                                                                                              | `servermsg`        |
| Don't Starve Together                                                                                                        | `c_announce`       |
| SCP: Secret Laboratory                                                                                                       | `/bc`              |
| Vintage Story                                                                                                                | `/announce`        |
| WaterfallMC                                                                                                                  | `alert`            |
| Factorio                                                                                                                     | Plain console text |

For other game servers, warnings are skipped with `Warning players: not supported`.

## Warnings and stop only if empty

[Stop only if empty](https://docs.linuxgsm.com/commands/start-stop-restart.md#stop-only-if-empty-optional) (`stoponlyifnoplayers`) and player warnings work together:

| `stoponlyifnoplayers` | Players online | What happens                                                                                |
| --------------------- | -------------- | ------------------------------------------------------------------------------------------- |
| `on`                  | Yes            | The stop, restart or update is postponed until the server is empty. No warnings are needed. |
| `off`                 | Yes            | Players are warned, then the server stops.                                                  |
| Either                | No             | The server stops straight away.                                                             |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.linuxgsm.com/features/player-warnings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
