
Game Configuration: Console Triggers
This is Part 9 of the Game Configuration series. Console triggers let GameCP watch the game server's output and react automatically when specific patterns appear.
What Are Console Triggers?
When a game server runs, it writes output to the console β log messages, player join/leave events, errors, and status updates. Console triggers monitor this output stream and execute actions when a matching pattern is detected.
Common use cases:
- Detect when a server is ready β trigger a "server started" event when the game prints "Done! For help, type help"
- Log player activity β capture join/leave messages
- Auto-restart on crash β detect fatal error messages and restart the server
- Send notifications β alert admins when specific events occur
Creating a Trigger
Click Add Trigger to create a new console trigger. Each trigger has:
| Property | Description |
|---|---|
| Name | A human-readable label (e.g., "Server Ready Detector") |
| Pattern | The text pattern to match in console output |
| Action | What to do when the pattern is matched |
| Enabled | Toggle on/off without deleting |
Pattern Matching
Patterns can be:
- Plain text β matches if the console output contains the exact string
- Regex β use regular expressions for complex matching
Important: stdout and stderr
GameCP monitors both stdout and stderr output streams. This means triggers will fire regardless of which stream the game writes to β important for games like Hytale that write prompts to stderr.
Actions
When a trigger fires, it can perform actions like marking the server as "started" or running a command. The exact actions available depend on the trigger configuration and the game server's current state.
Tips
- The most common trigger is the "server ready" detector β without it, GameCP relies on query responses to determine if the server is online
- Keep patterns specific enough to avoid false positives
- Test your patterns by starting a server and watching the console output
- Triggers fire in the order they appear in the list