Discord Gameserver Notifier
Overview
The Discord Gameserver Notifier is a Python-based tool for automatic detection of game servers in local networks with Discord notifications via webhooks. It uses opengsq-python for game server communication and provides real-time monitoring of gaming communities.
Perfect for LAN parties, gaming events, and local gaming communities!
Main Features
🔍 Automatic Network Discovery
Finds game servers in local networks using broadcast queries and passive listening
🎮 Multi-Protocol Support
Supports multiple game protocols with specialized discovery methods
📊 Discord Integration
Automatic notifications for new servers and server status changes via webhooks
🏷️ Game-Specific Mentions
Configure different Discord mentions for each game type (global + game-specific)
💾 Database Tracking
Persistent storage and monitoring of discovered servers with SQLite
⚡ Real-time Updates
Continuous monitoring of server status with configurable scan intervals
🔧 Configurable
Flexible settings for network ranges, scan intervals, and cleanup thresholds
🚫 Network Filtering
Ignore specific network ranges (test/development environments)
🎯 Intelligent Cleanup
Automatic removal of inactive servers with configurable failure thresholds
📈 Performance Tracking
Response time monitoring and server statistics
🔒 Security Features
Network range filtering and secure webhook management
🌐 REST API
Optional HTTP API for read-only access to discovered servers (integrations, websites, monitoring)
Supported Games
| Game | Config Code |
|---|---|
| Age of Empires 1 | aoe1 |
| Age of Empires 2 | aoe2 |
| Alien vs Predator 2 | avp2 |
| Battlefield 2 | battlefield2 |
| Call of Duty 1 | cod1 |
| Call of Duty 4 | cod4 |
| Call of Duty 5 | cod5 |
| Command & Conquer Generals Zero Hour | cnc_generals |
| ElDewrito (Halo Online) | eldewrito |
| F.E.A.R. 2 | fear2 |
| Flatout 2 | flatout2 |
| Halo 1 (Combat Evolved) | halo1 |
| Quake 3 | quake3 |
| Renegade X | renegadex |
| Serious Sam Classic: The First Encounter | ssc_tfe |
| Serious Sam Classic: The Second Encounter | ssc_tse |
| Source Engine Games | source |
| Stronghold Crusader | stronghold_crusader |
| Stronghold Crusader Extreme | stronghold_ce |
| Toxikk | toxikk |
| Trackmania Nations | trackmania_nations |
| Unreal Tournament 3 | ut3 |
| Warcraft III | warcraft3 |
Installation
Prerequisites
- Python 3.8 or higher
- Network access for UDP broadcast queries
- Discord webhook URL
Available Packages
The tool is available in various package formats:
Option 1: PyPI (Recommended)
# Install from PyPI
pip install Discord-Gameserver-Notifier
# Run directly
discord-gameserver-notifier --help
Option 2: System Packages
Debian/Ubuntu (.deb):
wget https://github.com/lan-dot-party/Discord-Gameserver-Notifier/releases/latest/download/discord-gameserver-notifier_*.deb
sudo dpkg -i discord-gameserver-notifier_*.deb
sudo apt-get install -f # Fix dependencies if needed
RHEL/Fedora/openSUSE (.rpm):
wget https://github.com/lan-dot-party/Discord-Gameserver-Notifier/releases/latest/download/discord-gameserver-notifier-*.rpm
sudo rpm -i discord-gameserver-notifier-*.rpm
Arch Linux (.pkg.tar.zst):
wget https://github.com/lan-dot-party/Discord-Gameserver-Notifier/releases/latest/download/discord-gameserver-notifier-*.pkg.tar.zst
sudo pacman -U discord-gameserver-notifier-*.pkg.tar.zst
All package installations place the executable in /usr/bin/discord-gameserver-notifier and are ready to use system-wide.
Option 3: Manual Installation (Development)
# Clone repository
git clone https://github.com/lan-dot-party/Discord-Gameserver-Notifier.git
cd Discord-Gameserver-Notifier
# Install dependencies
pip install -r requirements.txt
# Configure
cp config/config.yaml.example config/config.yaml
# Edit config/config.yaml
# Run
python main.py
REST API
The Discord Gameserver Notifier includes an optional HTTP REST API for read-only access to discovered servers:
Configuration
api:
enabled: true # Enable/disable API
host: "0.0.0.0" # Bind address (0.0.0.0 = all interfaces, 127.0.0.1 = localhost only)
port: 8080 # API port
Features
- Read-Only Access: Safe, no data modification possible
- JSON Format: Standard REST API with JSON responses
- Active Servers Only: Automatically filters inactive servers
- Thread-Safe: Multiple concurrent requests supported
- Asynchronous: Non-blocking operation with aiohttp
Available Endpoints
GET /- API information and versionGET /health- Health check endpointGET /servers- List all active game servers
Use Cases
- Display servers on your LAN party website
- Create Discord bots with server status
- Monitor server utilization with Grafana/Prometheus
- Build mobile apps for your gaming community
Systemd Service (Linux)
For automatic startup and service management on Linux systems, the systemd service is automatically created when installing via package managers (.deb, .rpm, .pkg.tar.zst or PyPI).
Service Features
- Runs as dedicated
dgnsystem user - Automatic restart on failure
- Proper logging to systemd journal
- Configuration in
/etc/dgn/config.yaml - Data stored in
/var/lib/dgn/ - Logs in
/var/log/dgn/
Service Commands
# Enable and start service
sudo systemctl enable discord-gameserver-notifier
sudo systemctl start discord-gameserver-notifier
# Check status
sudo systemctl status discord-gameserver-notifier
# View logs
sudo journalctl -u discord-gameserver-notifier -f
Advanced Features
- Network Discovery Methods: Active broadcasts, passive listening, two-step discovery, multi-protocol support
- Discord Integration: Rich embeds with game-specific colors and emojis, server details, status updates, message management, flexible mentions (global and game-specific)
- Performance Features: Asynchronous operations, connection pooling, response caching, graceful error handling
- Security Features: Network range filtering and secure webhook management
- Comprehensive Logging: Detailed logging with configurable levels and file output
- Database Management: Automatic SQLite database with server history and statistics
- Graceful Shutdown: Proper cleanup and database maintenance on application exit
Downloads & Releases
Download the latest version of the Discord Gameserver Notifier:
Here you'll find all available versions with detailed changelogs and download links for all supported platforms.
Configuration
Copy config/config.yaml.example to config/config.yaml and adjust the settings:
Basic Configuration
network:
scan_ranges:
- "192.168.1.0/24" # Your local network
- "10.0.0.0/24" # Additional networks
scan_interval: 300 # Scan every 5 minutes
timeout: 5 # Server response timeout
# Ignore specific network ranges
ignore_ranges:
- "192.168.100.0/24" # Test network
- "10.10.10.0/24" # Development environment
games:
enabled:
- "source" # Source Engine games
- "battlefield2" # Battlefield 2
- "warcraft3" # Warcraft III
- "renegadex" # Renegade X
# ... more games
discord:
webhook_url: "YOUR_WEBHOOK_URL"
global_mentions:
- "@everyone" # Global for all games
game_mentions:
battlefield2:
- "<@&ROLE_ID>" # Additionally for Battlefield 2
source:
- "<@&ROLE_ID>" # Additionally for Source Engine
Discord Setup
- Create a webhook in your Discord server: Server Settings → Integrations → Webhooks → Create Webhook
- Copy the webhook URL to your configuration
- Configure optional mentions and channel settings
Usage
After Package Installation
# Standard execution
discord-gameserver-notifier
# With debug logging
discord-gameserver-notifier --log-level DEBUG
# Background execution
nohup discord-gameserver-notifier &
Monitoring
The application provides comprehensive logging:
INFO - Starting main application loop...
INFO - Discovery engine started successfully
INFO - NetworkScanner initialized with 2 scan ranges
INFO - Found 3 source servers
INFO - Discovered source server: Counter-Strike 1.6 Server
INFO - Server details: 192.168.1.100:27015
INFO - Players: 12/32, Map: de_dust2
License & Acknowledgments
This project is licensed under the GNU General Public License v3.0.
Acknowledgments:
- opengsq-python for game server protocol implementations
- Discord community for webhook API documentation
- Game server communities for protocol specifications