This document details the improvements made to the manage.bat script to address various requirements and enhance its functionality.
All commands now include:
- Comprehensive logging to
logs\server.logwith timestamps - Error handling using
errorlevelchecks after each operation - Error logging to a dedicated log file
- Clear error messages with both visual indicators (❌) and detailed information
The script now includes:
- Validation for all commands that require parameters
- Enhanced validation for the
rconcommand with required argument check - Input sanitization function to prevent potential security issues
- Better handling of special characters in user input
- Added input sanitization to remove potentially dangerous characters
- Docker-compose availability check before executing commands
- Safe handling of user-provided parameters
New functionality includes:
auto-startcommand that creates a Windows Task Scheduler task- Automatic server startup on user login
- Proper task creation with appropriate permissions
Enhanced the user interface with:
- More detailed help section with examples
- Visual status indicators for all commands
- Version information displayed in help output
- Better organization of commands by category
Added support for:
multi-servercommand to create and manage multiple Minecraft server instances- Automatic generation of separate docker-compose files for each server
- Proper isolation of multiple server instances
New commands and functionality:
healthcommand to check server health via RCON- Improved restart functionality that properly handles stop/start
- Better error recovery in all commands
- All commands now return appropriate exit codes (0 for success, 1 for errors)
- Enables proper error handling in calling scripts or processes
- Better integration with other automation tools
| Feature | Implementation |
|---|---|
| Logging | Log files created in logs\server.log with timestamps |
| Security | Input sanitization for all user inputs |
| User Experience | Enhanced help output with examples and version info |
| Automation | Auto-start functionality with Task Scheduler |
| Multi-Instance | Support for multiple Minecraft servers |
| Error Handling | Proper error detection and reporting |
# Start the server with full logging
manage.bat start
# Check server health
manage.bat health
# Create an automated start task
manage.bat auto-start minecraft-server
# Create multiple server instances
manage.bat multi-server survival
manage.bat multi-server creative
# Execute RCON commands with sanitized input
manage.bat rcon list
manage.bat rcon save-allThe enhanced script maintains full compatibility with the original functionality while adding robust logging, error handling, and security features. These improvements make it more suitable for production environments and automated deployments while remaining user-friendly for manual operation.