Overview
GamePanelX V3 uses theCreateServer script to create new game server instances from templates. The script handles directory setup, template extraction, and optional automatic server startup.
Basic Usage
TheCreateServer script is located at ~/_SERVERS/scripts/CreateServer and supports both creation-only and create-and-start workflows.
Create Only
Create a server without starting it:Create and Start
Create a server and start it immediately:Command-Line Parameters
UsernameThe client’s GPX username. This determines the account directory structure.
IP AddressThe server’s IP address (e.g.,
192.168.10.10). Used in the directory path.PortThe server port number (e.g.,
27015). Combined with IP for unique identification.Template IDThe template ID to use for server creation. References a template file at
~/templates/{id}.tar.gz.Start ServerWhether to start the server after creation. Use
yes or y to enable.Working DirectoryThe working directory to change into before starting the server (relative path).
PID FileServer PID filename for tracking the process. Use local paths like
some/dir/run.pid.Command LineComplete command-line string to execute for starting the server.
Callback URLURL to notify about creation status. Receives
status=complete or status=failed callbacks.Server Creation Process
Validation
The script validates that all required parameters are provided and checks if the server directory already exists.
Template Extraction
Extracts the specified template archive into the server directory:The extraction process ID is saved to
.gpx_template for monitoring.Directory Structure
After successful creation, the server directory structure will be:Examples
Status Callbacks
When a callback URL is provided with-c, the script sends HTTP requests to notify about status changes:
| Status | When Triggered |
|---|---|
complete | Template extraction finished successfully |
failed | Required parameters missing or directory already exists |
Error Handling
All operations are logged to
~/logs/servers.log for troubleshooting.Automatic Server Startup
When using-s yes, the script automatically calls the Restart script after template extraction completes. The startup parameters are passed through:
- If
-w(working directory) is specified, it’s passed toRestart - If
-P(PID file) is specified, it’s passed toRestart - The command line from
-ois always passed toRestart
See Starting, Stopping, Restarting Servers for more details on the server lifecycle.
Best Practices
- Unique Identifiers: Always use unique IP/port combinations for each server
- Template Validation: Ensure templates exist at
~/templates/{id}.tar.gzbefore creating servers - Command Line Testing: Test command lines manually before using them with
-s yes - Callback URLs: Use callback URLs for monitoring creation status in web interfaces
- Logging: Monitor
~/logs/servers.logfor detailed creation progress
Related Scripts
- Starting & Stopping Servers - Managing server lifecycle
- Updating Servers - Updating game server files
- Working with Templates - Creating and managing templates