90 lines
2.3 KiB
Markdown
90 lines
2.3 KiB
Markdown
# Server Content Application Hooks
|
|
|
|
Server Content Application Hooks let installed server content manage companion
|
|
applications such as BEC, Big Brother Bot, Discord bridges, RCON tools, and log
|
|
watchers as part of the game server lifecycle.
|
|
|
|
The application files may live wherever the game requires them. GSP lifecycle
|
|
metadata lives under each server home:
|
|
|
|
```text
|
|
_gsp_content/
|
|
hooks/
|
|
generated/
|
|
runtime/
|
|
```
|
|
|
|
## Content Type
|
|
|
|
The Server Content Manager includes the `Server-side Application` content type.
|
|
When this type is installed, the Panel writes a JSON hook manifest to:
|
|
|
|
```text
|
|
_gsp_content/hooks/<app>.json
|
|
```
|
|
|
|
The agents read these manifests during server startup.
|
|
|
|
## Hook Manifest
|
|
|
|
```json
|
|
{
|
|
"name": "BEC",
|
|
"enabled": true,
|
|
"platform": "windows",
|
|
"working_dir": "bec",
|
|
"start_command": "BEC.exe -f Config.cfg",
|
|
"stop_command": "",
|
|
"start_timing": "before_server",
|
|
"stop_with_server": true,
|
|
"watch": true,
|
|
"critical": true,
|
|
"kill_game_if_app_exits": false,
|
|
"restart_app_if_exits": true,
|
|
"pid_name": "bec",
|
|
"app_name": "BEC.exe",
|
|
"description": "Battleye Extended Controls watchdog for DayZ/Arma servers"
|
|
}
|
|
```
|
|
|
|
Supported `platform` values are `windows`, `linux`, and `both`.
|
|
Supported `start_timing` values are `before_server` and `after_server`.
|
|
|
|
## Runtime PID File
|
|
|
|
Agents write hook runtime PIDs to:
|
|
|
|
```text
|
|
_gsp_content/runtime/server_content.pids
|
|
```
|
|
|
|
Format:
|
|
|
|
```text
|
|
watchdog|BEC|12345
|
|
app|BEC|12346
|
|
```
|
|
|
|
The main game server watchdog PID is not stored in this file.
|
|
|
|
## Lifecycle
|
|
|
|
On server start, the agent:
|
|
|
|
1. Creates `_gsp_content/hooks`, `_gsp_content/generated`, and `_gsp_content/runtime`.
|
|
2. Reads enabled hook manifests matching the agent platform.
|
|
3. Generates platform-specific hook watchdog scripts.
|
|
4. Starts `before_server` hooks.
|
|
5. Starts the game server.
|
|
6. Starts `after_server` hooks.
|
|
7. Cleans up hook watchdogs and apps when the game server exits.
|
|
|
|
On Panel Stop or Restart, agents kill hook watchdog PIDs first and hook app PIDs
|
|
second, then continue normal game process and screen/session cleanup.
|
|
|
|
## Legacy `_alsoRun.bat`
|
|
|
|
Windows `_alsoRun.bat` support remains for compatibility, but it is deprecated.
|
|
New companion applications should be installed as `Server-side Application`
|
|
content so both Linux and Windows agents can manage them through the same hook
|
|
contract.
|