From the panel site
|
|
@ -1 +0,0 @@
|
|||
2025-08-29 15:39:12 UTC
|
||||
16
.gitignore
vendored
|
|
@ -1,16 +0,0 @@
|
|||
*.log
|
||||
*.tmp
|
||||
cache/
|
||||
tmp/
|
||||
sessions/
|
||||
*.tar
|
||||
*.tar.gz
|
||||
*.zip
|
||||
*.bak
|
||||
node_modules/
|
||||
vendor/*/cache/
|
||||
.env
|
||||
.env.*
|
||||
config.local.php
|
||||
!_agent-linux/**
|
||||
!_agent-windows/**
|
||||
BIN
.google.html.swp
|
|
@ -1,117 +0,0 @@
|
|||
# OGP Agent Resource Stats Integration - Implementation Complete
|
||||
|
||||
## Summary
|
||||
|
||||
Successfully integrated the standalone Python collector.py functionality directly into the OGP agents, removing external dependencies and simplifying deployment.
|
||||
|
||||
## What Was Implemented
|
||||
|
||||
### 1. Database Configuration
|
||||
- Added database connection parameters to both Linux and Windows agent config files
|
||||
- Configurable collection frequency (default: 5 minutes)
|
||||
- Uses same database schema as original collector.py
|
||||
|
||||
### 2. Resource Collection System
|
||||
- **Machine-wide metrics:** CPU, memory, disk, network, load averages
|
||||
- **Process-specific metrics:** Per-game-server process monitoring
|
||||
- **Platform-specific implementations:** Linux (proc filesystem) and Windows (wmic)
|
||||
|
||||
### 3. Automatic Scheduling
|
||||
- Integrated into existing agent scheduler system
|
||||
- No external cron jobs required
|
||||
- Starts/stops with agent automatically
|
||||
|
||||
### 4. Process Detection
|
||||
- Scans agent directory for server subdirectories
|
||||
- Associates running processes with server directories
|
||||
- Collects detailed process metrics (memory, I/O, ports, etc.)
|
||||
|
||||
## Benefits Achieved
|
||||
|
||||
✅ **Removed Python Dependencies**
|
||||
- No more psutil requirement
|
||||
- No more mysql-connector-python requirement
|
||||
- Pure Perl implementation using native system tools
|
||||
|
||||
✅ **Simplified Deployment**
|
||||
- No separate cron job setup needed
|
||||
- Configuration through existing agent config files
|
||||
- Automatic startup with agent
|
||||
|
||||
✅ **Maintained Compatibility**
|
||||
- Uses identical database schema
|
||||
- Produces same data format as collector.py
|
||||
- Existing dashboards continue to work unchanged
|
||||
|
||||
✅ **Cross-Platform Support**
|
||||
- Linux implementation using /proc filesystem
|
||||
- Windows implementation using wmic and native commands
|
||||
- Platform-specific optimizations
|
||||
|
||||
## Files Modified
|
||||
|
||||
### Linux Agent
|
||||
- `_agent-linux/Cfg/Config.pm` - Added database configuration
|
||||
- `_agent-linux/ogp_agent.pl` - Added resource collection system
|
||||
|
||||
### Windows Agent
|
||||
- `_agent-windows/Cfg/Config.pm` - Added database configuration
|
||||
- `_agent-windows/ogp_agent.pl` - Added resource collection system
|
||||
|
||||
## Database Tables Used
|
||||
- `gsp_machines` - Machine catalog
|
||||
- `gsp_machine_samples` - System-wide metrics
|
||||
- `gsp_process_samples` - Per-process metrics
|
||||
|
||||
## Configuration Required
|
||||
|
||||
### 1. Install Perl Database Modules
|
||||
```bash
|
||||
# Ubuntu/Debian
|
||||
sudo apt-get install libdbi-perl libdbd-mysql-perl
|
||||
|
||||
# CentOS/RHEL
|
||||
sudo yum install perl-DBI perl-DBD-MySQL
|
||||
```
|
||||
|
||||
### 2. Update Agent Configuration
|
||||
Add to both `_agent-linux/Cfg/Config.pm` and `_agent-windows/Cfg/Config.pm`:
|
||||
|
||||
```perl
|
||||
# Resource stats database configuration
|
||||
stats_db_host => 'your_mysql_host',
|
||||
stats_db_user => 'your_db_user',
|
||||
stats_db_pass => 'your_db_password',
|
||||
stats_db_name => 'your_panel_database',
|
||||
stats_table_prefix => 'gsp_',
|
||||
stats_frequency_minutes => '5',
|
||||
```
|
||||
|
||||
### 3. Create Database Tables
|
||||
Run the SQL schema from `modules/resource_stats/mysql_query.sql`
|
||||
|
||||
### 4. Restart OGP Agents
|
||||
The resource collection will start automatically with the agents.
|
||||
|
||||
## Migration Steps
|
||||
|
||||
1. **Stop existing collector.py cron jobs**
|
||||
2. **Install required Perl modules** on agent machines
|
||||
3. **Update agent configurations** with database details
|
||||
4. **Restart OGP agents**
|
||||
5. **Verify data collection** in database
|
||||
6. **Remove collector.py and Python dependencies**
|
||||
|
||||
## Validation
|
||||
|
||||
The implementation has been tested and verified:
|
||||
- ✅ Both Linux and Windows agents compile without errors
|
||||
- ✅ Database connectivity works correctly
|
||||
- ✅ Data insertion functions properly
|
||||
- ✅ System resource collection functions work
|
||||
- ✅ Process detection logic functions
|
||||
- ✅ Scheduler integration is successful
|
||||
|
||||
## Result
|
||||
|
||||
The OGP agents now include fully integrated resource monitoring that replaces the standalone Python collector.py script while maintaining complete compatibility with existing systems and dashboards.
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
# MySQL Auto-Create Feature
|
||||
|
||||
This feature automatically creates MySQL databases for each new game server created through the billing system.
|
||||
|
||||
## Required Settings
|
||||
|
||||
Add the following settings to your OGP settings table to enable MySQL auto-creation:
|
||||
|
||||
### Required Settings:
|
||||
- `mysql_auto_create` - Set to '1' to enable, '0' to disable
|
||||
- `mysql_root_user` - MySQL root username for creating databases (e.g., 'remoteuser')
|
||||
- `mysql_root_password` - MySQL root password
|
||||
- `mysql_host` - MySQL server hostname (e.g., 'mysql.iaregamer.com')
|
||||
|
||||
### Optional Settings:
|
||||
- `mysql_port` - MySQL server port (defaults to '3306' if not set)
|
||||
- `mysql_special_user` - Additional user to grant access (like 'dayzhivemind' in original script)
|
||||
- `mysql_special_password` - Password for the special user
|
||||
- `mysql_init_sql_file` - Path to SQL file to import into new databases (e.g., '1.9.0_fresh.sql')
|
||||
- `mysql_default_server_id` - MySQL server ID from mysql_servers table to track databases in OGP
|
||||
|
||||
## How it works:
|
||||
|
||||
1. When a new server is created, the system generates:
|
||||
- Database name: `server_<home_id>` (e.g., `server_1745`)
|
||||
- Database user: Same as database name (e.g., `server_1745`)
|
||||
- Random 12-character password
|
||||
|
||||
2. The system creates the database and grants privileges:
|
||||
- Full privileges to the database user from localhost and any host (%)
|
||||
- If mysql_special_user is set, grants full privileges to that user too
|
||||
- Flushes privileges
|
||||
|
||||
3. If mysql_init_sql_file is specified, imports that SQL file into the new database
|
||||
|
||||
4. If mysql_default_server_id is set, adds the database to OGP's mysql_databases table for tracking
|
||||
|
||||
## Example Settings SQL:
|
||||
|
||||
```sql
|
||||
INSERT INTO ogp_settings (setting, value) VALUES ('mysql_auto_create', '1');
|
||||
INSERT INTO ogp_settings (setting, value) VALUES ('mysql_root_user', 'remoteuser');
|
||||
INSERT INTO ogp_settings (setting, value) VALUES ('mysql_root_password', 'Pkloyn7yvpht!');
|
||||
INSERT INTO ogp_settings (setting, value) VALUES ('mysql_host', 'mysql.iaregamer.com');
|
||||
INSERT INTO ogp_settings (setting, value) VALUES ('mysql_port', '3306');
|
||||
INSERT INTO ogp_settings (setting, value) VALUES ('mysql_special_user', 'dayzhivemind');
|
||||
INSERT INTO ogp_settings (setting, value) VALUES ('mysql_special_password', 'Pkloyn7yvpht!');
|
||||
INSERT INTO ogp_settings (setting, value) VALUES ('mysql_init_sql_file', '/path/to/1.9.0_fresh.sql');
|
||||
INSERT INTO ogp_settings (setting, value) VALUES ('mysql_default_server_id', '1');
|
||||
```
|
||||
|
||||
## Logging
|
||||
|
||||
The system logs MySQL database creation events:
|
||||
- Success: "MYSQL DB CREATED - Database server_<id> created for server <id>"
|
||||
- Failure: "MYSQL DB CREATION FAILED - <error details>"
|
||||
230
README.md
|
|
@ -1,212 +1,22 @@
|
|||
# GameServerPanel (GSP) - Unstable Branch
|
||||
# OGP-AdminLTE
|
||||
AdminLTE Theme adapted for OpenGamePanel
|
||||
|
||||
This is the **GameServerPanel (GSP)** project, a cross-platform game server management panel and agent system.
|
||||
### Features
|
||||
- [x] Installs a Theme Database for User specific Theme Settings
|
||||
- [x] Responsive
|
||||
- [x] Dark and Light Mode Switcher
|
||||
- [x] Custom Dashboard with additional Rows (all Boxes are movable!)
|
||||
- [x] Custom Server Overview (with Chart & Cronjob)
|
||||
- [x] Custom FTP Style
|
||||
- [x] Custom Shop Style
|
||||
- [x] User specific Avatars (will also load other User Avatars if needed)
|
||||
- [x] Maintenance Notification on Login Screen
|
||||
- [x] Custom Logo Upload
|
||||
|
||||
This README covers installation and setup for:
|
||||
- **The Web Panel**
|
||||
- **The Linux Agent**
|
||||
- **The Windows Agent**
|
||||
|
||||
---
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Panel Installation (Linux)](#panel-installation-linux)
|
||||
- [Agent Installation (Linux)](#agent-installation-linux)
|
||||
- [Agent Installation (Windows)](#agent-installation-windows)
|
||||
- [Example Installation Scripts](#example-installation-scripts)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Contributing](#contributing)
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### General
|
||||
|
||||
- **Git**
|
||||
- **curl/wget**
|
||||
- **Sudo/root privileges**
|
||||
|
||||
### Panel (Linux)
|
||||
|
||||
- **Ubuntu 22.04+** (other distros may work)
|
||||
- **Apache2** or **nginx**
|
||||
- **PHP 8.1+**
|
||||
- **MariaDB** or **MySQL**
|
||||
- **Required PHP extensions**:
|
||||
`php-mysqli php-json php-curl php-xml php-zip php-gd php-mbstring php-bcmath php-intl php-pdo php-cli`
|
||||
- **Composer** (for PHP dependency management)
|
||||
|
||||
### Linux Agent
|
||||
|
||||
- **Ubuntu 22.04+** (other distros may work)
|
||||
- **Perl 5**
|
||||
- **Perl modules**:
|
||||
`Proc::ProcessTable`, `IO::Socket`, `DBI`, `Sys::Hostname`, `LWP::UserAgent`, `JSON`, `File::Path`
|
||||
- **Screen** (for game server management)
|
||||
|
||||
### Windows Agent
|
||||
|
||||
- **Windows 10/11/Server**
|
||||
- **Strawberry Perl** (or ActivePerl)
|
||||
- **Perl modules**:
|
||||
Same as Linux agent (`Proc::ProcessTable`, etc.)
|
||||
- **Run agent as Administrator** for full functionality
|
||||
|
||||
---
|
||||
|
||||
## Panel Installation (Linux)
|
||||
|
||||
1. **Install prerequisites:**
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install apache2 mariadb-server php php-mysqli php-json php-curl php-xml php-zip php-gd php-mbstring php-bcmath php-intl php-pdo php-cli composer git unzip
|
||||
```
|
||||
|
||||
2. **Clone the repository:**
|
||||
|
||||
```bash
|
||||
git clone -b unstable https://github.com/GameServerPanel/GSP.git
|
||||
cd GSP/ControlPanel
|
||||
```
|
||||
|
||||
3. **Install PHP dependencies:**
|
||||
|
||||
```bash
|
||||
composer install
|
||||
```
|
||||
|
||||
4. **Set permissions:**
|
||||
|
||||
```bash
|
||||
sudo chown -R www-data:www-data .
|
||||
sudo chmod -R 755 .
|
||||
```
|
||||
|
||||
5. **Configure Apache/nginx:**
|
||||
- Point your DocumentRoot to `GSP/ControlPanel/public`
|
||||
- Restart your webserver.
|
||||
|
||||
6. **Configure the Panel:**
|
||||
- Open the panel in your browser
|
||||
- Follow setup wizard (enter database details, admin account, etc.)
|
||||
|
||||
---
|
||||
|
||||
## Agent Installation (Linux)
|
||||
|
||||
1. **Install prerequisites:**
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install perl build-essential screen libproc-processtable-perl libio-socket-perl libdbi-perl libsys-hostname-perl libwww-perl libjson-perl libfile-path-perl
|
||||
```
|
||||
|
||||
2. **Clone the agent:**
|
||||
|
||||
```bash
|
||||
git clone -b unstable https://github.com/GameServerPanel/GSP.git
|
||||
cd GSP/Agent
|
||||
```
|
||||
|
||||
3. **Run the agent:**
|
||||
|
||||
```bash
|
||||
perl ogp_agent.pl
|
||||
```
|
||||
|
||||
> If `libproc-process-table-perl` is not available on your distro, install via CPAN:
|
||||
>
|
||||
> ```bash
|
||||
> sudo apt install cpanminus
|
||||
> sudo cpanm Proc::ProcessTable
|
||||
> ```
|
||||
|
||||
---
|
||||
|
||||
## Agent Installation (Windows)
|
||||
|
||||
1. **Install [Strawberry Perl](https://strawberryperl.com/)**
|
||||
2. **Open Command Prompt as Administrator**
|
||||
|
||||
3. **Install required Perl modules:**
|
||||
|
||||
```shell
|
||||
cpan install Proc::ProcessTable IO::Socket DBI Sys::Hostname LWP::UserAgent JSON File::Path
|
||||
```
|
||||
|
||||
4. **Clone the repository or download the Agent folder**
|
||||
5. **Run the agent:**
|
||||
|
||||
```shell
|
||||
perl ogp_agent.pl
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Example Installation Scripts
|
||||
|
||||
### Linux Agent Quick Install
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
sudo apt update
|
||||
sudo apt install -y perl build-essential screen git \
|
||||
libproc-processtable-perl libio-socket-perl libdbi-perl \
|
||||
libsys-hostname-perl libwww-perl libjson-perl libfile-path-perl
|
||||
git clone -b unstable https://github.com/GameServerPanel/GSP.git
|
||||
cd GSP/Agent
|
||||
perl ogp_agent.pl
|
||||
```
|
||||
|
||||
### Panel Quick Install
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
sudo apt update
|
||||
sudo apt install -y apache2 mariadb-server php php-mysqli php-json php-curl php-xml php-zip php-gd php-mbstring php-bcmath php-intl php-pdo php-cli composer git unzip
|
||||
git clone -b unstable https://github.com/GameServerPanel/GSP.git
|
||||
cd GSP/ControlPanel
|
||||
composer install
|
||||
sudo chown -R www-data:www-data .
|
||||
sudo chmod -R 755 .
|
||||
# Configure your web server to point to GSP/ControlPanel/public
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **Missing Perl modules:**
|
||||
Use `cpanm` or `cpan` to install missing modules.
|
||||
|
||||
- **libproc-process-table-perl not found:**
|
||||
Install via CPAN (`cpanm Proc::ProcessTable`)
|
||||
|
||||
- **Web panel not loading:**
|
||||
Check Apache/nginx logs, file permissions, and PHP modules.
|
||||
|
||||
- **Agent cannot communicate with panel:**
|
||||
Check firewall settings and agent config.
|
||||
|
||||
---
|
||||
|
||||
## Contributing
|
||||
|
||||
- Fork the repository
|
||||
- Create a feature branch
|
||||
- Make your changes
|
||||
- Submit a pull request
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
See `LICENSE` file in the repository.
|
||||
|
||||
---
|
||||
|
||||
**For detailed help or bug reports, open an issue on [GitHub](https://github.com/GameServerPanel/GSP/issues).**
|
||||
### Images
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
|
|
|||
25
README.txt
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
Hi guys!
|
||||
|
||||
EXIM as smarthost is only needed for hosts with dynamically assigned IP because it avoids to be blocked by some mail servers like hotmail.
|
||||
|
||||
Upload all files.
|
||||
|
||||
Login with ssh and change to the user 'www-data'(in ubuntu) or 'apache'(in centos) or any other user that manages the apache server with, for example:
|
||||
|
||||
sudo su - www-data
|
||||
|
||||
Now edit the cron tab for this user
|
||||
|
||||
crontab -e
|
||||
|
||||
and copy this line at the end of the file and save it (WARNING:modify it with the correct path):
|
||||
|
||||
*/1 * * * * php /var/www/html/ogp/modules/billing/cron-shop.php
|
||||
|
||||
Now this script searches for expired game homes every minute, and wil stop and remove them if they are expired.
|
||||
If you would like to do this at midnight every day instead of every minute you should use
|
||||
|
||||
0 0 * * * php /var/www/html/ogp/modules/billing/cron-shop.php
|
||||
|
||||
TIP: Searching in google, for example, "cron every month" you will find the correct code to search expired homes and remove them every month.
|
||||
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
# OGP Agent Resource Stats Collection
|
||||
|
||||
This document describes the integrated resource statistics collection system in the OGP agents that replaces the standalone Python collector.py script.
|
||||
|
||||
## Overview
|
||||
|
||||
The OGP agents now include built-in resource monitoring that collects:
|
||||
- **Machine-wide statistics:** CPU usage, memory, disk space, network activity, load averages
|
||||
- **Per-server process statistics:** Memory usage, CPU usage, I/O statistics, listening ports, folder sizes
|
||||
|
||||
Data is automatically inserted into the same MySQL database tables used by the web panel for display.
|
||||
|
||||
## Configuration
|
||||
|
||||
### Database Configuration
|
||||
|
||||
Update the agent configuration files with your database connection details:
|
||||
|
||||
**Linux Agent:** `_agent-linux/Cfg/Config.pm`
|
||||
**Windows Agent:** `_agent-windows/Cfg/Config.pm`
|
||||
|
||||
```perl
|
||||
# Resource stats database configuration
|
||||
stats_db_host => '127.0.0.1', # Database server hostname/IP
|
||||
stats_db_user => 'panel_user', # Database username
|
||||
stats_db_pass => 'your_password_here', # Database password
|
||||
stats_db_name => 'panel_database', # Database name (same as your web panel)
|
||||
stats_table_prefix => 'gsp_', # Table prefix (must match collector.py)
|
||||
stats_frequency_minutes => '5', # Collection frequency in minutes
|
||||
```
|
||||
|
||||
### Database Tables
|
||||
|
||||
The system uses the same database tables as the original collector.py:
|
||||
|
||||
```sql
|
||||
-- Machine catalog
|
||||
gsp_machines
|
||||
|
||||
-- Machine-wide samples (CPU, memory, disk, network)
|
||||
gsp_machine_samples
|
||||
|
||||
-- Per-process/per-server samples
|
||||
gsp_process_samples
|
||||
```
|
||||
|
||||
Run the SQL schema from `modules/resource_stats/mysql_query.sql` to create these tables if they don't exist.
|
||||
|
||||
### Required Perl Modules
|
||||
|
||||
The agents require these Perl modules for database connectivity:
|
||||
|
||||
```bash
|
||||
# Ubuntu/Debian
|
||||
sudo apt-get install libdbi-perl libdbd-mysql-perl
|
||||
|
||||
# CentOS/RHEL
|
||||
sudo yum install perl-DBI perl-DBD-MySQL
|
||||
|
||||
# Or via CPAN
|
||||
cpan DBI DBD::mysql
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
### Automatic Integration
|
||||
- Runs automatically as part of the agent scheduler
|
||||
- No separate cron jobs required
|
||||
- Starts when the agent starts
|
||||
- Stops when the agent stops
|
||||
|
||||
### Platform Support
|
||||
|
||||
**Linux Agent:**
|
||||
- Uses `/proc` filesystem for system stats
|
||||
- Native command-line tools (`df`, `netstat`, etc.)
|
||||
- Full CPU, memory, disk, and network monitoring
|
||||
- Process association via working directory and command line analysis
|
||||
|
||||
**Windows Agent:**
|
||||
- Uses `wmic` for system information
|
||||
- Native Windows commands (`dir`, `netstat`)
|
||||
- CPU, memory, disk monitoring (no load averages on Windows)
|
||||
- Process association via executable path and command line analysis
|
||||
|
||||
### Process Detection
|
||||
|
||||
The system automatically detects game server processes by:
|
||||
1. Scanning for subdirectories in the agent directory
|
||||
2. Finding processes whose working directory, executable path, or command line references these directories
|
||||
3. Collecting detailed metrics for each associated process
|
||||
|
||||
### Data Collection
|
||||
|
||||
**Machine-wide metrics:**
|
||||
- Load averages (Linux only)
|
||||
- CPU percentage
|
||||
- Memory usage (used/total/percentage)
|
||||
- Swap usage
|
||||
- Disk usage for agent directory
|
||||
- Network interface statistics
|
||||
- Network throughput
|
||||
|
||||
**Process-specific metrics:**
|
||||
- Process ID and name
|
||||
- Command line
|
||||
- CPU percentage
|
||||
- Memory usage (RSS/VMS)
|
||||
- I/O statistics (read/write bytes)
|
||||
- Open file descriptors
|
||||
- Listening network ports
|
||||
- Server directory size
|
||||
|
||||
## Monitoring and Troubleshooting
|
||||
|
||||
### Log Messages
|
||||
|
||||
The agent logs resource collection activity:
|
||||
|
||||
```
|
||||
Starting resource stats collection
|
||||
Resource stats collection completed
|
||||
```
|
||||
|
||||
### Error Handling
|
||||
|
||||
If database modules are not available:
|
||||
```
|
||||
DBD::mysql not available - resource stats collection disabled
|
||||
```
|
||||
|
||||
If database connection fails:
|
||||
```
|
||||
Failed to connect to stats database: [error details]
|
||||
```
|
||||
|
||||
### Verification
|
||||
|
||||
To verify the system is working:
|
||||
|
||||
1. Check agent logs for collection messages
|
||||
2. Query the database tables:
|
||||
```sql
|
||||
SELECT COUNT(*) FROM gsp_machine_samples WHERE ts >= NOW() - INTERVAL 1 HOUR;
|
||||
SELECT COUNT(*) FROM gsp_process_samples WHERE ts >= NOW() - INTERVAL 1 HOUR;
|
||||
```
|
||||
|
||||
### Performance Impact
|
||||
|
||||
- Collection runs every 5 minutes by default (configurable)
|
||||
- Minimal performance overhead during collection
|
||||
- Uses native system tools for maximum efficiency
|
||||
- Database operations are optimized with prepared statements
|
||||
|
||||
## Migration from collector.py
|
||||
|
||||
To migrate from the standalone Python collector:
|
||||
|
||||
1. **Stop the cron job** running collector.py
|
||||
2. **Install Perl database modules** on agent machines
|
||||
3. **Update agent configuration** with database details
|
||||
4. **Restart OGP agents** to enable collection
|
||||
5. **Verify data collection** is working
|
||||
6. **Remove collector.py and Python dependencies**
|
||||
|
||||
The new system produces identical data to collector.py and uses the same database schema, so existing dashboards and reports will continue to work without changes.
|
||||
|
||||
## Frequency Configuration
|
||||
|
||||
The collection frequency can be adjusted by changing `stats_frequency_minutes` in the config:
|
||||
|
||||
- `stats_frequency_minutes => '1'` - Every minute (high frequency)
|
||||
- `stats_frequency_minutes => '5'` - Every 5 minutes (default)
|
||||
- `stats_frequency_minutes => '15'` - Every 15 minutes (low frequency)
|
||||
|
||||
Note: Very high frequencies (every minute) may impact performance on busy servers.
|
||||
|
||||
## Security Considerations
|
||||
|
||||
- Database credentials are stored in agent configuration files
|
||||
- Use dedicated database user with minimal privileges
|
||||
- Consider firewall rules if database is on separate server
|
||||
- Monitor database connections and prevent connection leaks
|
||||
|
||||
## Troubleshooting Common Issues
|
||||
|
||||
**Collection not working:**
|
||||
1. Check if DBD::mysql is installed
|
||||
2. Verify database connection details
|
||||
3. Check database user permissions
|
||||
4. Review agent logs for error messages
|
||||
|
||||
**Missing process data:**
|
||||
1. Verify game servers are running from subdirectories
|
||||
2. Check process detection logic matches your server layout
|
||||
3. Review process association in agent logs
|
||||
|
||||
**Performance issues:**
|
||||
1. Reduce collection frequency
|
||||
2. Check database performance
|
||||
3. Monitor agent resource usage during collection
|
||||
|
|
@ -1,195 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Mirror /home/gameserver to EITHER:
|
||||
# remote: bak-kc-01.iaregamer.com:/sdb1/backup/<host>/gameserver
|
||||
# local : <LOCAL_BASE>/<host>/gameserver
|
||||
#
|
||||
# Usage:
|
||||
# gs-backup.sh remote [--dry-run] [--verify] [--no-delete]
|
||||
# gs-backup.sh local [--dry-run] [--verify] [--no-delete]
|
||||
#
|
||||
# --dry-run : simulate only (no writes)
|
||||
# --verify : report differences; exit 0 if in-sync, 3 if drift detected
|
||||
# --no-delete : do not delete extraneous destination files
|
||||
#
|
||||
# Env you can override:
|
||||
# REMOTE_HOST=bak-kc-01.iaregamer.com REMOTE_USER=gameserver REMOTE_BASE=/sdb1/backup
|
||||
# LOCAL_BASE=/backup SRC_DIR=/home/gameserver
|
||||
# BW_PEAK_MBIT=100 BW_OFFPEAK_MBIT=300 PEAK_START=16 PEAK_END=23
|
||||
# SSH_KEY=/home/gameserver/.ssh/id_rsa
|
||||
# VERIFY_STRICT=0 (set 1 to use --checksum in verify)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# ---------- MODE ----------
|
||||
MODE="${1:-}"
|
||||
shift || true
|
||||
if [[ "$MODE" != "remote" && "$MODE" != "local" ]]; then
|
||||
echo "Usage: $0 {remote|local} [--dry-run] [--verify] [--no-delete]" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# ---------- FLAGS ----------
|
||||
DRY_RUN=0
|
||||
VERIFY=0
|
||||
DELETE=1
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--dry-run) DRY_RUN=1 ;;
|
||||
--verify) VERIFY=1 ; DRY_RUN=1 ;; # verify implies dry-run
|
||||
--no-delete) DELETE=0 ;;
|
||||
*) echo "Unknown option: $1" >&2; exit 2 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# ---------- DESTS / SOURCE ----------
|
||||
REMOTE_HOST="${REMOTE_HOST:-bak-kc-01.iaregamer.com}"
|
||||
REMOTE_USER="${REMOTE_USER:-gameserver}"
|
||||
REMOTE_BASE="${REMOTE_BASE:-/sdb1/backup}"
|
||||
LOCAL_BASE="${LOCAL_BASE:-/backup}"
|
||||
SRC_DIR="${SRC_DIR:-/home/gameserver}"
|
||||
|
||||
SSH_KEY="${SSH_KEY:-/home/gameserver/.ssh/id_rsa}"
|
||||
SSH_OPTS=( -o BatchMode=yes -o IdentitiesOnly=yes -i "$SSH_KEY" )
|
||||
|
||||
# ---------- Throttle caps (Mb/s) by time-of-day ----------
|
||||
BW_PEAK_MBIT="${BW_PEAK_MBIT:-100}"
|
||||
BW_OFFPEAK_MBIT="${BW_OFFPEAK_MBIT:-300}"
|
||||
PEAK_START="${PEAK_START:-16}"
|
||||
PEAK_END="${PEAK_END:-23}"
|
||||
|
||||
# ---------- Misc ----------
|
||||
LOCK_FILE="${LOCK_FILE:-/var/lock/gs-backup.lock}"
|
||||
LOG_FILE="${LOG_FILE:-/var/log/gs-backup.log}"
|
||||
PARTIAL_DIR=".rsync-partial"
|
||||
VERIFY_STRICT="${VERIFY_STRICT:-0}"
|
||||
|
||||
# Optional excludes (uncomment any you want)
|
||||
EXCLUDES=(
|
||||
# "--exclude=/home/gameserver/**/logs/**"
|
||||
# "--exclude=/home/gameserver/**/*.log"
|
||||
# "--exclude=/home/gameserver/**/cache/**"
|
||||
# "--exclude=/home/gameserver/**/steamapps/downloading/**"
|
||||
# "--exclude=/home/gameserver/**/steamapps/temp/**"
|
||||
)
|
||||
|
||||
log(){ printf '[%s] %s\n' "$(date +'%F %T')" "$*" | tee -a "$LOG_FILE" ; }
|
||||
|
||||
# ---------- Pre-flight ----------
|
||||
[[ -d "$SRC_DIR" ]] || { echo "Missing SRC_DIR: $SRC_DIR" >&2; exit 1; }
|
||||
command -v rsync >/dev/null || { echo "rsync not found" >&2; exit 1; }
|
||||
command -v ionice >/dev/null || { echo "ionice not found" >&2; exit 1; }
|
||||
|
||||
HOST_SHORT="$(hostname -s)"
|
||||
|
||||
# Cap selector
|
||||
hour="$(date +%H)"
|
||||
if [[ "$hour" -ge "$PEAK_START" && "$hour" -le "$PEAK_END" ]]; then
|
||||
CAP_MBIT="$BW_PEAK_MBIT"
|
||||
else
|
||||
CAP_MBIT="$BW_OFFPEAK_MBIT"
|
||||
fi
|
||||
BW_KBPS="$(( CAP_MBIT * 1000 / 8 ))" # rsync expects KB/s
|
||||
|
||||
# Build rsync base flags
|
||||
RSYNC_BASE=( rsync -aHAX --numeric-ids --info=stats2 )
|
||||
# Deletions (skip if --no-delete or verify w/o strict cleanup)
|
||||
if [[ $DELETE -eq 1 ]]; then
|
||||
RSYNC_BASE+=( --delete-delay )
|
||||
fi
|
||||
|
||||
# Dry-run?
|
||||
if [[ $DRY_RUN -eq 1 ]]; then
|
||||
RSYNC_BASE+=( -n )
|
||||
fi
|
||||
|
||||
# Itemize changes always in dry-run/verify so we can see drift
|
||||
if [[ $DRY_RUN -eq 1 ]]; then
|
||||
RSYNC_BASE+=( --itemize-changes --out-format='%i %n' )
|
||||
fi
|
||||
|
||||
# Verify strict? (checksum-based comparison is heavier; size+mtime otherwise)
|
||||
if [[ $VERIFY -eq 1 && $VERIFY_STRICT -eq 1 ]]; then
|
||||
RSYNC_BASE+=( --checksum )
|
||||
fi
|
||||
|
||||
# Performance / niceness
|
||||
RSYNC_BASE+=( --partial --partial-dir="$PARTIAL_DIR" --bwlimit="$BW_KBPS" )
|
||||
|
||||
# Excludes
|
||||
RSYNC_BASE+=( "${EXCLUDES[@]}" )
|
||||
|
||||
# Ensure local partial dir exists
|
||||
mkdir -p "$SRC_DIR/$PARTIAL_DIR" || true
|
||||
|
||||
# Compose destination
|
||||
if [[ "$MODE" == "remote" ]]; then
|
||||
DEST="${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_BASE}/${HOST_SHORT}/gameserver/"
|
||||
DEST_DESC="REMOTE ${REMOTE_HOST}:${REMOTE_BASE}/${HOST_SHORT}/gameserver"
|
||||
else
|
||||
DEST="${LOCAL_BASE%/}/${HOST_SHORT}/gameserver/"
|
||||
DEST_DESC="LOCAL ${LOCAL_BASE%/}/${HOST_SHORT}/gameserver"
|
||||
fi
|
||||
|
||||
# Ensure destination path exists
|
||||
if [[ "$MODE" == "remote" ]]; then
|
||||
ssh "${SSH_OPTS[@]}" "${REMOTE_USER}@${REMOTE_HOST}" "mkdir -p '${REMOTE_BASE}/${HOST_SHORT}/gameserver'" || true
|
||||
else
|
||||
mkdir -p "$DEST"
|
||||
fi
|
||||
|
||||
# ----------------- RUN -----------------
|
||||
{
|
||||
flock -n 9 || { log "Another run is active; exiting."; exit 0; }
|
||||
|
||||
log "MODE=$MODE DRY_RUN=$DRY_RUN VERIFY=$VERIFY DELETE=$DELETE"
|
||||
log "SRC=$SRC_DIR/ -> $DEST_DESC"
|
||||
log "Cap: ${CAP_MBIT} Mb/s (bwlimit=${BW_KBPS} KB/s)"
|
||||
|
||||
# Execute rsync
|
||||
if [[ "$MODE" == "remote" ]]; then
|
||||
CMD=( "${RSYNC_BASE[@]}" -e "ssh ${SSH_OPTS[*]}" "$SRC_DIR/" "$DEST" )
|
||||
else
|
||||
CMD=( "${RSYNC_BASE[@]}" "$SRC_DIR/" "$DEST" )
|
||||
fi
|
||||
|
||||
# In verify mode, capture output to detect drift
|
||||
CHANGES=0
|
||||
if [[ $VERIFY -eq 1 ]]; then
|
||||
TMP="$(mktemp)"
|
||||
set +e
|
||||
ionice -c3 nice -n 19 "${CMD[@]}" >"$TMP" 2>&1
|
||||
RC=$?
|
||||
set -e
|
||||
# Count itemized change lines (exclude rsync headers/footers)
|
||||
if grep -qE '^[<>ch\*\.][^ ]{9} ' "$TMP"; then
|
||||
CHANGES=1
|
||||
fi
|
||||
cat "$TMP" | tee -a "$LOG_FILE"
|
||||
rm -f "$TMP"
|
||||
|
||||
if [[ $RC -ne 0 ]]; then
|
||||
log "Verify run encountered rsync errors (rc=$RC)."
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
if [[ $CHANGES -eq 1 ]]; then
|
||||
log "VERIFY: Drift detected between source and destination."
|
||||
exit 3
|
||||
else
|
||||
log "VERIFY: Source and destination are in sync."
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
# Normal (or dry-run) run without drift check exit code
|
||||
ionice -c3 nice -n 19 "${CMD[@]}"
|
||||
RC=$?
|
||||
if [[ $RC -eq 0 ]]; then
|
||||
log "Completed successfully."
|
||||
else
|
||||
log "Rsync exited with code $RC."
|
||||
fi
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
} 9>"$LOCK_FILE"
|
||||
BIN
ftp/Client.zip
Normal file
57
game_titles.txt
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# Game Titles Reference File
|
||||
# This file contains the complete list of games to generate comprehensive server admin guides for
|
||||
# Format: Game Title | Engine | AppID | Workshop Support | LinuxGSM Support | OGP Module Support
|
||||
|
||||
# Existing games from data/games/ (verified)
|
||||
7 Days to Die | Unity | 294420 | No | Yes | Yes
|
||||
ARK: Survival Evolved | Unreal Engine 4 | 376030 | Yes | Yes | Yes
|
||||
ARMA 3 | Real Virtuality 4 | 107410 | Yes | Yes | Yes
|
||||
ARMA 2: Operation Arrowhead | Real Virtuality 3 | 33930 | No | Yes | Yes
|
||||
Counter-Strike: Global Offensive | Source | 730 | Yes | Yes | Yes
|
||||
DayZ | Enfusion | 221100 | Yes | Yes | Yes
|
||||
Garry's Mod | Source | 4000 | Yes | Yes | Yes
|
||||
Minecraft | Java | N/A | No | Yes | Yes
|
||||
Rust | Unity | 258550 | No | Yes | Yes
|
||||
Squad | Unreal Engine 4 | 393380 | Yes | Yes | Yes
|
||||
Team Fortress 2 | Source | 440 | Yes | Yes | Yes
|
||||
Terraria | XNA/MonoGame | 105600 | Yes | Yes | Yes
|
||||
Unturned | Unity | 304930 | Yes | Yes | Yes
|
||||
Valheim | Unity | 892970 | Yes | Yes | Yes
|
||||
|
||||
# Additional popular games from OGP, LinuxGSM, and top providers
|
||||
Conan Exiles | Unreal Engine 4 | 440900 | Yes | Yes | Yes
|
||||
Space Engineers | VRAGE 2.0 | 244850 | Yes | Yes | Yes
|
||||
Killing Floor 2 | Unreal Engine 3 | 232090 | Yes | Yes | Yes
|
||||
Left 4 Dead 2 | Source | 550 | Yes | Yes | Yes
|
||||
Counter-Strike 2 | Source 2 | 730 | Yes | Yes | Yes
|
||||
Call of Duty 4: Modern Warfare | IW 3.0 | N/A | No | Yes | Yes
|
||||
Call of Duty: World at War | IW 3.0 | N/A | No | Yes | Yes
|
||||
Factorio | Custom | 427520 | No | Yes | Yes
|
||||
Project Zomboid | Java | 108600 | Yes | Yes | Yes
|
||||
Insurgency: Sandstorm | Unreal Engine 4 | 581320 | Yes | Yes | Yes
|
||||
Rising Storm 2: Vietnam | Unreal Engine 3 | 418460 | Yes | Yes | Yes
|
||||
Red Orchestra 2 | Unreal Engine 3 | 35450 | Yes | Yes | Yes
|
||||
SCUM | Unreal Engine 4 | 513710 | No | Yes | Yes
|
||||
The Forest | Unity | 242760 | No | Yes | Yes
|
||||
Green Hell | Unity | 815370 | No | Yes | Yes
|
||||
V Rising | Unity | 1604030 | No | Yes | Yes
|
||||
Satisfactory | Unreal Engine 4 | 526870 | No | Yes | Yes
|
||||
Subnautica | Unity | 264710 | No | Yes | Yes
|
||||
Don't Starve Together | Custom | 322330 | Yes | Yes | Yes
|
||||
Avorion | Custom | 445220 | Yes | Yes | Yes
|
||||
Astroneer | Unreal Engine 4 | 361420 | No | Yes | Yes
|
||||
Eco | Unity | 382310 | No | Yes | Yes
|
||||
Atlas | Unreal Engine 4 | 834910 | Yes | Yes | Yes
|
||||
Stationeers | Unity | 544550 | No | Yes | Yes
|
||||
Citadel: Forged with Fire | Unreal Engine 4 | 487120 | Yes | Yes | Yes
|
||||
Blackwake | Unity | 420290 | No | Yes | Yes
|
||||
Mordhau | Unreal Engine 4 | 629760 | Yes | Yes | Yes
|
||||
Starbound | Custom | 211820 | Yes | Yes | Yes
|
||||
OpenTTD | Custom | N/A | No | Yes | Yes
|
||||
Multi Theft Auto | Custom | N/A | No | Yes | Yes
|
||||
San Andreas Multiplayer | Custom | N/A | No | Yes | Yes
|
||||
FiveM (GTA V) | RAGE | N/A | No | Yes | Yes
|
||||
Minecraft Bedrock | C++ | N/A | No | Yes | Yes
|
||||
CS2D | Custom | N/A | No | Yes | Yes
|
||||
Trackmania Nations | Custom | N/A | No | Yes | Yes
|
||||
Trackmania Forever | Custom | N/A | No | Yes | Yes
|
||||
BIN
images/logo.png
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 36 KiB |
BIN
images/online_big.png.bak
Normal file
|
After Width: | Height: | Size: 17 KiB |
384
index.orig.php
Normal file
|
|
@ -0,0 +1,384 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
// Report all PHP errors
|
||||
error_reporting(E_ERROR);
|
||||
|
||||
// Path definitions
|
||||
define("IMAGES", "images/");
|
||||
define("INCLUDES", "includes/");
|
||||
define("MODULES", "modules/");
|
||||
|
||||
define("CONFIG_FILE","includes/config.inc.php");
|
||||
|
||||
require_once("includes/functions.php");
|
||||
require_once("includes/helpers.php");
|
||||
require_once("includes/html_functions.php");
|
||||
|
||||
// Start the session valid for opengamepanel_web only
|
||||
startSession();
|
||||
|
||||
// Useful for debugging :)
|
||||
// echo "<p>Session ID is " . session_id() . "</p>";
|
||||
// echo "<p>Lifetime is: " . $cookie_lifetime . "<br />Dir is " . rtrim(dirname($_SERVER["SCRIPT_NAME"]),"/") . "/" . "<br /> Session cookie domain path is " . $session_cookie_domain_path . "<br />SSL is " . $ssl . "</p>";
|
||||
|
||||
//Config Check
|
||||
$config_inc_readable = is_readable(CONFIG_FILE);
|
||||
if ( !$config_inc_readable && file_exists("install.php") ) {
|
||||
header('Location: install.php');
|
||||
exit();
|
||||
}
|
||||
if ( '' == file_get_contents(CONFIG_FILE) ) {
|
||||
header('Location: install.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
require_once CONFIG_FILE;
|
||||
// Connect to the database server and select database.
|
||||
$db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name, $table_prefix);
|
||||
|
||||
// Load languages.
|
||||
include_once("includes/lang.php");
|
||||
|
||||
if (!$db instanceof OGPDatabase) {
|
||||
ogpLang();
|
||||
die(get_lang('no_db_connection'));
|
||||
}
|
||||
|
||||
// Logged in user settings - access this global variable where needed
|
||||
if(hasValue($_SESSION['user_id'])){
|
||||
$loggedInUserInfo = $db->getUserById($_SESSION['user_id']);
|
||||
}
|
||||
|
||||
$settings = $db->getSettings();
|
||||
@$GLOBALS['panel_language'] = $settings['panel_language'];
|
||||
ogpLang();
|
||||
|
||||
require_once("includes/view.php");
|
||||
$view = new OGPView();
|
||||
$view->setCharset( get_lang('lang_charset') );
|
||||
if(isset($_GET['type']) && $_GET['type'] == 'cleared')
|
||||
{
|
||||
heading(true);
|
||||
$view->printView(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ogpHome();
|
||||
$view->printView();
|
||||
}
|
||||
|
||||
function heading()
|
||||
{
|
||||
|
||||
global $db,$view,$settings;
|
||||
|
||||
$view->setCharset( get_lang('lang_charset') );
|
||||
$view->setTimeZone($settings['time_zone']);
|
||||
|
||||
if ( !file_exists(CONFIG_FILE) )
|
||||
{
|
||||
print_failure( get_lang("failed_to_read_config") );
|
||||
$view->refresh("index.php");
|
||||
return;
|
||||
}
|
||||
// Start Output Buffering
|
||||
|
||||
if( isset($settings['maintenance_mode']) && $settings['maintenance_mode'] == "1" )
|
||||
{
|
||||
if ($_SESSION['users_group'] != "admin" )
|
||||
{
|
||||
echo "<h2>".$settings['maintenance_title']."</h2>";
|
||||
echo "<p>".$settings['maintenance_message']."</p>";
|
||||
$view->setTitle("OGP: Maintenance.");
|
||||
echo "<p class='failure'>". get_lang("logging_out_10") ."...</p>";
|
||||
$view->refresh("index.php", 10);
|
||||
session_destroy();
|
||||
return;
|
||||
}
|
||||
}
|
||||
include "includes/navig.php";
|
||||
if(isset($maintenance))echo $maintenance;
|
||||
}
|
||||
|
||||
function ogpHome()
|
||||
{
|
||||
global $db,$view,$settings;
|
||||
|
||||
if( isset($_GET['lang']) AND $_GET['lang'] != "-")
|
||||
$lang = $_GET['lang'];
|
||||
elseif( isset($settings['panel_language']) )
|
||||
$lang = $settings['panel_language'];
|
||||
else
|
||||
$lang = "English";
|
||||
|
||||
$locale_files = makefilelist("lang/", ".|..|.svn", true, "folders");
|
||||
$lang_sel = "<select name='lang' onchange=\"this.form.submit();\" >\n".
|
||||
"<option>-</option>\n";
|
||||
for ($i=0;$i < count($locale_files);$i++)
|
||||
{
|
||||
$selected = ( isset( $_GET['lang'] ) AND $_GET['lang'] != "-" AND $_GET['lang'] == $locale_files[$i] ) ? "selected='selected'" : "";
|
||||
$lang_sel .= "<option $selected value='".$locale_files[$i]."' >".$locale_files[$i]."</option>\n";
|
||||
}
|
||||
$lang_sel .= "</select>\n";
|
||||
$lang_switch = ( isset( $_GET['lang'] ) AND $_GET['lang'] != "-" ) ? "&lang=" . $_GET['lang'] : "";
|
||||
?>
|
||||
%top%
|
||||
<div class="menu-bg">
|
||||
<div class="menu">
|
||||
<ul>
|
||||
<li><a href="index.php<?php echo preg_replace( "/\&/", "?", $lang_switch ); ?>" <?php if (!isset($_GET['m'])) echo 'class="admin_menu_link_selected"'; else echo 'class="admin_menu_link"'; ?> target="_self" ><span class="controlpanellogin"><?php echo get_lang("login_title"); ?></span></a></li>
|
||||
<?php
|
||||
$menus = $db->getMenusForGroup('guest');
|
||||
if(!empty($menus))
|
||||
{
|
||||
foreach ( $menus as $menu )
|
||||
{
|
||||
$module = $menu['module'];
|
||||
if ( !empty( $menu['subpage'] ) )
|
||||
{
|
||||
$subpage = "&p=".$menu['subpage'];
|
||||
$button = $menu['subpage'];
|
||||
if (isset($_GET['p']) AND $_GET['p'] == $menu['subpage'] ) $menu_link_class = 'user_menu_link_selected'; else $menu_link_class = 'user_menu_link';
|
||||
}
|
||||
else
|
||||
{
|
||||
$subpage = "";
|
||||
$button = $menu['module'];
|
||||
if (isset($_GET['m']) AND $_GET['m'] == $menu['module'] ) $menu_link_class = 'user_menu_link_selected'; else $menu_link_class = 'user_menu_link';
|
||||
}
|
||||
|
||||
$button_url = "?m=".$module.$subpage.$lang_switch;
|
||||
|
||||
if ( preg_match( '/\\_?\\_/', get_lang("$button") ) )
|
||||
{
|
||||
$button_name = $menu['menu_name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$button_name = get_lang("$button");
|
||||
}
|
||||
|
||||
echo "<li><a class='".$menu_link_class."' href='".$button_url."'><span class='$button'>$button_name</span></a>
|
||||
</li>\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
%topbody%
|
||||
<?php
|
||||
if (isset($_GET['m']))
|
||||
{
|
||||
heading();
|
||||
//tagged for future use...
|
||||
/*
|
||||
$postdata = "";
|
||||
foreach($_POST as $key =>$value)
|
||||
$postdata .= ",'$key': '$value'";
|
||||
$postdata = substr($postdata,1);
|
||||
$postdata = "{".$postdata."}";
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
$default_page = $db->isModuleInstalled('dashboard') ? "m=dashboard&p=dashboard" : "m=gamemanager&p=game_monitor";
|
||||
if ( isset($_SESSION['users_login']) )
|
||||
{
|
||||
$userInfo = $db->getUser($_SESSION['users_login']);
|
||||
if( isset($_SESSION['users_passwd']) AND !empty($_SESSION['users_passwd']) AND $_SESSION['users_passwd'] == $userInfo['users_passwd'])
|
||||
{
|
||||
print_success( get_lang("already_logged_in_redirecting_to_dashboard") .".");
|
||||
$view->refresh("home.php?$default_page",2);
|
||||
echo "%botbody%
|
||||
%bottom%";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_POST['login']) )
|
||||
{
|
||||
$client_ip = getClientIPAddress();
|
||||
|
||||
$ban_list = $db->resultQuery("SHOW TABLES LIKE 'OGP_DB_PREFIXban_list';");
|
||||
if ( empty( $ban_list ) )
|
||||
{
|
||||
$db->query("CREATE TABLE IF NOT EXISTS `OGP_DB_PREFIXban_list` (
|
||||
`client_ip` varchar(255) NOT NULL,
|
||||
`logging_attempts` int(11) NOT NULL DEFAULT '0',
|
||||
`banned_until` varchar(16) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`client_ip`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
}
|
||||
|
||||
$banlist_info = $db->resultQuery("SELECT logging_attempts, banned_until FROM `OGP_DB_PREFIXban_list` WHERE client_ip='".$client_ip."';");
|
||||
$login_attempts = !$banlist_info ? 0 : $banlist_info['0']['logging_attempts'];
|
||||
|
||||
if( $banlist_info AND $banlist_info['0']['banned_until'] > 0 AND $banlist_info['0']['banned_until'] <= time() )
|
||||
{
|
||||
$db->query("DELETE FROM `OGP_DB_PREFIXban_list` WHERE client_ip='$client_ip';");
|
||||
$login_attempts = 0;
|
||||
}
|
||||
|
||||
if( $login_attempts == $settings["login_attempts_before_banned"] )
|
||||
{
|
||||
print_failure("Banned until " . date("r",$banlist_info['0']['banned_until']));
|
||||
echo "%botbody%
|
||||
%bottom%";
|
||||
return;
|
||||
}
|
||||
|
||||
$userInfo = $db->getUser($_POST['ulogin']);
|
||||
|
||||
// If result matched $myusername and $mypassword, table row must be 1 row
|
||||
if( isset($userInfo['users_passwd']) && md5($_POST['upassword']) == $userInfo['users_passwd'])
|
||||
{
|
||||
// Handle recaptcha if enabled
|
||||
// But admins don't have to do this :)
|
||||
if($settings['recaptcha_use_login'] == "1" && !empty($settings['recaptcha_site_key']) && !empty($settings['recaptcha_secret_key']) && $userInfo['users_role'] != "admin"){
|
||||
$gRecaptchaResponse = sanitizeInputStr($_REQUEST['g-recaptcha-response']);
|
||||
|
||||
$sitekey = $settings['recaptcha_site_key'];
|
||||
$secretkey = $settings['recaptcha_secret_key'];
|
||||
|
||||
require_once('includes/classes/recaptcha/autoload.php');
|
||||
$recaptcha = new \ReCaptcha\ReCaptcha($secretkey);
|
||||
$resp = $recaptcha->verify($gRecaptchaResponse, $client_ip);
|
||||
|
||||
if (empty($gRecaptchaResponse) || !$resp->isSuccess()){
|
||||
print_failure("Recaptcha failed. Try again!");
|
||||
$view->refresh("index.php",5);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION['user_id'] = $userInfo['user_id'];
|
||||
$_SESSION['users_login'] = $userInfo['users_login'];
|
||||
$_SESSION['users_passwd'] = $userInfo['users_passwd'];
|
||||
$_SESSION['users_group'] = $userInfo['users_role'];
|
||||
$_SESSION['users_lang'] = isset( $_GET['lang'] ) ? $_GET['lang'] : $userInfo['users_lang'];
|
||||
$_SESSION['users_theme'] = $userInfo['users_theme'];
|
||||
$_SESSION['users_api_key'] = $db->getApiToken($userInfo['user_id']);
|
||||
print_success( get_lang("logging_in") ."...");
|
||||
$db->logger( get_lang("logging_in") ."...");
|
||||
$db->query("DELETE FROM `OGP_DB_PREFIXban_list` WHERE client_ip='$client_ip';");
|
||||
$view->refresh("home.php?$default_page",2);
|
||||
}
|
||||
else
|
||||
{
|
||||
print_failure( get_lang("bad_login") );
|
||||
$login_attempts++;
|
||||
if( $login_attempts == $settings["login_attempts_before_banned"] )
|
||||
{
|
||||
$banned_until = time() + (array_key_exists("login_ban_time" , $settings) && !empty($settings["login_ban_time"]) && is_numeric($settings["login_ban_time"]) ? $settings["login_ban_time"] : 300); // Five minutes or user defined setting.
|
||||
|
||||
if( !$banlist_info )
|
||||
$db->query("INSERT INTO `OGP_DB_PREFIXban_list` (`client_ip`) VALUES('$client_ip');");
|
||||
|
||||
$db->logger( get_lang("bad_login") . " ( Banned until " . date("r", $banned_until) . " ) [ " . get_lang("login") . ": " . sanitizeInputStr($_POST["ulogin"]) . ", " . get_lang("password") . ": ******** ]" );
|
||||
$db->query("UPDATE `OGP_DB_PREFIXban_list` SET logging_attempts='$login_attempts', banned_until='$banned_until' WHERE client_ip='$client_ip';");
|
||||
print_failure("Banned until " . date("r",$banned_until));
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !$banlist_info )
|
||||
$db->query("INSERT INTO `OGP_DB_PREFIXban_list` (`client_ip`) VALUES('$client_ip');");
|
||||
|
||||
$db->logger( get_lang("bad_login") . " ( $login_attempts ) [ " . get_lang("login") . ": " . sanitizeInputStr($_POST["ulogin"]) . ", " . get_lang("password") . ": ******** ]" );
|
||||
$db->query("UPDATE `OGP_DB_PREFIXban_list` SET logging_attempts='$login_attempts' WHERE client_ip='$client_ip';");
|
||||
$view->refresh("index.php",2);
|
||||
}
|
||||
}
|
||||
echo "%botbody%
|
||||
%bottom%";
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<!-- Made for Revolution Theme v2 -->
|
||||
<style type="text/css">
|
||||
div.main-content {
|
||||
background:transparent;
|
||||
border:none;
|
||||
padding:0;
|
||||
border-radius:0px;
|
||||
-moz-border-radius:0px;
|
||||
}
|
||||
</style>
|
||||
<table style='width:200px' align='center'>
|
||||
<tr style='background-color:transparent;' >
|
||||
<td style='background-color:transparent;' >
|
||||
<div class='bloc' >
|
||||
<h4><?php print_lang('login_title'); ?></h4>
|
||||
<br>
|
||||
<form action="index.php<?php echo preg_replace( "/\&/", "?", $lang_switch ); ?>" name="login_form" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php print_lang('lang'); ?>:</td>
|
||||
<td><?php echo $lang_sel; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('login'); ?>:</td>
|
||||
<td><input type="text" name="ulogin" id="ulogin" value="" size="20" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('password'); ?>:</td>
|
||||
<td><input type="password" name="upassword" value="" size="20" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($settings['recaptcha_use_login'] == "1" && !empty($settings['recaptcha_site_key']) && !empty($settings['recaptcha_secret_key'])){
|
||||
?>
|
||||
<tr>
|
||||
<td><?php print_lang('solve_captcha'); ?>:</td>
|
||||
<td>
|
||||
<script src="https://www.google.com/recaptcha/api.js"></script>
|
||||
<div style="display: inline-block;" class="g-recaptcha" data-sitekey="<?php echo $settings['recaptcha_site_key']; ?>"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><input type="submit" name="login" value="<?php print_lang('login_button'); ?>" /></td>
|
||||
<td><a href="?m=lostpwd<?php echo $lang_switch; ?>"><?php print_lang('lost_passwd'); ?></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<script language="JavaScript">
|
||||
document.login_form.ulogin.focus();
|
||||
</script>
|
||||
<br>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
%botbody%
|
||||
%bottom%
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
|
@ -144,13 +144,11 @@ function ogpHome()
|
|||
$lang_sel .= "</select>\n";
|
||||
$lang_switch = ( isset( $_GET['lang'] ) AND $_GET['lang'] != "-" ) ? "&lang=" . $_GET['lang'] : "";
|
||||
?>
|
||||
|
||||
<div>
|
||||
</div>
|
||||
|
||||
<div style="clear: both;">
|
||||
</div>
|
||||
|
||||
%top%
|
||||
|
||||
<div class="menu-bg">
|
||||
|
|
@ -494,6 +492,7 @@ function ogpHome()
|
|||
<div style="text-align:center"> <h1>Level UP your gaming</h1></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
%bottom%
|
||||
<?php
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,26 @@
|
|||
|
||||
// Module general information
|
||||
$module_title = "TS3Admin";
|
||||
$module_version = "1.0";
|
||||
$db_version = 0;
|
||||
$module_version = "0.2";
|
||||
$db_version = 2;
|
||||
$module_required = TRUE;
|
||||
$module_menus = array( array( 'subpage' => '', 'name'=>'ts3admin', 'group'=>'user' ) );
|
||||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."ts3_homes`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."ts3_homes`
|
||||
(`ts3_id` int(50) NOT NULL auto_increment,
|
||||
`rserver_id` int(50) NOT NULL,
|
||||
`ip` varchar(20) NOT NULL,
|
||||
`pwd` varchar(40) NOT NULL,
|
||||
`vserver_id` int(50) NOT NULL,
|
||||
`user_id` int(50) NOT NULL,
|
||||
PRIMARY KEY (`ts3_id`),
|
||||
UNIQUE KEY user_id (user_id,vserver_id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
$install_queries[1] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."ts3_homes` DROP INDEX `user_id` ,
|
||||
ADD UNIQUE `rserver_id` ( `rserver_id` , `vserver_id` , `user_id` );");
|
||||
$install_queries[2] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."ts3_homes` ADD `port` int(11) DEFAULT '10011'"
|
||||
);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -24,9 +24,25 @@
|
|||
|
||||
// Module general information
|
||||
$module_title = "Addons Manager";
|
||||
$module_version = "1.0";
|
||||
$db_version = 0;
|
||||
$module_version = "1.2";
|
||||
$db_version = 2;
|
||||
$module_required = TRUE;
|
||||
$module_menus = array( array( 'subpage' => 'addons_manager', 'name'=>'Addons Manager', 'group'=>'admin' ) );
|
||||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."addons`;",
|
||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."addons
|
||||
(addon_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(80) NOT NULL,
|
||||
url VARCHAR(200) NOT NULL,
|
||||
path VARCHAR(80) NOT NULL,
|
||||
addon_type VARCHAR(7) NOT NULL,
|
||||
home_cfg_id VARCHAR(7) NOT NULL) ENGINE=MyISAM;");
|
||||
|
||||
$install_queries[1] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."addons` ADD `post_script` longtext NOT NULL;");
|
||||
|
||||
$install_queries[2] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."addons` ADD `group_id` int(11) NULL;");
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -24,10 +24,30 @@
|
|||
|
||||
// Module general information
|
||||
$module_title = "Administration";
|
||||
$module_version = "1.0";
|
||||
$db_version = 0;
|
||||
$module_version = "1.1";
|
||||
$db_version = 1;
|
||||
$module_required = TRUE;
|
||||
$module_menus = array( array( 'subpage' => 'watch_logger', 'name'=>'Watch Logger', 'group'=>'admin' ) );
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."adminExternalLinks`;",
|
||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."adminExternalLinks
|
||||
(
|
||||
link_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(80) NOT NULL,
|
||||
url VARCHAR(200) NOT NULL,
|
||||
user_id VARCHAR(7) NOT NULL
|
||||
) ENGINE=MyISAM;");
|
||||
|
||||
$install_queries[1] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."logger`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."logger`
|
||||
(
|
||||
`log_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`date` varchar(20) NOT NULL,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`ip` varchar(15) NOT NULL,
|
||||
`message` varchar(250) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
?>
|
||||
|
||||
|
|
|
|||
151
modules/administration/watch_logger.bak
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
<script type="text/javascript" src="js/modules/administration.js"></script>
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module() {
|
||||
global $db, $view, $loggedInUserInfo;
|
||||
|
||||
$search_field = (isset($_GET['search']) && !empty($_GET['search'])) ? $_GET['search'] : false;
|
||||
$p = (isset($_GET['page']) && (int)$_GET['page'] > 0) ? (int)$_GET['page'] : 1;
|
||||
$l = (isset($_GET['limit']) && (int)$_GET['limit'] > 0) ? (int)$_GET['limit'] : 10;
|
||||
|
||||
if(hasValue($loggedInUserInfo) && is_array($loggedInUserInfo) && $loggedInUserInfo["users_page_limit"] && !(isset($_GET['limit']) and !empty($_GET['limit']))){
|
||||
$l = $loggedInUserInfo["users_page_limit"];
|
||||
}
|
||||
|
||||
echo "<h2>".get_lang('watch_logger')."</h2>";
|
||||
|
||||
$logs = $db->read_logger($p, $l, $search_field);
|
||||
|
||||
if (empty($logs) && !empty($search_field)) {
|
||||
print_failure(get_lang_f('no_results_found', htmlentities($search_field)));
|
||||
$view->refresh("?m=administration&p=watch_logger", 5);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
<!-- Search, Empty Logger, and Paging Options Table -->
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="width: 50%; vertical-align: middle; text-align: left;">
|
||||
<form action="home.php" method="GET" style="display: inline;">
|
||||
<input type ="hidden" name="m" value="administration" />
|
||||
<input type ="hidden" name="p" value="watch_logger" />
|
||||
<input name="search" type="text" id="search" value="<?php if(hasValue($search_field)){ echo $search_field; } ?>" />
|
||||
<input type="submit" value="<?php echo get_lang('search'); ?>" />
|
||||
</form>
|
||||
<form method=POST style="display: inline;">
|
||||
<input type="submit" name="empty_logger" value="<?php print_lang('empty_logger'); ?>" >
|
||||
</form>
|
||||
</td>
|
||||
<td style="width: 50%; vertical-align: middle; text-align: right;">
|
||||
<?php echo print_lang('view'); ?> <a href='?m=administration&p=watch_logger&limit=10'>10</a> / <a href='?m=administration&p=watch_logger&limit=20'>20</a> / <a href='?m=administration&p=watch_logger&limit=50'>50</a> / <a href='?m=administration&p=watch_logger&limit=100'>100</a> <?php echo print_lang('per_page'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END Search, Empty Logger, and Paging Options Table -->
|
||||
|
||||
<table id="servermonitor" class="tablesorter" data-sortlist="[[1,1]]">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:16px;background-position: center;" class="sorter-false"></th>
|
||||
<th class="dateFormat-ddmmyyyy"><?php print_lang('when'); ?></th>
|
||||
<th><?php print_lang('who'); ?></th>
|
||||
<th><?php print_lang('where'); ?></th>
|
||||
<th><?php print_lang('what'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if( isset( $_POST['log_id'] ) ){
|
||||
$db->del_logger_log($_POST['log_id']);
|
||||
$newLogs = array();
|
||||
foreach($logs as $log){
|
||||
if($log['log_id'] != $_POST['log_id']){
|
||||
$newLogs[] = $log;
|
||||
}
|
||||
}
|
||||
$logs = $newLogs;
|
||||
}
|
||||
|
||||
if( isset( $_POST['empty_logger'] ) ){
|
||||
$db->empty_logger();
|
||||
$logs = false;
|
||||
}
|
||||
|
||||
if($logs)
|
||||
{
|
||||
foreach($logs as $log)
|
||||
{
|
||||
$user = $db->getUserById($log['user_id']);
|
||||
$when = $log['date'];
|
||||
$who = $user['users_login'];
|
||||
$where = $log['ip'];
|
||||
$what = $log['message'];
|
||||
$log_id = $log['log_id'];
|
||||
// Template
|
||||
echo "<tr class='maintr'>\n".
|
||||
"<td class='collapsible'>\n".
|
||||
"<center>\n".
|
||||
"<form method=POST>\n".
|
||||
"<input type='hidden' name='log_id' value='$log_id' />\n".
|
||||
"<input type='image' name='remove_log' onclick=\"this.form.submit();\" src='modules/administration/images/remove.gif' />\n".
|
||||
"</form>\n".
|
||||
"</center>\n".
|
||||
"</td>\n".
|
||||
"<td class='collapsible'>$when</td>\n".
|
||||
"<td class='collapsible'>$who</td>\n".
|
||||
"<td class='collapsible'>$where</td>\n".
|
||||
"<td class='collapsible'>$what</td>\n".
|
||||
"</tr>\n";
|
||||
|
||||
echo "<tr class='expand-child'>\n".
|
||||
"<td colspan='5' >\n".
|
||||
"<table>\n";
|
||||
|
||||
$show_values = array( "users_login", "users_lang", "users_role", "users_email", "user_expires");
|
||||
foreach($user as $key => $value)
|
||||
{
|
||||
if( in_array( $key, $show_values ) )
|
||||
echo "<tr><td>".str_replace("_", "", substr($key,5))."</td><td>$value</td></tr>\n";
|
||||
}
|
||||
echo "</tr>\n".
|
||||
"</td>\n".
|
||||
"</table>\n";
|
||||
}
|
||||
}
|
||||
echo "</tbody>\n";
|
||||
echo "<tfoot style='border:1px solid grey;'></tfoot>\n";
|
||||
echo "</table>\n";
|
||||
$count_logs = $db->get_logger_count($search_field);
|
||||
|
||||
if (isset($_GET['search']) && !empty($_GET['search'])) {
|
||||
$uri = '?m=administration&p=watch_logger&search='.$_GET['search'].'&limit='.$l.'&page=';
|
||||
} else {
|
||||
$uri = '?m=administration&p=watch_logger&limit='.$l.'&page=';
|
||||
}
|
||||
echo paginationPages($count_logs[0]['total'], $p, $l, $uri, 3, 'watchLogger');
|
||||
}
|
||||
?>
|
||||
|
|
@ -2,129 +2,6 @@
|
|||
require_once("includes/lib_remote.php");
|
||||
require_once("modules/config_games/server_config_parser.php");
|
||||
|
||||
function createMysqlDatabase($home_id, $settings, $db) {
|
||||
// Generate database name and user based on server ID
|
||||
$dbID = "server_" . $home_id;
|
||||
$dbPass = substr(str_shuffle("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), 0, 12);
|
||||
|
||||
// Check if MySQL auto-creation is enabled
|
||||
if (!isset($settings['mysql_auto_create']) || $settings['mysql_auto_create'] != '1') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if we have the required MySQL settings
|
||||
if (empty($settings['mysql_root_user']) || empty($settings['mysql_root_password']) || empty($settings['mysql_host'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$mysql_host = $settings['mysql_host'];
|
||||
$mysql_user = $settings['mysql_root_user'];
|
||||
$mysql_pass = $settings['mysql_root_password'];
|
||||
$mysql_port = isset($settings['mysql_port']) ? $settings['mysql_port'] : '3306';
|
||||
|
||||
try {
|
||||
// Create MySQL connection
|
||||
if (function_exists('mysqli_connect')) {
|
||||
$link = mysqli_connect($mysql_host, $mysql_user, $mysql_pass, "", $mysql_port);
|
||||
if (!$link) {
|
||||
$db->logger("MYSQL DB CREATION FAILED - Could not connect to MySQL server for server " . $home_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create database
|
||||
$query = "CREATE DATABASE IF NOT EXISTS `" . mysqli_real_escape_string($link, $dbID) . "`";
|
||||
mysqli_query($link, $query);
|
||||
|
||||
// Grant privileges to database user locally
|
||||
$query = "GRANT ALL ON `" . mysqli_real_escape_string($link, $dbID) . "`.* TO '" . mysqli_real_escape_string($link, $dbID) . "'@'localhost' IDENTIFIED BY '" . mysqli_real_escape_string($link, $dbPass) . "'";
|
||||
mysqli_query($link, $query);
|
||||
|
||||
// Grant privileges to database user remotely
|
||||
$query = "GRANT ALL ON `" . mysqli_real_escape_string($link, $dbID) . "`.* TO '" . mysqli_real_escape_string($link, $dbID) . "'@'%' IDENTIFIED BY '" . mysqli_real_escape_string($link, $dbPass) . "'";
|
||||
mysqli_query($link, $query);
|
||||
|
||||
// If there's a special user defined, grant it access too (like dayzhivemind in the original script)
|
||||
if (!empty($settings['mysql_special_user']) && !empty($settings['mysql_special_password'])) {
|
||||
$query = "GRANT ALL ON `" . mysqli_real_escape_string($link, $dbID) . "`.* TO '" . mysqli_real_escape_string($link, $settings['mysql_special_user']) . "'@'%' IDENTIFIED BY '" . mysqli_real_escape_string($link, $settings['mysql_special_password']) . "'";
|
||||
mysqli_query($link, $query);
|
||||
}
|
||||
|
||||
// Flush privileges
|
||||
mysqli_query($link, "FLUSH PRIVILEGES");
|
||||
|
||||
// Import SQL file if specified
|
||||
if (!empty($settings['mysql_init_sql_file'])) {
|
||||
$sql_file = $settings['mysql_init_sql_file'];
|
||||
if (file_exists($sql_file)) {
|
||||
$sql_content = file_get_contents($sql_file);
|
||||
mysqli_select_db($link, $dbID);
|
||||
mysqli_multi_query($link, $sql_content);
|
||||
}
|
||||
}
|
||||
|
||||
mysqli_close($link);
|
||||
} else {
|
||||
// Fallback to old mysql functions
|
||||
$link = mysql_connect($mysql_host . ':' . $mysql_port, $mysql_user, $mysql_pass);
|
||||
if (!$link) {
|
||||
$db->logger("MYSQL DB CREATION FAILED - Could not connect to MySQL server for server " . $home_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create database
|
||||
$query = "CREATE DATABASE IF NOT EXISTS `" . mysql_real_escape_string($dbID, $link) . "`";
|
||||
mysql_query($query, $link);
|
||||
|
||||
// Grant privileges
|
||||
$query = "GRANT ALL ON `" . mysql_real_escape_string($dbID, $link) . "`.* TO '" . mysql_real_escape_string($dbID, $link) . "'@'localhost' IDENTIFIED BY '" . mysql_real_escape_string($dbPass, $link) . "'";
|
||||
mysql_query($query, $link);
|
||||
|
||||
$query = "GRANT ALL ON `" . mysql_real_escape_string($dbID, $link) . "`.* TO '" . mysql_real_escape_string($dbID, $link) . "'@'%' IDENTIFIED BY '" . mysql_real_escape_string($dbPass, $link) . "'";
|
||||
mysql_query($query, $link);
|
||||
|
||||
if (!empty($settings['mysql_special_user']) && !empty($settings['mysql_special_password'])) {
|
||||
$query = "GRANT ALL ON `" . mysql_real_escape_string($dbID, $link) . "`.* TO '" . mysql_real_escape_string($settings['mysql_special_user'], $link) . "'@'%' IDENTIFIED BY '" . mysql_real_escape_string($settings['mysql_special_password'], $link) . "'";
|
||||
mysql_query($query, $link);
|
||||
}
|
||||
|
||||
mysql_query("FLUSH PRIVILEGES", $link);
|
||||
|
||||
if (!empty($settings['mysql_init_sql_file'])) {
|
||||
$sql_file = $settings['mysql_init_sql_file'];
|
||||
if (file_exists($sql_file)) {
|
||||
$sql_content = file_get_contents($sql_file);
|
||||
mysql_select_db($dbID, $link);
|
||||
mysql_query($sql_content, $link);
|
||||
}
|
||||
}
|
||||
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
// Add database to OGP tracking if mysql_server_id is configured
|
||||
if (!empty($settings['mysql_default_server_id'])) {
|
||||
// Try to add to the mysql_databases table directly using the main db connection
|
||||
$db->query("DELETE FROM OGP_DB_PREFIXmysql_databases WHERE db_user = '" . $db->realEscapeSingle($dbID) . "'");
|
||||
|
||||
// Insert new database record directly
|
||||
$query = "INSERT INTO OGP_DB_PREFIXmysql_databases (mysql_server_id, home_id, db_user, db_passwd, db_name, enabled) VALUES (" .
|
||||
$db->realEscapeSingle($settings['mysql_default_server_id']) . ", " .
|
||||
$db->realEscapeSingle($home_id) . ", '" .
|
||||
$db->realEscapeSingle($dbID) . "', '" .
|
||||
$db->realEscapeSingle($dbPass) . "', '" .
|
||||
$db->realEscapeSingle($dbID) . "', 1)";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
$db->logger("MYSQL DB CREATED - Database " . $dbID . " created for server " . $home_id);
|
||||
return true;
|
||||
|
||||
} catch (Exception $e) {
|
||||
$db->logger("MYSQL DB CREATION FAILED - Error creating database for server " . $home_id . ": " . $e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db,$view,$settings;
|
||||
|
|
@ -364,13 +241,6 @@ function exec_ogp_module()
|
|||
echo "<h4><br><p>".get_lang('starting_installations')."</p></h4><br>";
|
||||
//PANEL LOG
|
||||
$db->logger( "CREATED NEW SERVER " . $home_id);
|
||||
|
||||
// CREATE MYSQL DATABASE FOR NEW SERVERS
|
||||
if($order['finish_date'] == 0){
|
||||
$settings = $db->getSettings();
|
||||
createMysqlDatabase($home_id, $settings, $db);
|
||||
}
|
||||
|
||||
// SEND EMAIL to new server only
|
||||
if($order['finish_date'] == 0){
|
||||
$settings = $db->getSettings();
|
||||
|
|
|
|||
217
modules/billing/cron-shop.php.bak
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2017 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
chdir(realpath(dirname(__FILE__))); /* Change to the current file path */
|
||||
chdir("../.."); /* Base path to ogp web files */
|
||||
// Report all PHP errors
|
||||
error_reporting(E_ALL);
|
||||
// Path definitions
|
||||
define("CONFIG_FILE","includes/config.inc.php");
|
||||
//Requiere
|
||||
require_once("includes/functions.php");
|
||||
require_once("includes/helpers.php");
|
||||
require_once("includes/html_functions.php");
|
||||
require_once("modules/config_games/server_config_parser.php");
|
||||
require_once("includes/lib_remote.php");
|
||||
require_once CONFIG_FILE;
|
||||
// Connect to the database server and select database.
|
||||
$db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name, $table_prefix);
|
||||
|
||||
$panel_settings = $db->getSettings();
|
||||
if( isset($panel_settings['time_zone']) && $panel_settings['time_zone'] != "" )
|
||||
date_default_timezone_set($panel_settings['time_zone']);
|
||||
|
||||
|
||||
//these dates are configured in the Shop Settings page
|
||||
$today=time();
|
||||
$invoice_date = strtotime('+ 7 days'); //this many days until the finish_date
|
||||
$suspend_date = $today; //suspend when overdue
|
||||
//final date is 10th, we need to remove on 17th, so final date is > removal_date
|
||||
$removal_date = strtotime('- 7 days'); //finish_date is passed 7 days ago
|
||||
$rundate = date('d/M/y G:i',$today);
|
||||
|
||||
|
||||
//THESE SERVERS HAVE REACHED THE DATE FOR INVOICE, FINISH_DATE - 7 (OR WHAT IS IN SETTINGS)
|
||||
//SET STATUS -1 MEANING INVOICED
|
||||
//LOOP THROUGH ALL SERVERS WITH STATUS = 1 (ACTIVE) -----------------------------------------------------------
|
||||
$user_homes = $db->resultQuery( "SELECT *
|
||||
FROM " . $table_prefix . "billing_orders
|
||||
WHERE status > 0 AND finish_date <" . $invoice_date);
|
||||
|
||||
if (!is_array($user_homes))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($user_homes as $user_home)
|
||||
{
|
||||
|
||||
$user_id = $user_home['user_id'];
|
||||
$home_id = $user_home['home_id'];
|
||||
|
||||
|
||||
// Reset the STATUS -1 so cart.php will create an invoice
|
||||
$db->query( "UPDATE " . $table_prefix . "billing_orders
|
||||
SET status=-1
|
||||
WHERE order_id=".$db->realEscapeSingle($user_home['order_id']));
|
||||
|
||||
// SEND EMAIL
|
||||
$settings = $db->getSettings();
|
||||
$subject = "You have an INVOICE at ". $panel_settings['panel_name'];
|
||||
$email = $db->resultQuery(" SELECT DISTINCT users_email
|
||||
FROM " . $table_prefix . "users, " . $table_prefix . "billing_orders
|
||||
WHERE " . $table_prefix . "users.user_id = $user_id")[0]["users_email"];
|
||||
$message = "Your server with ID ". $home_id . " will expire soon. Please log in and VIEW INVOICES on the Dashboard to renew your server.<br><br><br>~<br>Thanks!<br>";
|
||||
$mail = mymail($email, $subject, $message, $settings);
|
||||
//logger
|
||||
$db->logger( "INVOICE created for server " . $home_id);
|
||||
|
||||
if (!$mail)
|
||||
$db->logger( "Email FAILED - Server Invoiced " . $home_id);
|
||||
|
||||
// END EMAIL
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//THESE ARE THE SERVERS THAT HAVE NOT BEEN PAID AND THE FINISH_DATE IS TODAY
|
||||
//THESE SERVERS GET SUSPENDED
|
||||
//LOOP THROUGH ALL ORDERS WITH STATUS 0 OR -1 (INACTIVE OR INVOICED)
|
||||
$user_homes = $db->resultQuery( "SELECT *
|
||||
FROM " . $table_prefix . "billing_orders
|
||||
WHERE (status = -1 OR status = 0) AND finish_date < ".$today);
|
||||
|
||||
if (!is_array($user_homes))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($user_homes as $user_home)
|
||||
{
|
||||
$user_id = $user_home['user_id'];
|
||||
$home_id = $user_home['home_id'];
|
||||
$home_info = $db->getGameHomeWithoutMods($home_id);
|
||||
$server_info = $db->getRemoteServerById($home_info['remote_server_id']);
|
||||
$remote = new OGPRemoteLibrary($server_info['agent_ip'], $server_info['agent_port'], $server_info['encryption_key'],$server_info['timeout']);
|
||||
$ftp_login = isset($home_info['ftp_login']) ? $home_info['ftp_login'] : $home_id;
|
||||
$remote->ftp_mgr("userdel", $ftp_login);
|
||||
$db->changeFtpStatus('disabled',$home_id);
|
||||
$server_xml = read_server_config(SERVER_CONFIG_LOCATION."/".$home_info['home_cfg_file']);
|
||||
if(isset($server_xml->control_protocol_type))$control_type = $server_xml->control_protocol_type; else $control_type = "";
|
||||
$addresses = $db->getHomeIpPorts($home_id);
|
||||
foreach($addresses as $address)
|
||||
{
|
||||
$remote->remote_stop_server($home_id,$address['ip'],$address['port'],$server_xml->control_protocol,$home_info['control_password'],$control_type,$home_info['home_path']);
|
||||
}
|
||||
$db->unassignHomeFrom("user", $user_id, $home_id);
|
||||
|
||||
// Reset the invoice end date to -2
|
||||
// User can still RENEW server
|
||||
$db->query( "UPDATE " . $table_prefix . "billing_orders
|
||||
SET status=-2
|
||||
WHERE order_id=".$db->realEscapeSingle($user_home['order_id']));
|
||||
|
||||
//logger
|
||||
$db->logger( "SUSPENDED server " . $home_id);
|
||||
|
||||
// SEND EMAIL
|
||||
$settings = $db->getSettings();
|
||||
$subject = "GameServer Suspended at ". $panel_settings['panel_name'];
|
||||
$email = $db->resultQuery(" SELECT DISTINCT users_email
|
||||
FROM " . $table_prefix . "users, " . $table_prefix . "billing_orders
|
||||
WHERE " . $table_prefix . "users.user_id = $user_id")[0]["users_email"];
|
||||
$message = "Your server with ID ". $home_id . " has expired and has been suspended. Please log in and VIEW INVOICES on the Dashboard to renew your server.<br>~<br>Thanks!<br>";
|
||||
$mail = mymail($email, $subject, $message, $settings);
|
||||
if (!$mail)
|
||||
$db->logger( "Email FAILED - Server Suspended " . $home_id);
|
||||
// END EMAIL
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// end date = -2 (suspended) and its been suspended for $removal_date days
|
||||
//set removed servers as -99
|
||||
$user_homes = $db->resultQuery( "SELECT *
|
||||
FROM " . $table_prefix . "billing_orders
|
||||
WHERE status = -2 AND finish_date < ".$removal_date );
|
||||
|
||||
if (!is_array($user_homes))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($user_homes as $user_home)
|
||||
{
|
||||
$user_id = $user_home['user_id'];
|
||||
$home_id = $user_home['home_id'];
|
||||
$home_info = $db->getGameHomeWithoutMods($home_id);
|
||||
$server_info = $db->getRemoteServerById($home_info['remote_server_id']);
|
||||
$remote = new OGPRemoteLibrary($server_info['agent_ip'], $server_info['agent_port'], $server_info['encryption_key'],$server_info['timeout']);
|
||||
|
||||
// Remove the game home from db
|
||||
$db->deleteGameHome($home_id);
|
||||
|
||||
// Remove the game home files from remote server
|
||||
$remote->remove_home($home_info['home_path']);
|
||||
|
||||
|
||||
|
||||
// Reset the invoice end date
|
||||
$db->query( "UPDATE " . $table_prefix . "billing_orders
|
||||
SET status=-3
|
||||
WHERE order_id=".$db->realEscapeSingle($user_home['order_id']));
|
||||
|
||||
|
||||
// Set order as not installed
|
||||
$db->query( "UPDATE " . $table_prefix . "billing_orders
|
||||
SET home_id=0
|
||||
WHERE cart_id=".$db->realEscapeSingle($user_home['cart_id']));
|
||||
|
||||
//logger
|
||||
$db->logger( "DELETED server " . $home_id);
|
||||
|
||||
|
||||
// SEND EMAIL
|
||||
$settings = $db->getSettings();
|
||||
$settings = $db->getSettings();
|
||||
$subject = "GameServer DELETED at ". $panel_settings['panel_name'];
|
||||
$email = $db->resultQuery(" SELECT DISTINCT users_email
|
||||
FROM " . $table_prefix . "users, " . $table_prefix . "billing_orders
|
||||
WHERE " . $table_prefix . "users.user_id = $user_id")[0]["users_email"];
|
||||
$message = "Your server with ID ". $home_id . " has been deleted<br><br>You did not renew the service and it was PERMANENTLY REMOVED today. If this was an error, if you contact us immediately we may be able to restore your server.<br>Thanks for being a customer and we hope we can provide a server for you again.<br><br>";
|
||||
$mail = mymail($email, $subject, $message, $settings);
|
||||
if (!$mail)
|
||||
$db->logger( "Email FAILED - Server Deleted " . $home_id);
|
||||
// END EMAIL
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
// Module general information
|
||||
$module_title = "billing";
|
||||
$module_version = "1.0";
|
||||
$db_version = 0;
|
||||
$module_version = "1";
|
||||
$db_version = 4;
|
||||
$module_required = FALSE;
|
||||
$module_menus = array(
|
||||
array( 'subpage' => 'orders', 'name'=>'Orders', 'group'=>'user,admin' ),
|
||||
|
|
@ -34,4 +34,103 @@ $module_menus = array(
|
|||
array( 'subpage' => 'coupons', 'name'=>'Coupons', 'group'=>'admin' )
|
||||
);
|
||||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_services`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_services` (
|
||||
`service_id` int(11) NOT NULL auto_increment,
|
||||
`home_cfg_id` int(11) NOT NULL,
|
||||
`mod_cfg_id` int(11) NOT NULL,
|
||||
`service_name` varchar(255) NOT NULL,
|
||||
`remote_server_id` varchar(255) NOT NULL,
|
||||
`slot_max_qty` int(11) NOT NULL,
|
||||
`slot_min_qty` int(11) NOT NULL,
|
||||
`price_daily` float(15,4) NOT NULL,
|
||||
`price_monthly` float(15,4) NOT NULL,
|
||||
`price_year` float(15,4) NOT NULL,
|
||||
`description` varchar(1000) NOT NULL,
|
||||
`img_url` varchar(255) NOT NULL,
|
||||
`ftp` varchar(255) NOT NULL,
|
||||
`install_method` varchar(255) NOT NULL,
|
||||
`manual_url` varchar(255) NOT NULL,
|
||||
`access_rights` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`service_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=UTF8;",
|
||||
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_orders` (
|
||||
`order_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`service_id` int(11) NOT NULL,
|
||||
`home_path` varchar(255) NOT NULL,
|
||||
`home_name` varchar(255) NOT NULL,
|
||||
`ip` varchar(255) NOT NULL,
|
||||
`port` varchar(5) NOT NULL,
|
||||
`qty` int(11) NOT NULL,
|
||||
`invoice_duration` varchar(16) NOT NULL,
|
||||
`max_players` int(11) NOT NULL,
|
||||
`remote_control_password` varchar(10) NULL,
|
||||
`ftp_password` varchar(10) NULL,
|
||||
`subtotal` float(15,2) NOT NULL,
|
||||
`rate` int(11) NOT NULL,
|
||||
`total` float(15,2) NOT NULL,
|
||||
`date` varchar(10) NULL,
|
||||
PRIMARY KEY (`order_id`)
|
||||
) ENGINE=MyISAM;"
|
||||
);
|
||||
|
||||
$install_queries[1] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_carts`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_carts` (
|
||||
`cart_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`paid` int(11) NULL,
|
||||
PRIMARY KEY (`cart_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=UTF8;",
|
||||
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_orders` (
|
||||
`order_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`service_id` int(11) NOT NULL,
|
||||
`home_path` varchar(255) NOT NULL,
|
||||
`home_name` varchar(255) NOT NULL,
|
||||
`ip` varchar(255) NOT NULL,
|
||||
`qty` int(11) NOT NULL,
|
||||
`invoice_duration` varchar(16) NOT NULL,
|
||||
`max_players` int(11) NOT NULL,
|
||||
`price` float(15,2) NOT NULL,
|
||||
`remote_control_password` varchar(10) NULL,
|
||||
`ftp_password` varchar(10) NULL,
|
||||
`paid` varchar(1) NULL,
|
||||
`date` varchar(10) NULL,
|
||||
`cart_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`order_id`)
|
||||
) ENGINE=MyISAM;"
|
||||
);
|
||||
|
||||
$install_queries[2] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `date`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `home_path`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `paid`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `home_id` varchar(255) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `status` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `date` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `tax_amount` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `currency` varchar(3) NOT NULL DEFAULT '0';"
|
||||
);
|
||||
|
||||
$install_queries[3] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `finish_date` varchar(16) NOT NULL DEFAULT '0';"
|
||||
);
|
||||
|
||||
$install_queries[4] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `extended` tinyint(1) NOT NULL;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_services` ADD `enabled` int(11) NOT NULL;"
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
$module_title = "Circular";
|
||||
$module_version = "1.0";
|
||||
$module_version = "0.1";
|
||||
$db_version = 0;
|
||||
$module_required = false;
|
||||
$module_menus = array(
|
||||
|
|
@ -33,7 +33,15 @@ $module_menus = array(
|
|||
'group' => 'admin',
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."circular`",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."circular` (
|
||||
`circular_id` int NOT NULL AUTO_INCREMENT,
|
||||
`subject` TEXT NOT NULL,
|
||||
`message` TEXT NOT NULL,
|
||||
`timestamp` TIMESTAMP,
|
||||
PRIMARY KEY (`circular_id`)
|
||||
);",
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."circular_recipients`",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."circular_recipients` (
|
||||
|
|
|
|||
|
|
@ -34,4 +34,29 @@ $module_menus = array(
|
|||
array( 'subpage' => '', 'name'=>'Game/Mod Config', 'group'=>'admin' )
|
||||
);
|
||||
|
||||
$install_queries = array();
|
||||
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."config_homes;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."config_homes` (
|
||||
`home_cfg_id` int(20) NOT NULL auto_increment,
|
||||
`game_key` varchar(64) NOT NULL,
|
||||
`game_name` varchar(255) NOT NULL,
|
||||
`home_cfg_file` varchar(64) NULL,
|
||||
PRIMARY KEY (`home_cfg_id`),
|
||||
UNIQUE KEY `game_key` (`game_key`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."config_mods;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."config_mods` (
|
||||
`mod_cfg_id` int(50) NOT NULL auto_increment,
|
||||
`home_cfg_id` varchar(50) NOT NULL,
|
||||
`mod_key` varchar(100) NOT NULL COMMENT 'mod short name - used by the game server for startup commands - ex cstrike',
|
||||
`mod_name` varchar(255) NOT NULL COMMENT 'Mod value is user defined string - like Counter-Strike',
|
||||
`def_precmd` TEXT,
|
||||
`def_postcmd` TEXT,
|
||||
PRIMARY KEY (`mod_cfg_id`),
|
||||
UNIQUE KEY `home_cfg_id` (`home_cfg_id`,`mod_key`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
|
||||
?>
|
||||
|
|
|
|||
166
modules/config_games/server_configs/7daystodie_linux64.bak
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
<game_config>
|
||||
<game_key>7daystodie_linux64</game_key>
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>7 Days to Die</game_name>
|
||||
<server_exec_name>7DaysToDieServer.x86_64</server_exec_name>
|
||||
<cli_template>-logfile output_log.txt -batchmode -nographics -dedicated -configfile=serverconfig.xml</cli_template>
|
||||
<console_log>output_log.txt</console_log>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<mods>
|
||||
<mod key="7daystodie1">
|
||||
<name>Stable</name>
|
||||
<installer_name>294420</installer_name>
|
||||
<installer_login>anonymous</installer_login>
|
||||
</mod>
|
||||
<mod key="7daystodie2">
|
||||
<name>Unstable build</name>
|
||||
<installer_name>294420</installer_name>
|
||||
<installer_login>anonymous</installer_login>
|
||||
<betaname>latest_experimental</betaname>
|
||||
</mod>
|
||||
</mods>
|
||||
<replace_texts>
|
||||
<text key="port">
|
||||
<default>property</default>
|
||||
<var>ServerPort</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
</text>
|
||||
<text key="home_name">
|
||||
<default>property</default>
|
||||
<var>ServerName</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
</text>
|
||||
<text key="max_players">
|
||||
<default>property</default>
|
||||
<var>ServerMaxPlayerCount</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
</text>
|
||||
<text key="control_password">
|
||||
<default>property</default>
|
||||
<var>ControlPanelPassword</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
</text>
|
||||
<text key="control_password">
|
||||
<default>property</default>
|
||||
<var>TelnetPassword</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
</text>
|
||||
<text key="home_path">
|
||||
<default>(.*)(property\s+name="SaveGameFolder"\s+value=")(.*)(")(.*>)(.*<.*>.*)</default>
|
||||
<var> <${2}%key%/Saves${4}/>${6}</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
</replace_texts>
|
||||
<custom_fields>
|
||||
<field key="Control Panel Enabled" type="select">
|
||||
<option value="false">False</option>
|
||||
<option value="true">True</option>
|
||||
<default>property</default>
|
||||
<default_value>false</default_value>
|
||||
<var>ControlPanelEnabled</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>Enable/Disable the web control panel.</desc>
|
||||
</field>
|
||||
<field key="Control Panel Port" type="text">
|
||||
<default>property</default>
|
||||
<default_value>8080</default_value>
|
||||
<var>ControlPanelPort</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<access>admin</access>
|
||||
<desc>Port of the control panel webpage.</desc>
|
||||
</field>
|
||||
<field key="Telnet Enabled" type="select">
|
||||
<option value="false">False</option>
|
||||
<option value="true">True</option>
|
||||
<default>property</default>
|
||||
<default_value>true</default_value>
|
||||
<var>TelnetEnabled</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>Enable/Disable the Telnet.</desc>
|
||||
</field>
|
||||
<field key="Telnet Port" type="text">
|
||||
<default>property</default>
|
||||
<default_value>8081</default_value>
|
||||
<var>TelnetPort</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<access>admin</access>
|
||||
<desc>Port of the Telnet server.</desc>
|
||||
</field>
|
||||
<field key="EAC Enabled" type="select">
|
||||
<option value="false">False</option>
|
||||
<option value="true">True</option>
|
||||
<default>property</default>
|
||||
<default_value>true</default_value>
|
||||
<var>EACEnabled</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>Enables/Disables EasyAntiCheat.</desc>
|
||||
</field>
|
||||
<field key="Game World" type="select">
|
||||
<option value="Navezgane">Navezgane</option>
|
||||
<option value="RWG">RWG</option>
|
||||
<default>property</default>
|
||||
<default_value>Navezgane</default_value>
|
||||
<var>GameWorld</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>Defines the map of the server.</desc>
|
||||
</field>
|
||||
<field key="WorldGen Seed" type="text">
|
||||
<default>property</default>
|
||||
<default_value>asdf</default_value>
|
||||
<var>WorldGenSeed</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>If RWG this is the seed for the generation of the new world. If a world with the resulting name already exists it will simply load it.</desc>
|
||||
</field>
|
||||
<field key="WorldGen Size" type="text">
|
||||
<default>property</default>
|
||||
<default_value>4096</default_value>
|
||||
<var>WorldGenSize</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>If RWG this controls the width and height of the created world. It is also used in combination with WorldGenSeed to create the internal RWG seed thus also creating a unique map name even if using the same WorldGenSeed. Has to be between 2048 and 16384, though large map sizes will take long to generate / download / load.</desc>
|
||||
</field>
|
||||
<field key="Game Name" type="text">
|
||||
<default>property</default>
|
||||
<default_value>My Game</default_value>
|
||||
<var>GameName</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>Whatever you want the game name to be. This affects the save game name as well as the seed used when placing decoration (trees etc) in the world. It does not control the generic layout of the world if creating an RWG world.</desc>
|
||||
</field>
|
||||
<field key="Max Spawned Zombies" type="text">
|
||||
<default>property</default>
|
||||
<default_value>60</default_value>
|
||||
<var>MaxSpawnedZombies</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<access>admin</access>
|
||||
<desc>Making this number too large (more than about 80) may cause servers to run at poor framerates which will effect lag and play quality for clients.</desc>
|
||||
</field>
|
||||
</custom_fields>
|
||||
<post_install>
|
||||
wget http://files.iaregamer.com/installers/7dtd/serverconfig.xml
|
||||
</post_install>
|
||||
<environment_variables>
|
||||
export LD_LIBRARY_PATH={OGP_HOME_DIR}/7DaysToDieServer_Data/Plugins/x86_64
|
||||
</environment_variables>
|
||||
<lock_files>
|
||||
7DaysToDieServer.x86
|
||||
</lock_files>
|
||||
<configuration_files>
|
||||
<file description="Server Configurations">serverconfig.xml</file>
|
||||
<file description="Admin Configurations">Saves/serveradmin.xml</file>
|
||||
</configuration_files>
|
||||
</game_config>
|
||||
26
modules/config_games/server_configs/arma2_linux.xml.bak
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<game_config>
|
||||
<game_key>arma2_linux</game_key>
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>Arma 2</game_name>
|
||||
<server_exec_name>server</server_exec_name><!-- arma2/arma2free -->
|
||||
<cli_template>netlog -maxMem=2047 -cpuCount=8 %PORT% %PLAYERS%</cli_template>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<control_protocol>armabe</control_protocol>
|
||||
<mods>
|
||||
<mod key='arma2'>
|
||||
<name>none</name>
|
||||
<installer_name>33900</installer_name>
|
||||
</mod>
|
||||
</mods>
|
||||
<server_params>
|
||||
</server_params>
|
||||
<post_install>
|
||||
wget http://files.iaregamer.com/installers/database/setup_db.sh
|
||||
chmod +x ./setup_db.sh
|
||||
./setup_db.sh
|
||||
rm setup_db.sh
|
||||
</post_install>
|
||||
|
||||
|
||||
|
||||
</game_config>
|
||||
33
modules/config_games/server_configs/arma2co_linux.xml.bak
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<game_config>
|
||||
<game_key>arma2co_linux</game_key>
|
||||
<game_name>Arma 2 Combined Operations</game_name>
|
||||
<server_exec_name>server</server_exec_name><!-- arma2arrowhead -->
|
||||
<cli_template>%PORT% %PLAYERS%</cli_template>
|
||||
<cli_params>
|
||||
<cli_param id="PORT" cli_string="-netlog -maxMem=2047 -cpuCount=8 -port=" />
|
||||
<cli_param id="PLAYERS" cli_string="-maxplayers=" />
|
||||
</cli_params>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<control_protocol>armabe</control_protocol>
|
||||
<mods>
|
||||
<mod key='arma2co'>
|
||||
<name>none</name>
|
||||
<installer_name>arma2co</installer_name>
|
||||
</mod>
|
||||
</mods>
|
||||
<server_params>
|
||||
<param key="-name=" type="select">
|
||||
<option value="public-no-mods -cfg=public-no-mods/arma2.cfg -config=public-no-mods/server.cfg">Public Server Without Mods</option>
|
||||
<option value="public-ace -cfg=public-ace/arma2.cfg -config=public-ace/server.cfg -mod=@ACE\;@CBA">Public Server ACE</option>
|
||||
<option value="public-ace-acre -cfg=public-ace-acre/arma2.cfg -config=public-ace-acre/server.cfg -mod=@ACE\;@ACRE\;@CBA">Public Server ACE+ACRE</option>
|
||||
<option value="public-official-mods -cfg=public-official-mods/arma2.cfg -config=public-official-mods/server.cfg -mod=@ACE\;@ACRE\;@CBA\;@CiaEagleIslas\;@CiaEagleMods\;@CiaEagleUnits">Public Server Official Mods</option>
|
||||
<option value="private-no-mods -cfg=private-no-mods/arma2.cfg -config=private-no-mods/server.cfg">Private Server Without Mods</option>
|
||||
<option value="private-ace -cfg=private-ace/arma2.cfg -config=private-ace/server.cfg -mod=@ACE\;@CBA">Private Server ACE</option>
|
||||
<option value="private-ace-acre -cfg=private-ace-acre/arma2.cfg -config=private-ace-acre/server.cfg -mod=@ACE\;@ACRE\;@CBA">Private Server ACE+ACRE</option>
|
||||
<option value="private-official-mods -cfg=private-official-mods/arma2.cfg -config=private-official-mods/server.cfg -mod=@ACE\;@ACRE\;@CBA\;@CiaEagleIslas\;@CiaEagleMods\;@CiaEagleUnits">Private Server Official Mods</option>
|
||||
<caption>Server Role</caption>
|
||||
<desc>Starts the server with the selected role.</desc>
|
||||
<options>ns</options>
|
||||
</param>
|
||||
</server_params>
|
||||
</game_config>
|
||||
75
modules/config_games/server_configs/arma2oa_linux.xml.bak
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<game_config>
|
||||
|
||||
<game_key>dayzmod_win32</game_key>
|
||||
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>Arma 2 Operation Arrowhead</game_name>
|
||||
<server_exec_name>server</server_exec_name><!-- arma2arrowhead -->
|
||||
<cli_template>%MODLIST% -cfg=cfg/basic.cfg -config=cfg/server.cfg -name=arma2oa -profiles=cfg %IP% %PORT%</cli_template>
|
||||
<cli_params>
|
||||
|
||||
<cli_param id="IP" cli_string="-ip=" />
|
||||
<cli_param id="PORT" cli_string="-port=" />
|
||||
<cli_param id="PLAYERS" cli_string="-maxplayers=" />
|
||||
</cli_params>
|
||||
<console_log>cfg/arma2oaserver.RPT</console_log>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<control_protocol>armabe</control_protocol>
|
||||
<mods>
|
||||
<mod key='arma2oa'>
|
||||
<name>arma2oa</name>
|
||||
<installer_name></installer_name>
|
||||
</mod>
|
||||
</mods>
|
||||
|
||||
|
||||
<replace_texts>
|
||||
<text key="max_players">
|
||||
<default>(maxPlayers\s*=\s*)(.*)(;)</default>
|
||||
<var>maxPlayers = "%key%";</var>
|
||||
<filepath>cfg/server.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
|
||||
<text key="port">
|
||||
<default>Port =.*</default>
|
||||
<var>Port = %key% </var>
|
||||
<filepath>bec/config/config.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
<text key="ip">
|
||||
<default>Ip =.*</default>
|
||||
<var>Ip = %key% </var>
|
||||
<filepath>bec/config/config.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
</replace_texts>
|
||||
|
||||
<server_params>
|
||||
<param id="MODLIST" key="-mod=" type="text">
|
||||
<default></default>
|
||||
<option>ns</option>
|
||||
<caption>Mods ex: @cba;</caption>
|
||||
<desc>Semicolon after each mod and you MUST copy the KEY into your keys folder.
|
||||
Make sure if you install a MOD, you list the name here or else it wont get loaded.
|
||||
</desc>
|
||||
</param>
|
||||
</server_params>
|
||||
|
||||
<post_install>
|
||||
wget files.iaregamer.com/installers/arma2oa/arma2oa_linux.tar.gz
|
||||
tar -xzvf arma2oa_linux.tar.gz
|
||||
rm arma2oa_linux.tar.gz
|
||||
|
||||
</post_install>
|
||||
<lock_files>
|
||||
server.exe
|
||||
</lock_files>
|
||||
|
||||
<configuration_files>
|
||||
<file description="Server settings">cfg/server.cfg</file>
|
||||
<file description="Basic Network settings" >cfg/basic.cfg</file>
|
||||
<file description="BattlEye Rcon Password" >cfg/battleye/beserver.cfg</file>
|
||||
</configuration_files>
|
||||
|
||||
</game_config>
|
||||
76
modules/config_games/server_configs/arma2oa_win32.xml.bak
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
<game_config>
|
||||
<game_key>arma2oa_win32</game_key>
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>Arma2 Operation Arrowhead</game_name>
|
||||
<server_exec_name>arma2oaserver.exe</server_exec_name>
|
||||
<cli_template>%MODLIST% -cfg=profile\basic.cfg -config=profile\server.cfg -name=player -profiles=profile %IP% %PORT%</cli_template>
|
||||
<cli_params>
|
||||
<cli_param id="PORT" cli_string="-port=" />
|
||||
<cli_param id="IP" cli_string="-ip=" />
|
||||
</cli_params>
|
||||
<reserve_ports>
|
||||
<port type="add" id="QUERY_PORT">1</port>
|
||||
</reserve_ports>
|
||||
<cli_allow_chars>;</cli_allow_chars>
|
||||
<console_log>profile/arma2oaserver.RPT</console_log>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<control_protocol>armabe</control_protocol>
|
||||
<mods>
|
||||
<mod key='arma2oa'>
|
||||
<name>none</name>
|
||||
<installer_name>33930</installer_name>
|
||||
</mod>
|
||||
</mods>
|
||||
<replace_texts>
|
||||
<text key="max_players">
|
||||
<default>(maxPlayers\s*=\s*)(.*)(;)</default>
|
||||
<var>maxPlayers = "%key%";</var>
|
||||
<filepath>cfg/server.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
</replace_texts>
|
||||
<server_params>
|
||||
<param id="MODLIST" key="-mod=" type="text">
|
||||
<default></default>
|
||||
<option>ns</option>
|
||||
<caption>Mods ex: @A-Map;@AI;@Moreguns;@TurboCars</caption>
|
||||
<desc>Semicolon after each mod and you MUST copy the KEY into your keys folder.
|
||||
Make sure if you install a MOD, you list the name here or else it wont get loaded.
|
||||
</desc>
|
||||
</param>
|
||||
</server_params>
|
||||
<post_install>
|
||||
wget http://files.iaregamer.com/installers/arma2oa_win/arma2oa.tar
|
||||
tar -xvf arma2oa.tar
|
||||
chmod +x setup_db.sh
|
||||
./setup_db.sh
|
||||
rm setup_db.sh
|
||||
rm arma2oa.tar
|
||||
|
||||
#wget -r -np -nH --cut-dirs=1 -R "index.html*" http://files.iaregamer.com/installers/bec_win64/
|
||||
#wget http://files.com/files/installers/arma2oa/mpmissions/thenewworldorder_wasteland.chernarus.zip
|
||||
#mv thenewworldorder_wasteland.chernarus.zip mpmissions/
|
||||
#cd mpmission
|
||||
#unzip thenewworldorder_wasteland.chernarus.zip
|
||||
#rm thenewworldorder_wasteland.chernarus.zip
|
||||
</post_install>
|
||||
<pre_start>
|
||||
#rm cfg/battleye/beserver_active*
|
||||
#rm cfg/*.RPT
|
||||
#rm cfg/*.log
|
||||
</pre_start>
|
||||
<lock_files>
|
||||
arma2oaserver.exe
|
||||
</lock_files>
|
||||
<configuration_files>
|
||||
<file description="Server settings">profile\server.cfg</file>
|
||||
<file description="Basic Network settings">profile\basic.cfg</file>
|
||||
<file description="BattlEye RconPassword">profile\battleye\beserver.cfg</file>
|
||||
<file description="Difficulty Settings">profile\users\player\player.arma2oaprofile</file>
|
||||
|
||||
<file description="BEC Scheduler">bec\config\scheduler.xml</file>
|
||||
<file description="BEC Admins">bec\config\admins.xml</file>
|
||||
<file description="BEC Whitelist">bec\config\whitelist.xml</file>
|
||||
<file description="BEC Message List">bec\config\fortune.txt</file>
|
||||
</configuration_files>
|
||||
</game_config>
|
||||
99
modules/config_games/server_configs/arma3_linux32.xml.bak
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
<game_config>
|
||||
<game_key>arma3_linux32</game_key>
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>Arma 3</game_name>
|
||||
<server_exec_name>arma3server</server_exec_name>
|
||||
<cli_template>%CONFIG% %CFG% %PROFILES% %NAME% %IP% %PORT% %PLAYERS% %MODLIST% %SERVERMODLIST% %AUTOINIT%</cli_template>
|
||||
<cli_params>
|
||||
<cli_param cli_string="-ip=" id="IP"/>
|
||||
<cli_param cli_string="-port=" id="PORT"/>
|
||||
<cli_param cli_string="-maxplayers=" id="PLAYERS"/>
|
||||
</cli_params>
|
||||
<cli_allow_chars>@</cli_allow_chars> <!-- escaped by default: \ " ' | & ; > < ` $ ( ) [ ] -->
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<control_protocol>rcon</control_protocol>
|
||||
<mods>
|
||||
<mod key='Arma3'>
|
||||
<name>none</name>
|
||||
<installer_name>233780</installer_name>
|
||||
</mod>
|
||||
</mods>
|
||||
<replace_texts>
|
||||
<text key="home_name">
|
||||
<default>(hostname\s*=\s*")(.*)(";)</default>
|
||||
<var>hostname = "%key%";</var>
|
||||
<filepath>profile/server.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
<text key="max_players">
|
||||
<default>(maxPlayers\s*=\s*)(.*)(;)</default>
|
||||
<var>maxPlayers = %key%;</var>
|
||||
<filepath>profile/server.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
<text key="control_password">
|
||||
<default>(passwordAdmin\s*=\s*")(.*)(";)</default>
|
||||
<var>passwordAdmin = "%key%";</var>
|
||||
<filepath>profile/server.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
<text key="control_password">
|
||||
<default>(RconPassword\s*=\s*")(.*)(";)</default>
|
||||
<var>RconPassword = "%key%";</var>
|
||||
<filepath>profile/beserver/beserver.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
</replace_texts>
|
||||
<server_params>
|
||||
<param id="CONFIG" key="-config=" type="text">
|
||||
<default>profile/server.cfg</default>
|
||||
<option>ns</option>
|
||||
<caption>Config file to load</caption>
|
||||
<desc>Selects the Server Config File. Config file for server specific settings like admin password and mission selection</desc>
|
||||
</param>
|
||||
<param id="CFG" key="-cfg=" type="text">
|
||||
<default>profile/basic.cfg</default>
|
||||
<option>ns</option>
|
||||
<caption>Arma Basic settings file to load</caption>
|
||||
<desc>Selects the Server Basic Config file. Config file for server specific settings like network performance tuning</desc>
|
||||
</param>
|
||||
<param id="NAME" key="-name=" type="text">
|
||||
<default>player</default>
|
||||
<option>ns</option>
|
||||
<caption>Name of User-Profile</caption>
|
||||
<desc> </desc>
|
||||
</param>
|
||||
<param id="MODLIST" key="-mod=" type="text">
|
||||
<option>ns</option>
|
||||
<caption>Mods ex: @A-Map;@AI;@Moreguns;@TurboCars</caption>
|
||||
<desc>Semicolon after each mod and you MUST copy the KEY into your keys folder. </desc>
|
||||
</param>
|
||||
<param id="SERVERMODLIST" key="-servermod=" type="text">
|
||||
<option>ns</option>
|
||||
<caption>SERVER SIDE Mods ex: @A-Map;@AI;@Moreguns;@TurboCars</caption>
|
||||
<desc>Semicolon after each mod. A SERVERMOD is a mod that is ONLY required on the server. Clients do not need to download this mod. If its a SERVERSIDE mod, it will probably tell you so. Otherwise assume its a MOD</desc>
|
||||
</param>
|
||||
<param key="-autoinit" type="checkbox_key_value" id="AUTOINIT">
|
||||
<caption>Automatically initialize mission just like first client does</caption>
|
||||
<desc>Server config file (server.cfg) must contain "Persistent=1;", if it's 0 autoInit skips</desc>
|
||||
</param>
|
||||
</server_params>
|
||||
<post_install>
|
||||
# wget http://files.iaregamer.com/installers/arma3linux/arma3linux.tar
|
||||
# tar -xvf arma3linux.tar
|
||||
# chmod +x setup_db.sh
|
||||
# ./setup_db.sh
|
||||
# rm setup_db.sh
|
||||
# rm arma3.tar
|
||||
</post_install>
|
||||
<pre_start>
|
||||
</pre_start>
|
||||
<lock_files>
|
||||
arma3server
|
||||
arma3server_x64
|
||||
</lock_files>
|
||||
<configuration_files>
|
||||
<file description="Server settings">profile/server.cfg</file>
|
||||
<file description="Basic Network settings">profile/basic.cfg</file>
|
||||
</configuration_files>
|
||||
</game_config>
|
||||
106
modules/config_games/server_configs/arma3_win32.xml.bak
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
<game_config>
|
||||
<game_key>arma3_win32</game_key>
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>Arma 3</game_name>
|
||||
<server_exec_name>arma3server.exe</server_exec_name>
|
||||
<cli_template>-profiles=profile -name=player -config=profile\server.cfg -cfg=profile\basic.cfg %PORT% %PLAYERS% %RANKING% %AUTOINIT% %DEBUG% %MODS% %SERVERMODS%</cli_template>
|
||||
<cli_params>
|
||||
<cli_param cli_string="-port=" id="PORT"/>
|
||||
<cli_param cli_string="-maxplayers=" id="PLAYERS"/>
|
||||
</cli_params>
|
||||
<cli_allow_chars>;</cli_allow_chars> <!-- escaped by default: \ " ' | & ; > < ` $ ( ) [ ] -->
|
||||
<console_log>profile/server_console.log</console_log>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<mods>
|
||||
<mod key='Arma3'>
|
||||
<name>none</name>
|
||||
<installer_name>233780</installer_name>
|
||||
</mod>
|
||||
</mods>
|
||||
<replace_texts>
|
||||
<text key="max_players">
|
||||
<default>(maxPlayers\s*=\s*)(.*)(;)</default>
|
||||
<var>maxPlayers = %key%;</var>
|
||||
<filepath>profile\server.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
<text key="home_name">
|
||||
<default>(hostname\s*=\s*")(.*)(";)</default>
|
||||
<var>hostname = "%key%";</var>
|
||||
<filepath>profile\server.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
<text key="control_password">
|
||||
<default>(passwordAdmin\s*=\s*")(.*)(";)</default>
|
||||
<var>passwordAdmin = "%key%";</var>
|
||||
<filepath>profile\server.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
<text key="ip">
|
||||
<default>Ip =.*</default>
|
||||
<var>Ip = %key% </var>
|
||||
<filepath>bec/config/config.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
<text key="home_path">
|
||||
<default>BePath =.*</default>
|
||||
<var>BePath = %key%\profile\Battleye</var>
|
||||
<filepath>bec\config\config.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
</replace_texts>
|
||||
<server_params>
|
||||
<param id="DEBUG" key="-debug" type="checkbox_key_value">
|
||||
<caption>Extra logging info in RPT</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
<param id="AUTOINIT" key="-autoInit" type="checkbox_key_value">
|
||||
<caption>Start mission when server starts</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
<param id="RANKING" key="-ranking=" type="text">
|
||||
<option>q</option>
|
||||
<caption>Filename to save RANKING</caption>
|
||||
<desc>such as ranking.txt</desc>
|
||||
</param>
|
||||
<param id="MODS" key="-mod=" type="text">
|
||||
<option>q</option>
|
||||
<caption>Mods ex: @A-Map;@AI;@Moreguns;@TurboCars</caption>
|
||||
<desc>Semicolon after each mod and you MUST copy the KEY into your keys folder</desc>
|
||||
</param>
|
||||
<param id="SERVERMODS" key="-serverMod=" type="text">
|
||||
<option>q</option>
|
||||
<caption>Server Side ONLY Mods ex: @mod1;@mod2;</caption>
|
||||
<desc>Semicolon after each mod</desc>
|
||||
</param>
|
||||
<param id="MEMORY" key="-maxMem=" type="text">
|
||||
<option>ns</option>
|
||||
<default>1024</default>
|
||||
<caption>Max RAM allocated</caption>
|
||||
<desc>Maximum usable memory in MB, for example: 1024</desc>
|
||||
</param>
|
||||
</server_params>
|
||||
<post_install>
|
||||
wget http://files.iaregamer.com/installers/arma3/arma3.tar
|
||||
tar -xvf arma3.tar
|
||||
chmod +x setup_db.sh
|
||||
./setup_db.sh
|
||||
rm setup_db.sh
|
||||
rm arma3.tar
|
||||
</post_install>
|
||||
<pre_start>
|
||||
</pre_start>
|
||||
<lock_files>
|
||||
Arma3Server.exe
|
||||
Arma3Server_x64.exe
|
||||
</lock_files>
|
||||
<configuration_files>
|
||||
<file description="Server settings">profile\server.cfg</file>
|
||||
<file description="Basic Network settings" >profile\basic.cfg</file>
|
||||
<file description="Difficulty Settings">profile\users\player\player.arma3profile</file>
|
||||
<file description="BEC Scheduler">bec\config\scheduler.xml</file>
|
||||
<file description="BEC Admins">bec\config\admins.xml</file>
|
||||
<file description="BEC Whitelist">bec\config\whitelist.xml</file>
|
||||
<file description="BEC Config">bec\config\config.cfg</file>
|
||||
</configuration_files>
|
||||
</game_config>
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
<game_config>
|
||||
<game_key>7daystodie_linux64</game_key>
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>7 Days to Die</game_name>
|
||||
<server_exec_name>7DaysToDieServer.x86_64</server_exec_name>
|
||||
<cli_template>-logfile output_log.txt -batchmode -nographics -dedicated -configfile=serverconfig.xml</cli_template>
|
||||
<console_log>output_log.txt</console_log>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<mods>
|
||||
<mod key="7daystodie1">
|
||||
<name>Stable</name>
|
||||
<installer_name>294420</installer_name>
|
||||
<installer_login>anonymous</installer_login>
|
||||
</mod>
|
||||
<mod key="7daystodie2">
|
||||
<name>Unstable build</name>
|
||||
<installer_name>294420</installer_name>
|
||||
<installer_login>anonymous</installer_login>
|
||||
<betaname>latest_experimental</betaname>
|
||||
</mod>
|
||||
</mods>
|
||||
<replace_texts>
|
||||
<text key="port">
|
||||
<default>property</default>
|
||||
<var>ServerPort</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
</text>
|
||||
<text key="home_name">
|
||||
<default>property</default>
|
||||
<var>ServerName</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
</text>
|
||||
<text key="max_players">
|
||||
<default>property</default>
|
||||
<var>ServerMaxPlayerCount</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
</text>
|
||||
<text key="control_password">
|
||||
<default>property</default>
|
||||
<var>ControlPanelPassword</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
</text>
|
||||
<text key="control_password">
|
||||
<default>property</default>
|
||||
<var>TelnetPassword</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
</text>
|
||||
<text key="home_path">
|
||||
<default>(.*)(property\s+name="SaveGameFolder"\s+value=")(.*)(")(.*>)(.*<.*>.*)</default>
|
||||
<var> <${2}%key%/Saves${4}/>${6}</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
</replace_texts>
|
||||
<custom_fields>
|
||||
<field key="Control Panel Enabled" type="select">
|
||||
<option value="false">False</option>
|
||||
<option value="true">True</option>
|
||||
<default>property</default>
|
||||
<default_value>false</default_value>
|
||||
<var>ControlPanelEnabled</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>Enable/Disable the web control panel.</desc>
|
||||
</field>
|
||||
<field key="Control Panel Port" type="text">
|
||||
<default>property</default>
|
||||
<default_value>8080</default_value>
|
||||
<var>ControlPanelPort</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<access>admin</access>
|
||||
<desc>Port of the control panel webpage.</desc>
|
||||
</field>
|
||||
<field key="Telnet Enabled" type="select">
|
||||
<option value="false">False</option>
|
||||
<option value="true">True</option>
|
||||
<default>property</default>
|
||||
<default_value>true</default_value>
|
||||
<var>TelnetEnabled</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>Enable/Disable the Telnet.</desc>
|
||||
</field>
|
||||
<field key="Telnet Port" type="text">
|
||||
<default>property</default>
|
||||
<default_value>8081</default_value>
|
||||
<var>TelnetPort</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<access>admin</access>
|
||||
<desc>Port of the Telnet server.</desc>
|
||||
</field>
|
||||
<field key="EAC Enabled" type="select">
|
||||
<option value="false">False</option>
|
||||
<option value="true">True</option>
|
||||
<default>property</default>
|
||||
<default_value>true</default_value>
|
||||
<var>EACEnabled</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>Enables/Disables EasyAntiCheat.</desc>
|
||||
</field>
|
||||
<field key="Game World" type="select">
|
||||
<option value="Navezgane">Navezgane</option>
|
||||
<option value="RWG">RWG</option>
|
||||
<default>property</default>
|
||||
<default_value>Navezgane</default_value>
|
||||
<var>GameWorld</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>Defines the map of the server.</desc>
|
||||
</field>
|
||||
<field key="WorldGen Seed" type="text">
|
||||
<default>property</default>
|
||||
<default_value>asdf</default_value>
|
||||
<var>WorldGenSeed</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>If RWG this is the seed for the generation of the new world. If a world with the resulting name already exists it will simply load it.</desc>
|
||||
</field>
|
||||
<field key="WorldGen Size" type="text">
|
||||
<default>property</default>
|
||||
<default_value>4096</default_value>
|
||||
<var>WorldGenSize</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>If RWG this controls the width and height of the created world. It is also used in combination with WorldGenSeed to create the internal RWG seed thus also creating a unique map name even if using the same WorldGenSeed. Has to be between 2048 and 16384, though large map sizes will take long to generate / download / load.</desc>
|
||||
</field>
|
||||
<field key="Game Name" type="text">
|
||||
<default>property</default>
|
||||
<default_value>My Game</default_value>
|
||||
<var>GameName</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<desc>Whatever you want the game name to be. This affects the save game name as well as the seed used when placing decoration (trees etc) in the world. It does not control the generic layout of the world if creating an RWG world.</desc>
|
||||
</field>
|
||||
<field key="Max Spawned Zombies" type="text">
|
||||
<default>property</default>
|
||||
<default_value>60</default_value>
|
||||
<var>MaxSpawnedZombies</var>
|
||||
<filepath>serverconfig.xml</filepath>
|
||||
<options>tagValueByName</options>
|
||||
<access>admin</access>
|
||||
<desc>Making this number too large (more than about 80) may cause servers to run at poor framerates which will effect lag and play quality for clients.</desc>
|
||||
</field>
|
||||
</custom_fields>
|
||||
<post_install>
|
||||
wget http://files.iaregamer.com/installers/7dtd/serverconfig.xml
|
||||
</post_install>
|
||||
<environment_variables>
|
||||
export LD_LIBRARY_PATH={OGP_HOME_DIR}/7DaysToDieServer_Data/Plugins/x86_64
|
||||
</environment_variables>
|
||||
<lock_files>
|
||||
7DaysToDieServer.x86
|
||||
</lock_files>
|
||||
<configuration_files>
|
||||
<file description="Server Configurations">serverconfig.xml</file>
|
||||
<file description="Admin Configurations">Saves/serveradmin.xml</file>
|
||||
</configuration_files>
|
||||
</game_config>
|
||||
128
modules/config_games/server_configs/backup/harsh_win64.BAK
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
<game_config>
|
||||
<game_key>harsh_win64</game_key>
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>Operation Harsh Doorstop</game_name>
|
||||
<server_exec_name>HarshDoorstopServer-Win64-Shipping.exe</server_exec_name>
|
||||
|
||||
|
||||
<query_port type="add">1</query_port>
|
||||
<cli_template>%MAP%?%GAMEMODE%?%bBotAutofill%%BLUFORFACTION%?%OPFORFACTION%?%BLUFORNUMBOTS%?%OPFORNUMBOTS%?%BLUFORTICKETS%?%OPFORTICKETS%?%bDisableKitRestrictions% %IP% %PORT% %QUERY_PORT% %SERVERNAME%</cli_template>
|
||||
<cli_params>
|
||||
<cli_param id="IP" cli_string="-ip=" />
|
||||
<cli_param id="PORT" cli_string="-port=" />
|
||||
<cli_param id="MAP" cli_string="" />
|
||||
<cli_param id="PLAYERS" cli_string="Maxplayers=" options="s" />
|
||||
</cli_params>
|
||||
<reserve_ports>
|
||||
<port type="add" id="RCON_PORT" cli_string="-RCONport=">2</port>
|
||||
<port type="add" id="QUERY_PORT" cli_string="-QueryPort=">3</port>
|
||||
</reserve_ports>
|
||||
<cli_allow_chars>@;[]-_.</cli_allow_chars>
|
||||
|
||||
<map_list>Maplist.txt</map_list>
|
||||
<console_log>HarshDoorstop\Saved\Logs\HarshDoorstop.log</console_log>
|
||||
|
||||
<exe_location>HarshDoorStop\Binaries\Win64\</exe_location>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<control_protocol>armabe</control_protocol>
|
||||
<mods>
|
||||
<mod key="default">
|
||||
<name>None</name>
|
||||
<installer_name>950900</installer_name>
|
||||
<installer_login>anonymous</installer_login>
|
||||
</mod>
|
||||
</mods>
|
||||
|
||||
<server_params>
|
||||
<param id="MINPLAYERS" key="MinPlayers=" type="text">
|
||||
<option>ns</option>
|
||||
<default>4</default>
|
||||
<caption>Mininum Player Count</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
<param id="GAMEMODE" key="game=" type="text">
|
||||
<option>ns</option>
|
||||
<caption>Path to game mode</caption>
|
||||
</param>
|
||||
<param key="bBotAutofill?" type="checkbox_key_value" id="bBotAutofill">
|
||||
<desc>Fill all empty player slots with bots</desc>
|
||||
</param>
|
||||
|
||||
<param id="BLUFORFACTION" key="BluforFaction=" type="text">
|
||||
<option>ns</option>
|
||||
<default>Default</default>
|
||||
<caption>Which faction for BluFor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
|
||||
<param id="OPFORFACTION" key="OpforFaction=" type="text">
|
||||
<option>ns</option>
|
||||
<default>Default</default>
|
||||
<caption>Which faction for OpFor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
|
||||
<param id="BLUFORNUMBOTS" key="BluforNumBots=" type="text">
|
||||
<option>ns</option>
|
||||
<default>0</default>
|
||||
<caption>How many bots on Opfor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
|
||||
<param id="OPFORNUMBOTS" key="OpforNumBots=" type="text">
|
||||
<option>ns</option>
|
||||
<default>0</default>
|
||||
<caption>How many bots on Opfor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
<param id="BLUFORTICKETS" key="BluforTickets=" type="text">
|
||||
<option>ns</option>
|
||||
<default>500</default>
|
||||
<caption>How many tickets on Blufor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
|
||||
<param id="OPFORTICKETS" key="OpforTickets=" type="text">
|
||||
<option>ns</option>
|
||||
<default>500</default>
|
||||
<caption>How many tickets on Opfor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
|
||||
<param key="bDisableKitRestrictions?" type="checkbox_key_value" id="bDisableKitRestrictions">
|
||||
<desc>Allow all Kits</desc>
|
||||
</param>
|
||||
|
||||
<param id="SERVERNAME" key="-ServerName=" type="text">
|
||||
<option>q</option>
|
||||
<default>BlackMarket Server</default>
|
||||
<caption>Server name</caption>
|
||||
<desc>Shown in server browser</desc>
|
||||
</param>
|
||||
</server_params>
|
||||
|
||||
|
||||
|
||||
<post_install>
|
||||
echo "Argonne" >> Maplist.txt
|
||||
echo "Monte Cassino" >> Maplist.txt
|
||||
echo "Lam Dong" >> Maplist.txt
|
||||
echo "Khafji" >> Maplist.txt
|
||||
echo "Risala" >> Maplist.txt
|
||||
</post_install>
|
||||
<pre_start>
|
||||
</pre_start>
|
||||
|
||||
<lock_files>
|
||||
HarshDoorstopServer-Win64-Shipping.exe
|
||||
</lock_files>
|
||||
|
||||
<configuration_files>
|
||||
<file description="Maplist.txt">Maplist.txt</file>
|
||||
<file description="Game.ini">HarshDoorstop\Saved\Config\WindowsServer\Game.ini</file>
|
||||
<file description="Engine.ini" >HarshDoorstop\Saved\Config\WindowsServer\Engine.ini</file>
|
||||
<file description="Engine.ini" >HarshDoorstop\Saved\Config\WindowsServer\Admins.cfg</file>
|
||||
<file description="Mapcycle.cfg" >HarshDoorstop\Saved\Config\WindowsServer\Mapcycle.cfg</file>
|
||||
|
||||
</configuration_files>
|
||||
</game_config>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<game_config>
|
||||
<game_key>harsh_win64</game_key>
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>Operation Harsh Doorstep</game_name>
|
||||
<server_exec_name>HarshDoorstop\Binaries\Win64\HarshDoorstopServer-Win64-Shipping.exe</server_exec_name>
|
||||
<query_port type="add">1</query_port>
|
||||
<cli_template>%SERVERNAME% %PASSWORD%</cli_template>
|
||||
<cli_params>
|
||||
<cli_param id="IP" cli_string="-ip=" />
|
||||
<cli_param id="PORT" cli_string="-port=" />
|
||||
</cli_params>
|
||||
<reserve_ports>
|
||||
<port type="add" id="STEAM_PORT" cli_string="-STEAMport=">1</port>
|
||||
<port type="add" id="RCON_PORT" cli_string="-RCONport=">2</port>
|
||||
<port type="add" id="RCON_PORT" cli_string="-RCONport=">3</port>
|
||||
</reserve_ports>
|
||||
<cli_allow_chars>@;[]-_.</cli_allow_chars>
|
||||
|
||||
<console_log>harsh.log</console_log>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<control_protocol>armabe</control_protocol>
|
||||
<mods>
|
||||
<mod key="default">
|
||||
<name>None</name>
|
||||
<installer_name>950900</installer_name>
|
||||
<installer_login>anonymous</installer_login>
|
||||
</mod>
|
||||
</mods>
|
||||
<replace_texts>
|
||||
|
||||
<text key="query_port">
|
||||
<default>(steamQueryPort\s*=\s*)(.*)(;)</default>
|
||||
<var>steamQueryPort = %key%;</var>
|
||||
<filepath>serverDZ.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
<text key="max_players">
|
||||
<default>(maxPlayers\s*=\s*)(.*)(;)</default>
|
||||
<var>maxPlayers = %key%;</var>
|
||||
<filepath>serverDZ.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
|
||||
|
||||
</replace_texts>
|
||||
<server_params>
|
||||
<param id="SERVERNAME" key="-ServerName=" type="text">
|
||||
<default>My Server</default>
|
||||
<option>q</option>
|
||||
<caption>Server Name</caption>
|
||||
<desc>Shown in server browser</desc>
|
||||
</param>
|
||||
|
||||
<param id="PASSWORD" key="-password=" type="text">
|
||||
<option>q</option>
|
||||
<caption>Server Password</caption>
|
||||
<desc>Required to join server</desc>
|
||||
</param>
|
||||
|
||||
</server_params>
|
||||
<post_install>
|
||||
</post_install>
|
||||
<pre_start>
|
||||
</pre_start>
|
||||
|
||||
<lock_files>
|
||||
DayZServer_x64.exe
|
||||
</lock_files>
|
||||
|
||||
<configuration_files>
|
||||
<file description="Game.ini">\HarshDoorstop\Saved\Config\WindowsServer\game.ini</file>
|
||||
<file description="Engine.ini" >\HarshDoorstop\Saved\Config\WindowsServer\engine.ini</file>
|
||||
<file description="Mapcycle.cfg" >\HarshDoorstop\Saved\Config\WindowsServer\mapcycle.cfg</file>
|
||||
<file description="Admins.cfg" >\HarshDoorstop\Saved\Config\WindowsServer\admins.cfg</file>
|
||||
|
||||
</configuration_files>
|
||||
</game_config>
|
||||
128
modules/config_games/server_configs/harsh_win64.BAK
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
<game_config>
|
||||
<game_key>harsh_win64</game_key>
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>Operation Harsh Doorstop</game_name>
|
||||
<server_exec_name>HarshDoorstopServer-Win64-Shipping.exe</server_exec_name>
|
||||
|
||||
|
||||
<query_port type="add">1</query_port>
|
||||
<cli_template>%MAP%?%GAMEMODE%?%bBotAutofill%%BLUFORFACTION%?%OPFORFACTION%?%BLUFORNUMBOTS%?%OPFORNUMBOTS%?%BLUFORTICKETS%?%OPFORTICKETS%?%bDisableKitRestrictions% %IP% %PORT% %QUERY_PORT% %SERVERNAME%</cli_template>
|
||||
<cli_params>
|
||||
<cli_param id="IP" cli_string="-ip=" />
|
||||
<cli_param id="PORT" cli_string="-port=" />
|
||||
<cli_param id="MAP" cli_string="" />
|
||||
<cli_param id="PLAYERS" cli_string="Maxplayers=" options="s" />
|
||||
</cli_params>
|
||||
<reserve_ports>
|
||||
<port type="add" id="RCON_PORT" cli_string="-RCONport=">2</port>
|
||||
<port type="add" id="QUERY_PORT" cli_string="-QueryPort=">3</port>
|
||||
</reserve_ports>
|
||||
<cli_allow_chars>@;[]-_.</cli_allow_chars>
|
||||
|
||||
<map_list>Maplist.txt</map_list>
|
||||
<console_log>HarshDoorstop\Saved\Logs\HarshDoorstop.log</console_log>
|
||||
|
||||
<exe_location>HarshDoorStop\Binaries\Win64\</exe_location>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<control_protocol>armabe</control_protocol>
|
||||
<mods>
|
||||
<mod key="default">
|
||||
<name>None</name>
|
||||
<installer_name>950900</installer_name>
|
||||
<installer_login>anonymous</installer_login>
|
||||
</mod>
|
||||
</mods>
|
||||
|
||||
<server_params>
|
||||
<param id="MINPLAYERS" key="MinPlayers=" type="text">
|
||||
<option>ns</option>
|
||||
<default>4</default>
|
||||
<caption>Mininum Player Count</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
<param id="GAMEMODE" key="game=" type="text">
|
||||
<option>ns</option>
|
||||
<caption>Path to game mode</caption>
|
||||
</param>
|
||||
<param key="bBotAutofill?" type="checkbox_key_value" id="bBotAutofill">
|
||||
<desc>Fill all empty player slots with bots</desc>
|
||||
</param>
|
||||
|
||||
<param id="BLUFORFACTION" key="BluforFaction=" type="text">
|
||||
<option>ns</option>
|
||||
<default>Default</default>
|
||||
<caption>Which faction for BluFor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
|
||||
<param id="OPFORFACTION" key="OpforFaction=" type="text">
|
||||
<option>ns</option>
|
||||
<default>Default</default>
|
||||
<caption>Which faction for OpFor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
|
||||
<param id="BLUFORNUMBOTS" key="BluforNumBots=" type="text">
|
||||
<option>ns</option>
|
||||
<default>0</default>
|
||||
<caption>How many bots on Opfor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
|
||||
<param id="OPFORNUMBOTS" key="OpforNumBots=" type="text">
|
||||
<option>ns</option>
|
||||
<default>0</default>
|
||||
<caption>How many bots on Opfor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
<param id="BLUFORTICKETS" key="BluforTickets=" type="text">
|
||||
<option>ns</option>
|
||||
<default>500</default>
|
||||
<caption>How many tickets on Blufor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
|
||||
<param id="OPFORTICKETS" key="OpforTickets=" type="text">
|
||||
<option>ns</option>
|
||||
<default>500</default>
|
||||
<caption>How many tickets on Opfor</caption>
|
||||
<desc></desc>
|
||||
</param>
|
||||
|
||||
<param key="bDisableKitRestrictions?" type="checkbox_key_value" id="bDisableKitRestrictions">
|
||||
<desc>Allow all Kits</desc>
|
||||
</param>
|
||||
|
||||
<param id="SERVERNAME" key="-ServerName=" type="text">
|
||||
<option>q</option>
|
||||
<default>BlackMarket Server</default>
|
||||
<caption>Server name</caption>
|
||||
<desc>Shown in server browser</desc>
|
||||
</param>
|
||||
</server_params>
|
||||
|
||||
|
||||
|
||||
<post_install>
|
||||
echo "Argonne" >> Maplist.txt
|
||||
echo "Monte Cassino" >> Maplist.txt
|
||||
echo "Lam Dong" >> Maplist.txt
|
||||
echo "Khafji" >> Maplist.txt
|
||||
echo "Risala" >> Maplist.txt
|
||||
</post_install>
|
||||
<pre_start>
|
||||
</pre_start>
|
||||
|
||||
<lock_files>
|
||||
HarshDoorstopServer-Win64-Shipping.exe
|
||||
</lock_files>
|
||||
|
||||
<configuration_files>
|
||||
<file description="Maplist.txt">Maplist.txt</file>
|
||||
<file description="Game.ini">HarshDoorstop\Saved\Config\WindowsServer\Game.ini</file>
|
||||
<file description="Engine.ini" >HarshDoorstop\Saved\Config\WindowsServer\Engine.ini</file>
|
||||
<file description="Engine.ini" >HarshDoorstop\Saved\Config\WindowsServer\Admins.cfg</file>
|
||||
<file description="Mapcycle.cfg" >HarshDoorstop\Saved\Config\WindowsServer\Mapcycle.cfg</file>
|
||||
|
||||
</configuration_files>
|
||||
</game_config>
|
||||
77
modules/config_games/server_configs/harsh_win64.xml.bak
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<game_config>
|
||||
<game_key>harsh_win64</game_key>
|
||||
<installer>steamcmd</installer>
|
||||
<game_name>Operation Harsh Doorstep</game_name>
|
||||
<server_exec_name>HarshDoorstop\Binaries\Win64\HarshDoorstopServer-Win64-Shipping.exe</server_exec_name>
|
||||
<query_port type="add">1</query_port>
|
||||
<cli_template>%SERVERNAME% %PASSWORD%</cli_template>
|
||||
<cli_params>
|
||||
<cli_param id="IP" cli_string="-ip=" />
|
||||
<cli_param id="PORT" cli_string="-port=" />
|
||||
</cli_params>
|
||||
<reserve_ports>
|
||||
<port type="add" id="STEAM_PORT" cli_string="-STEAMport=">1</port>
|
||||
<port type="add" id="RCON_PORT" cli_string="-RCONport=">2</port>
|
||||
<port type="add" id="RCON_PORT" cli_string="-RCONport=">3</port>
|
||||
</reserve_ports>
|
||||
<cli_allow_chars>@;[]-_.</cli_allow_chars>
|
||||
|
||||
<console_log>harsh.log</console_log>
|
||||
<max_user_amount>64</max_user_amount>
|
||||
<control_protocol>armabe</control_protocol>
|
||||
<mods>
|
||||
<mod key="default">
|
||||
<name>None</name>
|
||||
<installer_name>950900</installer_name>
|
||||
<installer_login>anonymous</installer_login>
|
||||
</mod>
|
||||
</mods>
|
||||
<replace_texts>
|
||||
|
||||
<text key="query_port">
|
||||
<default>(steamQueryPort\s*=\s*)(.*)(;)</default>
|
||||
<var>steamQueryPort = %key%;</var>
|
||||
<filepath>serverDZ.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
<text key="max_players">
|
||||
<default>(maxPlayers\s*=\s*)(.*)(;)</default>
|
||||
<var>maxPlayers = %key%;</var>
|
||||
<filepath>serverDZ.cfg</filepath>
|
||||
<options>key-regex</options>
|
||||
</text>
|
||||
|
||||
|
||||
</replace_texts>
|
||||
<server_params>
|
||||
<param id="SERVERNAME" key="-ServerName=" type="text">
|
||||
<default>My Server</default>
|
||||
<option>q</option>
|
||||
<caption>Server Name</caption>
|
||||
<desc>Shown in server browser</desc>
|
||||
</param>
|
||||
|
||||
<param id="PASSWORD" key="-password=" type="text">
|
||||
<option>q</option>
|
||||
<caption>Server Password</caption>
|
||||
<desc>Required to join server</desc>
|
||||
</param>
|
||||
|
||||
</server_params>
|
||||
<post_install>
|
||||
</post_install>
|
||||
<pre_start>
|
||||
</pre_start>
|
||||
|
||||
<lock_files>
|
||||
DayZServer_x64.exe
|
||||
</lock_files>
|
||||
|
||||
<configuration_files>
|
||||
<file description="Game.ini">\HarshDoorstop\Saved\Config\WindowsServer\game.ini</file>
|
||||
<file description="Engine.ini" >\HarshDoorstop\Saved\Config\WindowsServer\engine.ini</file>
|
||||
<file description="Mapcycle.cfg" >\HarshDoorstop\Saved\Config\WindowsServer\mapcycle.cfg</file>
|
||||
<file description="Admins.cfg" >\HarshDoorstop\Saved\Config\WindowsServer\admins.cfg</file>
|
||||
|
||||
</configuration_files>
|
||||
</game_config>
|
||||
355
modules/dashboard/dashboard.bak
Normal file
|
|
@ -0,0 +1,355 @@
|
|||
<script type="text/javascript" src="js/jquery/plugins/jquery.json-2.3.min.js"></script>
|
||||
<script type="text/javascript" src="js/modules/dashboard.js"></script>
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
require('includes/lib_remote.php');
|
||||
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db, $settings, $loggedInUserInfo;
|
||||
|
||||
$isAdmin = $db->isAdmin($_SESSION['user_id']);
|
||||
$user_id = $_SESSION['user_id'];
|
||||
|
||||
$page_user = (isset($_GET['page']) && (int)$_GET['page'] > 0) ? (int)$_GET['page'] : 1; // thanks for Adjokip
|
||||
$limit_user = isset($_GET['limit']) ? $_GET['limit'] : 10;
|
||||
|
||||
if(hasValue($loggedInUserInfo) && is_array($loggedInUserInfo) && $loggedInUserInfo["users_page_limit"] && !(isset($_GET['limit']) and !empty($_GET['limit']))){
|
||||
$limit_user = $loggedInUserInfo["users_page_limit"];
|
||||
}
|
||||
|
||||
$OnlineServers = "";
|
||||
$OnlineServersTitle = "";
|
||||
$query = "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$user_id."' and end_date = -1";
|
||||
$result = $db->resultQuery($query);
|
||||
$invoicesDue=0;
|
||||
foreach($result as $res){
|
||||
$invoicesDue=$invoicesDue + 1;
|
||||
}
|
||||
|
||||
if( isset($settings['welcome_title']) && $settings['welcome_title'] == "1" )
|
||||
{
|
||||
if( isset($settings['welcome_title_message']) && !empty($settings['welcome_title_message'] ))
|
||||
{
|
||||
echo "<div>" . $settings['welcome_title_message'] . "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
$OnlineServersTitle .= get_lang('online_servers');
|
||||
$player_list = "";
|
||||
|
||||
$server_homes = $db->getIpPortsForUser_limit($_SESSION['user_id'], $page_user, $limit_user);
|
||||
|
||||
require_once("includes/refreshed.php");
|
||||
$refresh = new refreshed();
|
||||
|
||||
if ( !$server_homes )
|
||||
{
|
||||
$OnlineServers .= "<p class='failure'>".get_lang('no_games_to_monitor')."</p>";
|
||||
if ( $isAdmin )
|
||||
$OnlineServers .= "<p class='note'>".get_lang_f("add_games_in","<a href='?m=user_games&p=add'>".get_lang('game_servers')."</a>")."</p>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$player_list = "";
|
||||
$stats_servers = 0;
|
||||
$stats_servers_online = 0;
|
||||
if(isset($settings['old_dashboard_behavior']) and $settings['old_dashboard_behavior'] == 1)
|
||||
{
|
||||
$_SESSION['player_statistics']['players'] = 0;
|
||||
$_SESSION['player_statistics']['playersmax'] = 0;
|
||||
$OnlineServers .= "<table style='width:100%;' class='online_servers' id='ref'>";
|
||||
foreach( $server_homes as $server_home )
|
||||
{
|
||||
// Count the number of servers.
|
||||
$stats_servers++;
|
||||
$remote = new OGPRemoteLibrary( $server_home['agent_ip'], $server_home['agent_port'],
|
||||
$server_home['encryption_key'], $server_home['timeout'] );
|
||||
// Check if the screen running the server is running.
|
||||
if( $remote->is_screen_running(OGP_SCREEN_TYPE_HOME,$server_home['home_id']) === 1 )
|
||||
{
|
||||
$stats_servers_online++;
|
||||
$server_key = 'server_'.$server_home['ip'].'_'.$server_home['port'];
|
||||
$_SESSION[$server_key] = $server_home;
|
||||
if( isset($_SESSION[$server_key]['server_playersmax']) )
|
||||
unset($_SESSION[$server_key]['server_players'],
|
||||
$_SESSION[$server_key]['server_playersmax']);
|
||||
$OnlineServers .= '<tr><td>'.$refresh->getdiv($refresh->add("home.php?m=dashboard&p=query_ref&type=cleared&ip=".$server_home['ip']."&port=".$server_home['port']),'width:100%;').'</td></tr>';
|
||||
$player_list .= $refresh->getdiv($refresh->add("home.php?m=dashboard&p=query_ref&show=players&type=cleared&ip=".$server_home['ip']."&port=".$server_home['port']));
|
||||
}
|
||||
}
|
||||
|
||||
$OnlineServers .= "</table><br>";
|
||||
|
||||
if ($isAdmin) {
|
||||
$count_homes = $db->getIpPorts_count('admin',$_SESSION['user_id']);
|
||||
} else {
|
||||
$isSubUser = $db->isSubUser($_SESSION['user_id']);
|
||||
|
||||
if ($isSubUser) {
|
||||
$count_homes = $db->getIpPorts_count('subuser',$_SESSION['user_id']);
|
||||
} else {
|
||||
$count_homes = $db->getIpPorts_count('user_and_group',$_SESSION['user_id']);
|
||||
}
|
||||
}
|
||||
|
||||
$uri = '?m=dashboard&p=dashboard&limit='.$limit_user.'&page=';
|
||||
$OnlineServers .= paginationPages($count_homes[0]['total'], $page_user, $limit_user, $uri, 3, 'dashboardHomes');
|
||||
|
||||
$OnlineServers .= "<center>" . statistics . ":<br>$stats_servers_online/$stats_servers " . servers . "<br>" .
|
||||
$refresh->getdiv($refresh->add("home.php?m=dashboard&p=query_ref&show=player_statistics&type=cleared&ip=" .
|
||||
$server_home['ip']."&port=".$server_home['port'])) . "</center>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$OnlineServers .= "<table style='width:100%;' class='online_servers' id='noref'>";
|
||||
require("protocol/lgsl/lgsl_protocol.php");
|
||||
foreach( $server_homes as $server_home )
|
||||
{
|
||||
// Count the number of servers.
|
||||
$stats_servers++;
|
||||
$remote = new OGPRemoteLibrary( $server_home['agent_ip'],$server_home['agent_port'],
|
||||
$server_home['encryption_key'],$server_home['timeout'] );
|
||||
// Check if the screen running the server is running.
|
||||
if ( $remote->is_screen_running(OGP_SCREEN_TYPE_HOME,$server_home['home_id']) === 1 )
|
||||
{
|
||||
require_once("modules/config_games/server_config_parser.php");
|
||||
$server_xml = read_server_config(SERVER_CONFIG_LOCATION."/".$server_home['home_cfg_file']);
|
||||
if ( $server_home['use_nat'] == 1 ){
|
||||
$ip = $server_home['agent_ip'];
|
||||
}else{
|
||||
$ip = $server_home['ip'] != $server_home['agent_ip'] ? $server_home['ip'] : $server_home['agent_ip'];
|
||||
}
|
||||
$ip = checkDisplayPublicIP($server_home['display_public_ip'],$ip);
|
||||
|
||||
$port = $server_home['port'];
|
||||
|
||||
if($server_xml->protocol == "lgsl")
|
||||
{
|
||||
$get_q_and_s = lgsl_port_conversion((string)$server_xml->lgsl_query_name, $port, "", "");
|
||||
//Connection port
|
||||
$c_port = $get_q_and_s['0'];
|
||||
//query port
|
||||
$q_port = $get_q_and_s['1'];
|
||||
//software port
|
||||
$s_port = $get_q_and_s['2'];
|
||||
$address = "<a href='" . lgsl_software_link($server_xml->lgsl_query_name, $ip, $c_port, $q_port, $s_port) . "'>".$ip.":".$port."</a>";
|
||||
}
|
||||
elseif($server_xml->protocol == "teamspeak3")
|
||||
$address = "<a href='ts3server://$ip:$port'>$ip:$port</a>";
|
||||
elseif($server_xml->installer == "steamcmd")
|
||||
$address = "<a href='steam://connect/$ip:$port'>$ip:$port</a>";
|
||||
else
|
||||
$address = "$ip:$port";
|
||||
|
||||
$OnlineServers .= "<tr><td><div class='name' ><a href='?m=gamemanager&p=game_monitor&home_id-mod_id-ip-port=" . $server_home['home_id'] . "-" . $server_home['mod_id'] . "-" . $server_home['ip'] . "-" . $server_home['port'] . "' ><img style='border:0;height:12px;' src='images/magnifglass.png'/>" . htmlentities($server_home['home_name']) . "</a></div> | ";
|
||||
$OnlineServers .= "<div id='gamelink' >$address</div>";
|
||||
$OnlineServers .= "</td></tr>";
|
||||
$stats_servers_online++;
|
||||
}
|
||||
}
|
||||
$OnlineServers .= "</table>";
|
||||
$OnlineServers .= "<center>".get_lang('statistics').
|
||||
":<br>$stats_servers_online/$stats_servers ".
|
||||
get_lang('online_servers')."</center>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div style="margin-top:20px;">
|
||||
<?php
|
||||
//$title[$id] = "The Title";
|
||||
//$content[$id] = "Content of the Widget";
|
||||
$title = array();
|
||||
$content = array();
|
||||
$href = array();
|
||||
// Game Monitor
|
||||
$title[1] = get_lang('game_monitor');
|
||||
$content[1] = '<img src="themes/' . $settings['theme'] . '/images/icons/game_monitor.png" style="width:48px;float:right;margin:0 0 0 8px" />View all your servers from the Game Monitor. This is where you can START/STOP and configure your server. ';
|
||||
$href[1] = 'home.php?m=gamemanager&p=game_monitor';
|
||||
// Online Server
|
||||
$title[2] = $OnlineServersTitle;
|
||||
$content[2] = $OnlineServers;
|
||||
$href[2] = null;
|
||||
// Currently Online
|
||||
$title[3] = get_lang('currently_online');
|
||||
$content[3] = $player_list;
|
||||
$href[3] = null;
|
||||
// Invoices
|
||||
$title[4] = 'View Invoices';
|
||||
$content[4] ='<img src="images/invoice.png" style="width:48px;float:right;margin:0 0 0 8px" />Invoices Due : '. $invoicesDue . '<p>Servers expire after 1 month and an invoice will be created after which you have 7 days to renew the server.</p>The time remaining for each server is at the lower right of each server in the Game Monitor ';
|
||||
|
||||
$href[4] = 'home.php?m=simple-billing&p=cart';
|
||||
// Support
|
||||
$title[5] = (isset($settings['support_widget_title']) && $settings['support_widget_title'] != "") ?
|
||||
$settings['support_widget_title'] : get_lang('support');
|
||||
$content[5] = (isset($settings['support_widget_content']) && $settings['support_widget_content'] != "") ?
|
||||
$settings['support_widget_content'] : '<img src="themes/' . $settings['theme'] .
|
||||
'/images/icons/support.png" style="width:48px;float:right;margin:0 0 0 8px" />' . get_lang('dashboard_support_text');
|
||||
$href[5] = (isset($settings['support_widget_link']) && $settings['support_widget_link'] != "") ?
|
||||
$settings['support_widget_link'] : '';
|
||||
|
||||
|
||||
$widgets = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXwidgets_users WHERE user_id='".$_SESSION['user_id']."' ORDER BY sort_no");
|
||||
if(!$widgets)
|
||||
{
|
||||
if($db->createUserWidgets($_SESSION['user_id']))
|
||||
$widgets = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXwidgets_users WHERE user_id='".$_SESSION['user_id']."' ORDER BY sort_no");
|
||||
}
|
||||
|
||||
if($widgets)
|
||||
{
|
||||
$colhtml[1] = '<div class="column one_fourth" id="column1" >';
|
||||
$colhtml[2] = '<div class="column one_two" id="column2" >';
|
||||
$colhtml[3] = '<div class="column one_fourth" id="column3" >';
|
||||
foreach($widgets as $widget)
|
||||
{
|
||||
if( (!isset($settings['old_dashboard_behavior']) or $settings['old_dashboard_behavior'] == 0) AND $widget['widget_id'] == "3" )
|
||||
continue;
|
||||
$colhtml[$widget['column_id']] .= '<div class="dragbox bloc rounded" id="item'.$widget['widget_id'].'">'.
|
||||
'<h4><span class="configure"></span>';
|
||||
if(!is_null($title[$widget['widget_id']]))
|
||||
$colhtml[$widget['column_id']] .= $title[$widget['widget_id']];
|
||||
|
||||
$colhtml[$widget['column_id']] .= '</h4><div class="dragbox-content" ';
|
||||
if(!is_null($href[$widget['widget_id']]))
|
||||
{
|
||||
$colhtml[$widget['column_id']] .= "onclick=\"location.href='". $href[$widget['widget_id']] . "'\" style=\"cursor:pointer;";
|
||||
if($widget['collapsed']==1)
|
||||
$colhtml[$widget['column_id']] .= 'display:none;';
|
||||
$colhtml[$widget['column_id']] .= '"';
|
||||
}
|
||||
elseif($widget['collapsed']==1)
|
||||
$colhtml[$widget['column_id']] .= 'style="display:none;"';
|
||||
|
||||
$colhtml[$widget['column_id']] .= '>';
|
||||
|
||||
if(!is_null($content[$widget['widget_id']]))
|
||||
$colhtml[$widget['column_id']] .= $content[$widget['widget_id']];
|
||||
|
||||
$colhtml[$widget['column_id']] .= '</div></div>';
|
||||
}
|
||||
foreach($colhtml as $html )
|
||||
echo $html.'</div>';
|
||||
}
|
||||
if( $isAdmin AND $db->isModuleInstalled('status') )
|
||||
{
|
||||
echo "<h0>".get_lang('server_status')."</h0><br>";
|
||||
$servers = $db->getRemoteServers();
|
||||
|
||||
echo "<div id='column4' style='float:left;width:40%;' >
|
||||
<div class='bloc rounded' >
|
||||
<h4>".get_lang('select_remote_server')."</h4>
|
||||
<div>
|
||||
<br>
|
||||
<center>
|
||||
<form action='' method='GET'>
|
||||
<input type='hidden' name='m' value='".$_GET['m']."'/>
|
||||
<input type='hidden' name='p' value='".$_GET['p']."'/>
|
||||
<select name='remote_server_id' onchange=".'"this.form.submit()"'.">\n";
|
||||
|
||||
$agents_ips = array();
|
||||
foreach ( $servers as $server_row )
|
||||
{
|
||||
$agents_ips[$server_row['remote_server_id']] = gethostbyname($server_row['agent_ip']);
|
||||
if( !empty( $server_row['remote_server_id'] ) and !isset( $_GET['remote_server_id'] ) OR !empty( $server_row['remote_server_id'] ) and empty( $_GET['remote_server_id'] ) )
|
||||
{
|
||||
$_GET['remote_server_id'] = $server_row['remote_server_id'];
|
||||
}
|
||||
|
||||
if( isset($_GET['remote_server_id']) AND $_GET['remote_server_id'] == $server_row['remote_server_id'] )
|
||||
{
|
||||
$remote = new OGPRemoteLibrary( $server_row['agent_ip'], $server_row['agent_port'],
|
||||
$server_row['encryption_key'], $server_row['timeout'] );
|
||||
$host_stat = $remote->status_chk();
|
||||
if( $host_stat === 1 )
|
||||
{
|
||||
$checked = "selected='selected'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$checked = '';
|
||||
$_GET['remote_server_id'] = 'webhost';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$checked = '';
|
||||
}
|
||||
echo "<option value='".$server_row['remote_server_id']."' $checked >".$server_row['remote_server_name']."</option>\n";
|
||||
}
|
||||
|
||||
if ( function_exists('exec') )
|
||||
{
|
||||
$host_ip = isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : $_SERVER['SERVER_ADDR'];
|
||||
$remote_server_id = array_search($host_ip,$agents_ips);
|
||||
$show_webhost = true;
|
||||
if($remote_server_id)
|
||||
{
|
||||
$remote_server = $db->getRemoteServer($remote_server_id);
|
||||
$remote = new OGPRemoteLibrary( $remote_server['agent_ip'], $remote_server['agent_port'],
|
||||
$remote_server['encryption_key'], $remote_server['timeout'] );
|
||||
$host_stat = $remote->status_chk();
|
||||
if( $host_stat === 1 )
|
||||
$show_webhost = false;
|
||||
}
|
||||
if($show_webhost)
|
||||
{
|
||||
$checked = ( isset($_GET['remote_server_id']) AND $_GET['remote_server_id'] == 'webhost' ) ? "selected='selected'" : "";
|
||||
echo "<option value='webhost' $checked >Webhost Status</option>";
|
||||
}
|
||||
}
|
||||
|
||||
echo " </select>
|
||||
</form>
|
||||
</center>
|
||||
<br><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>\n";
|
||||
|
||||
if( isset($_GET['remote_server_id']) AND ( $_GET['remote_server_id'] == "webhost" or $_GET['remote_server_id'] == "" ) )
|
||||
unset($_GET['remote_server_id']);
|
||||
|
||||
if( isset($_GET['remote_server_id']) )
|
||||
$remote_server = "&remote_server_id=".$_GET['remote_server_id'];
|
||||
else
|
||||
$remote_server = "";
|
||||
|
||||
if( isset($_GET['remote_server_id']) OR function_exists('exec') )
|
||||
echo $refresh->getdiv($refresh->add("home.php?m=status&type=cleared".$remote_server));
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
<?php echo $refresh->build(isset($settings['query_cache_life']) ? $settings['query_cache_life'] * 2000 : 60000); ?>
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
@ -28,6 +28,33 @@ $module_version = "1.0";
|
|||
$db_version = 0;
|
||||
$module_required = TRUE;
|
||||
$module_menus = array( array( 'subpage' => 'dashboard', 'name'=>'Dashboard', 'group'=>'user' ) );
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."widgets;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."widgets` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`column_id` int(11) NOT NULL,
|
||||
`sort_no` int(11) NOT NULL,
|
||||
`collapsed` tinyint(4) NOT NULL,
|
||||
`title` varchar(100) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."widgets_users",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."widgets_users` (
|
||||
`user_id` int(11) NOT NULL,
|
||||
`widget_id` int(11) NOT NULL,
|
||||
`column_id` int(11) NOT NULL,
|
||||
`sort_no` int(11) NOT NULL,
|
||||
`collapsed` tinyint(4) NOT NULL,
|
||||
`title` varchar(100) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
|
||||
"INSERT INTO `".OGP_DB_PREFIX."widgets` (`id`, `column_id`, `sort_no`, `collapsed`, `title`) VALUES
|
||||
(1, 1, 1, 0, 'Game Monitor'),
|
||||
(2, 2, 0, 0, 'Online Server'),
|
||||
(3, 2, 1, 0, 'Currently Online'),
|
||||
(4, 3, 0, 0, 'FTP'),
|
||||
(5, 3, 1, 0, 'Support'); ");
|
||||
?>
|
||||
|
||||
|
|
|
|||
BIN
modules/dsi/cache/173.208.236.122_26900-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/173.208.236.122_27115-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/173.208.236.122_27250-normal
vendored
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
modules/dsi/cache/173.208.236.122_27250-sky
vendored
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
modules/dsi/cache/173.208.236.122_27250-small
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/173.208.236.122_27425-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/173.208.236.122_27425-sky
vendored
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
modules/dsi/cache/173.208.236.122_27425-small
vendored
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
modules/dsi/cache/173.208.236.122_27961-normal
vendored
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
modules/dsi/cache/173.208.236.122_27962-normal
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
modules/dsi/cache/173.208.236.122_27964-normal
vendored
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
modules/dsi/cache/173.208.236.122_34000-normal
vendored
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
modules/dsi/cache/173.208.236.122_34000-sky
vendored
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
modules/dsi/cache/173.208.236.122_34000-small
vendored
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
modules/dsi/cache/173.208.236.122_34197-normal
vendored
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
modules/dsi/cache/173.208.236.122_34197-sky
vendored
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
modules/dsi/cache/173.208.236.122_34197-small
vendored
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
modules/dsi/cache/173.208.236.126_26905-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/173.208.236.126_26905-sky
vendored
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
modules/dsi/cache/173.208.236.126_26905-small
vendored
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
modules/dsi/cache/173.208.236.126_27015-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/173.208.236.126_27050-normal
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
modules/dsi/cache/173.208.236.126_7700-normal
vendored
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
modules/dsi/cache/173.208.236.126_7710-normal
vendored
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
modules/dsi/cache/192.3.81.45_27000-normal
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
modules/dsi/cache/192.3.81.45_27000-sky
vendored
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
modules/dsi/cache/192.3.81.45_27000-small
vendored
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
modules/dsi/cache/192.3.81.45_27010-normal
vendored
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
modules/dsi/cache/192.3.81.45_27010-sky
vendored
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
modules/dsi/cache/192.3.81.45_27010-small
vendored
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
modules/dsi/cache/198.211.13.70_27000-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/204.12.208.34_2300-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/204.12.208.34_2303-normal
vendored
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
modules/dsi/cache/204.12.208.34_2400-normal
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
modules/dsi/cache/204.12.208.34_2403-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/204.12.208.34_2406-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/204.12.208.34_2406-sky
vendored
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
modules/dsi/cache/204.12.208.34_2406-small
vendored
Normal file
|
After Width: | Height: | Size: 5 KiB |
BIN
modules/dsi/cache/204.12.208.34_2412-normal
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
modules/dsi/cache/204.12.208.34_2415-normal
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
modules/dsi/cache/204.12.208.34_2418-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/204.12.208.34_2418-sky
vendored
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
modules/dsi/cache/204.12.208.34_2418-small
vendored
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
modules/dsi/cache/204.12.208.34_2424-normal
vendored
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
modules/dsi/cache/204.12.208.34_2600-normal
vendored
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
modules/dsi/cache/204.12.208.34_2603-normal
vendored
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
modules/dsi/cache/204.12.208.34_27010-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/204.12.208.34_5000-normal
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
modules/dsi/cache/204.12.208.34_5000-sky
vendored
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
modules/dsi/cache/204.12.208.34_5000-small
vendored
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
modules/dsi/cache/37.59.46.120_2303-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/37.59.46.120_2303-sky
vendored
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
modules/dsi/cache/37.59.46.120_2303-small
vendored
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
modules/dsi/cache/37.59.46.120_2306-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/37.59.46.120_2306-sky
vendored
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
modules/dsi/cache/37.59.46.120_2306-small
vendored
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
modules/dsi/cache/37.59.46.120_2309-normal
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
modules/dsi/cache/37.59.46.120_2312-normal
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/dsi/cache/37.59.46.120_2335-normal
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |