Website is completed working, moved into billing module
This commit is contained in:
parent
3ea6436f27
commit
437fbad5e6
401 changed files with 1822 additions and 7831 deletions
165
modules/billing/_archived/CONFIGURATION.md
Normal file
165
modules/billing/_archived/CONFIGURATION.md
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
# Website Configuration Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The `_website` folder is now a standalone site with centralized database configuration. All database connection settings are managed in a single location: `includes/config.inc.php`.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
_website/
|
||||
├── includes/
|
||||
│ ├── config.inc.php # Central database configuration
|
||||
│ └── README.md # Documentation for includes directory
|
||||
├── db.php # Database connection (loads config.inc.php)
|
||||
├── login.php # Uses db.php
|
||||
├── logout.php # Uses db.php
|
||||
├── cart.php # Uses db.php
|
||||
├── order.php # Uses db.php
|
||||
├── serverlist.php # Uses db.php
|
||||
└── ...other files
|
||||
```
|
||||
|
||||
## Configuration File
|
||||
|
||||
### Location
|
||||
`_website/includes/config.inc.php`
|
||||
|
||||
### Contents
|
||||
```php
|
||||
<?php
|
||||
$db_host="localhost"; // Database server hostname
|
||||
$db_user="localuser"; // Database username
|
||||
$db_pass="password"; // Database password
|
||||
$db_name="panel"; // Database name
|
||||
$table_prefix="ogp_"; // Table prefix
|
||||
$db_type="mysql"; // Database type
|
||||
?>
|
||||
```
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Configuration Loading**
|
||||
- Website files include `db.php`
|
||||
- `db.php` loads `includes/config.inc.php`
|
||||
- Configuration variables are available to all files
|
||||
|
||||
2. **Configuration Flow**
|
||||
```
|
||||
includes/config.inc.php → db.php → website files
|
||||
```
|
||||
|
||||
3. **Database Connection**
|
||||
- `db.php` uses the configuration variables to establish a connection
|
||||
- Returns `$db` variable containing the mysqli connection
|
||||
|
||||
## Setup Instructions
|
||||
|
||||
### For Standalone Use
|
||||
|
||||
1. **Copy the _website folder** to your web server
|
||||
2. **Edit configuration**:
|
||||
```bash
|
||||
nano _website/includes/config.inc.php
|
||||
```
|
||||
3. **Update database credentials**:
|
||||
- Set `$db_host` to your database server
|
||||
- Set `$db_user` to your database username
|
||||
- Set `$db_pass` to your database password
|
||||
- Set `$db_name` to your database name
|
||||
4. **Verify permissions**:
|
||||
```bash
|
||||
chmod 600 _website/includes/config.inc.php
|
||||
```
|
||||
|
||||
### For Panel Integration
|
||||
|
||||
The configuration in `_website/includes/config.inc.php` should match the panel's configuration in `/includes/config.inc.php` to ensure both the website and panel access the same database.
|
||||
|
||||
## Security Best Practices
|
||||
|
||||
1. **File Permissions**: Set `config.inc.php` to read-only for the web server user
|
||||
```bash
|
||||
chmod 600 includes/config.inc.php
|
||||
```
|
||||
|
||||
2. **Web Server Configuration**: Ensure the `includes/` directory is not directly accessible via HTTP
|
||||
```apache
|
||||
<Directory "/path/to/_website/includes">
|
||||
Require all denied
|
||||
</Directory>
|
||||
```
|
||||
|
||||
3. **Backup Configuration**: Keep a secure backup of your configuration file
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Connection Errors
|
||||
|
||||
If you see database connection errors:
|
||||
|
||||
1. **Verify credentials** in `includes/config.inc.php`
|
||||
2. **Check database server** is running
|
||||
3. **Verify database exists**
|
||||
4. **Check user permissions** in the database
|
||||
|
||||
### File Not Found Errors
|
||||
|
||||
If you see errors about missing `config.inc.php`:
|
||||
|
||||
1. **Verify the file exists** at `_website/includes/config.inc.php`
|
||||
2. **Check file permissions** are readable by the web server
|
||||
3. **Verify path** in `db.php` uses `__DIR__` for relative paths
|
||||
|
||||
### Include Errors
|
||||
|
||||
If website files can't include `db.php`:
|
||||
|
||||
1. **Check file paths** are correct
|
||||
2. **Verify `db.php`** exists in the `_website/` root
|
||||
3. **Check PHP include paths** in php.ini if needed
|
||||
|
||||
## Migration from Old Configuration
|
||||
|
||||
The old `db.php` had hardcoded credentials:
|
||||
```php
|
||||
// OLD (hardcoded)
|
||||
$servername = "panel.iaregamer.com";
|
||||
$username = "remoteuser";
|
||||
```
|
||||
|
||||
The new `db.php` uses centralized config:
|
||||
```php
|
||||
// NEW (centralized)
|
||||
require_once(__DIR__ . '/includes/config.inc.php');
|
||||
$servername = $db_host;
|
||||
$username = $db_user;
|
||||
```
|
||||
|
||||
**No changes needed** to files that include `db.php` - they work automatically with the new configuration.
|
||||
|
||||
## Files Using Database Connection
|
||||
|
||||
The following files include `db.php` and use the centralized configuration:
|
||||
- `login.php` - User authentication
|
||||
- `logout.php` - Session termination
|
||||
- `cart.php` - Shopping cart
|
||||
- `order.php` - Order processing
|
||||
- `serverlist.php` - Server listings
|
||||
- `adminserverlist.php` - Admin server management
|
||||
- `test_db_connection.php` - Database testing
|
||||
|
||||
## Benefits
|
||||
|
||||
1. **Single Source of Truth**: All database settings in one file
|
||||
2. **Easy Configuration**: Change settings in one place
|
||||
3. **Portable**: Copy folder and update one config file
|
||||
4. **Secure**: Configuration separate from code
|
||||
5. **Maintainable**: Easy to update and manage
|
||||
|
||||
## Support
|
||||
|
||||
For issues or questions about the configuration, please refer to:
|
||||
- `includes/README.md` - Detailed information about includes directory
|
||||
- Main project documentation
|
||||
- Panel configuration at `/includes/config.inc.php`
|
||||
383
modules/billing/_archived/FEATURES.md
Normal file
383
modules/billing/_archived/FEATURES.md
Normal file
|
|
@ -0,0 +1,383 @@
|
|||
# Website Features Documentation
|
||||
|
||||
This document describes the new features added to the GameServers.World website (_website folder).
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Password Reset System](#password-reset-system)
|
||||
2. [My Servers Dashboard](#my-servers-dashboard)
|
||||
3. [Server Status Page](#server-status-page)
|
||||
4. [UI Improvements](#ui-improvements)
|
||||
5. [Apache Configuration](#apache-configuration)
|
||||
|
||||
---
|
||||
|
||||
## Password Reset System
|
||||
|
||||
A complete password reset workflow has been implemented to allow users to recover their accounts.
|
||||
|
||||
### Files Created
|
||||
|
||||
- **forgot_password.php** - Request password reset
|
||||
- **reset_password.php** - Reset password with token
|
||||
|
||||
### How It Works
|
||||
|
||||
1. User visits the login page and clicks "Forgot Password?"
|
||||
2. User enters their username or email on `forgot_password.php`
|
||||
3. System generates a secure token and stores it in `ogp_password_reset_tokens` table
|
||||
4. Email is sent with reset link (falls back to displaying link if email fails)
|
||||
5. User clicks link and is taken to `reset_password.php?token=XXX`
|
||||
6. User enters new password (min 8 characters)
|
||||
7. Password is updated using both MD5 (panel compatibility) and modern hash (if shadow column exists)
|
||||
8. Token is marked as used
|
||||
|
||||
### Database Table
|
||||
|
||||
The system automatically creates this table if it doesn't exist:
|
||||
|
||||
```sql
|
||||
CREATE TABLE ogp_password_reset_tokens (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT NOT NULL,
|
||||
token VARCHAR(64) NOT NULL,
|
||||
expires DATETIME NOT NULL,
|
||||
used TINYINT(1) DEFAULT 0,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
INDEX idx_token (token),
|
||||
INDEX idx_user_id (user_id)
|
||||
)
|
||||
```
|
||||
|
||||
### Security Features
|
||||
|
||||
- Tokens expire after 1 hour
|
||||
- Tokens can only be used once
|
||||
- Secure random token generation (64 hex characters)
|
||||
- Password requirements enforced (min 8 chars)
|
||||
- Passwords hashed with both MD5 (panel) and bcrypt (modern)
|
||||
- User enumeration protection (doesn't reveal if account exists)
|
||||
|
||||
### Email Configuration
|
||||
|
||||
The system uses PHP's `mail()` function. For production:
|
||||
|
||||
1. Configure your server's mail system (sendmail, postfix, etc.)
|
||||
2. Or integrate with an email service (SendGrid, Mailgun, etc.)
|
||||
3. Update the email headers in `forgot_password.php` as needed
|
||||
|
||||
---
|
||||
|
||||
## My Servers Dashboard
|
||||
|
||||
A user dashboard showing all active game servers with renewal options.
|
||||
|
||||
### File Created
|
||||
|
||||
- **my_servers.php** - User's server management dashboard
|
||||
- **renew_server.php** - Server renewal page
|
||||
|
||||
### Features
|
||||
|
||||
- **Server List**: Shows all servers owned by logged-in user
|
||||
- **Server Details**: Name, game type, location, status
|
||||
- **Expiration Tracking**: Shows expiration date for each server
|
||||
- **Status Indicators**: Active, Inactive, Expired
|
||||
- **Renewal Links**: Quick access to renew each server
|
||||
- **Empty State**: Helpful message when user has no servers
|
||||
|
||||
### Access
|
||||
|
||||
- Menu link "My Servers" appears when user is logged in
|
||||
- Requires authentication via `login_required.php`
|
||||
|
||||
### Database Query
|
||||
|
||||
Joins multiple tables:
|
||||
- `ogp_home` - Server instances
|
||||
- `ogp_remote_servers` - Server locations
|
||||
- `ogp_game_configs` - Game information
|
||||
- `ogp_billing_orders` - Order/expiration data
|
||||
- `ogp_billing_services` - Service pricing
|
||||
|
||||
---
|
||||
|
||||
## Server Status Page
|
||||
|
||||
Public page showing real-time status of all game server infrastructure.
|
||||
|
||||
### File Created
|
||||
|
||||
- **server_status.php** - Server infrastructure status
|
||||
|
||||
### Features
|
||||
|
||||
- **Real-time Status**: Online, Offline, Maintenance, Unknown
|
||||
- **Resource Usage**: CPU, Memory, Disk usage percentages
|
||||
- **Uptime Display**: How long each server has been running
|
||||
- **Last Updated**: Time since last status update
|
||||
- **Color-coded Badges**: Visual status indicators
|
||||
- **Notes Support**: Display maintenance or status messages
|
||||
|
||||
### Database Table
|
||||
|
||||
Automatically creates table if it doesn't exist:
|
||||
|
||||
```sql
|
||||
CREATE TABLE ogp_server_status (
|
||||
status_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
remote_server_id INT NOT NULL,
|
||||
server_name VARCHAR(255) NOT NULL,
|
||||
ip_address VARCHAR(45),
|
||||
status ENUM('online', 'offline', 'maintenance') DEFAULT 'offline',
|
||||
cpu_usage DECIMAL(5,2),
|
||||
memory_usage DECIMAL(5,2),
|
||||
disk_usage DECIMAL(5,2),
|
||||
uptime VARCHAR(50),
|
||||
last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
notes TEXT,
|
||||
INDEX idx_remote_server (remote_server_id),
|
||||
UNIQUE KEY unique_server (remote_server_id)
|
||||
)
|
||||
```
|
||||
|
||||
### Server Updates
|
||||
|
||||
The page displays data from `ogp_server_status`. Servers should update this table:
|
||||
|
||||
```php
|
||||
// Example server update code (run on each server periodically)
|
||||
$stmt = $db->prepare("INSERT INTO ogp_server_status
|
||||
(remote_server_id, server_name, ip_address, status, cpu_usage, memory_usage, disk_usage, uptime, notes)
|
||||
VALUES (?, ?, ?, 'online', ?, ?, ?, ?, ?)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
status = VALUES(status),
|
||||
cpu_usage = VALUES(cpu_usage),
|
||||
memory_usage = VALUES(memory_usage),
|
||||
disk_usage = VALUES(disk_usage),
|
||||
uptime = VALUES(uptime),
|
||||
notes = VALUES(notes),
|
||||
last_updated = NOW()");
|
||||
```
|
||||
|
||||
### Access
|
||||
|
||||
- Link in footer: "Server Status"
|
||||
- Public page (no login required)
|
||||
|
||||
---
|
||||
|
||||
## UI Improvements
|
||||
|
||||
### Server List Page
|
||||
|
||||
**Before**: "Order Server" was a plain link
|
||||
**After**: Styled as a button with gradient background
|
||||
|
||||
```html
|
||||
<a href="order.php?service_id=X" class="gsw-btn"
|
||||
style="display:inline-block;padding:12px 24px;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);color:white;text-decoration:none;border-radius:8px;font-weight:600;transition:transform 0.2s;">
|
||||
Order Now
|
||||
</a>
|
||||
```
|
||||
|
||||
### Order Page
|
||||
|
||||
**Fixed**: Game images now display correctly
|
||||
- Changed from `src="<?php echo $img_url; ?>"`
|
||||
- To `src="../<?php echo $img_url; ?>"`
|
||||
- Assumes images are stored relative to panel root
|
||||
|
||||
### Login Page
|
||||
|
||||
**Added**: "Forgot Password?" link next to Register link
|
||||
|
||||
### Navigation Menu
|
||||
|
||||
**Added**: "My Servers" link for logged-in users
|
||||
- Only visible when user is authenticated
|
||||
- Positioned between "Game Servers" and "Cart"
|
||||
|
||||
### Footer
|
||||
|
||||
**Added**: "Server Status" link
|
||||
- Public access to infrastructure status
|
||||
- Positioned in footer with other utility links
|
||||
|
||||
---
|
||||
|
||||
## Apache Configuration
|
||||
|
||||
Three Apache virtual host configuration files have been created in the GSP root directory.
|
||||
|
||||
### Files Created
|
||||
|
||||
- **panel.conf** - Panel dashboard configuration
|
||||
- **website.conf** - Storefront website configuration
|
||||
- **fileserver.conf** - File server configuration
|
||||
- **APACHE_SETUP.md** - Detailed installation guide
|
||||
|
||||
### panel.conf
|
||||
|
||||
Main Open Game Panel dashboard:
|
||||
- Domain: panel.yourdomain.com
|
||||
- Document Root: /var/www/GSP
|
||||
- PHP settings optimized for panel operations
|
||||
- Security headers enabled
|
||||
|
||||
### website.conf
|
||||
|
||||
GameServers.World storefront:
|
||||
- Domain: gameservers.world
|
||||
- Document Root: /var/www/GSP/_website
|
||||
- Protected includes and data directories
|
||||
- Static asset caching
|
||||
- Compression enabled
|
||||
- Separate session handling
|
||||
|
||||
### fileserver.conf
|
||||
|
||||
Game file distribution:
|
||||
- Domain: files.yourdomain.com
|
||||
- Document Root: /var/www/fileserver
|
||||
- Directory browsing enabled
|
||||
- Large file support
|
||||
- Script execution disabled in uploads
|
||||
- Bandwidth limiting support (optional)
|
||||
|
||||
### Installation
|
||||
|
||||
See `APACHE_SETUP.md` for complete installation instructions including:
|
||||
- Copying configuration files
|
||||
- Enabling sites and modules
|
||||
- SSL/HTTPS setup with Let's Encrypt
|
||||
- DNS configuration
|
||||
- Firewall rules
|
||||
- Troubleshooting
|
||||
|
||||
---
|
||||
|
||||
## Testing
|
||||
|
||||
### Password Reset
|
||||
|
||||
1. Visit `login.php`
|
||||
2. Click "Forgot Password?"
|
||||
3. Enter username or email
|
||||
4. Check email or view on-screen link (development mode)
|
||||
5. Click reset link
|
||||
6. Enter new password (min 8 chars)
|
||||
7. Confirm password matches
|
||||
8. Submit and verify redirect to login
|
||||
|
||||
### My Servers
|
||||
|
||||
1. Login as a user with servers
|
||||
2. Click "My Servers" in navigation
|
||||
3. Verify all servers are listed
|
||||
4. Check expiration dates
|
||||
5. Click "Renew" on a server
|
||||
6. Verify renewal page displays correctly
|
||||
|
||||
### Server Status
|
||||
|
||||
1. Visit footer link "Server Status"
|
||||
2. Verify all remote servers are displayed
|
||||
3. Check status badges (color coding)
|
||||
4. Verify "Last Updated" formatting
|
||||
5. Confirm public access (no login required)
|
||||
|
||||
### UI Changes
|
||||
|
||||
1. Visit `serverlist.php`
|
||||
2. Verify "Order Now" displays as styled button
|
||||
3. Click button to go to `order.php`
|
||||
4. Verify game images display correctly
|
||||
5. Check footer has "Server Status" link
|
||||
6. Login and verify "My Servers" appears in menu
|
||||
|
||||
---
|
||||
|
||||
## Security Considerations
|
||||
|
||||
### Password Reset
|
||||
|
||||
- ✅ Tokens expire after 1 hour
|
||||
- ✅ One-time use tokens
|
||||
- ✅ Secure random generation
|
||||
- ✅ User enumeration protection
|
||||
- ✅ Password strength requirements
|
||||
- ⚠️ Email delivery depends on server mail config
|
||||
|
||||
### My Servers
|
||||
|
||||
- ✅ Login required
|
||||
- ✅ User can only see own servers
|
||||
- ✅ SQL injection prevention with prepared statements
|
||||
- ✅ XSS prevention with htmlspecialchars()
|
||||
|
||||
### Server Status
|
||||
|
||||
- ✅ Read-only public page
|
||||
- ✅ No sensitive information exposed
|
||||
- ✅ SQL injection prevention
|
||||
- ℹ️ Server updates should be authenticated (implement separately)
|
||||
|
||||
### Apache Configs
|
||||
|
||||
- ✅ Security headers enabled
|
||||
- ✅ Sensitive directories protected
|
||||
- ✅ Directory listing disabled (except fileserver)
|
||||
- ✅ HTTPS configurations ready
|
||||
- ⚠️ Update domain names before deployment
|
||||
- ⚠️ Configure SSL certificates for production
|
||||
|
||||
---
|
||||
|
||||
## Future Enhancements
|
||||
|
||||
### Password Reset
|
||||
- Email template customization
|
||||
- Integration with email service provider
|
||||
- Rate limiting for reset requests
|
||||
- SMS/2FA backup recovery
|
||||
|
||||
### My Servers
|
||||
- Server control buttons (start/stop/restart)
|
||||
- Real-time server metrics
|
||||
- Configuration editor
|
||||
- File manager integration
|
||||
- Console access
|
||||
- Backup/restore functionality
|
||||
|
||||
### Server Status
|
||||
- Automated server monitoring agent
|
||||
- Alert notifications
|
||||
- Historical uptime graphs
|
||||
- Incident history
|
||||
- Scheduled maintenance display
|
||||
- Status API for external monitoring
|
||||
|
||||
### General
|
||||
- User profile management
|
||||
- Invoice history
|
||||
- Support ticket system
|
||||
- Knowledge base integration
|
||||
- Multi-language support
|
||||
- Dark/light theme toggle
|
||||
|
||||
---
|
||||
|
||||
## Support
|
||||
|
||||
For issues or questions:
|
||||
|
||||
1. Check the main GSP documentation
|
||||
2. Review Apache configuration in `APACHE_SETUP.md`
|
||||
3. Check PHP error logs
|
||||
4. Verify database connectivity
|
||||
5. Ensure proper file permissions
|
||||
|
||||
## License
|
||||
|
||||
All new features follow the same license as the main Open Game Panel project.
|
||||
180
modules/billing/_archived/IMPLEMENTATION_SUMMARY.md
Normal file
180
modules/billing/_archived/IMPLEMENTATION_SUMMARY.md
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
# Website Login Implementation - Summary
|
||||
|
||||
## Task Completed
|
||||
Successfully implemented login functionality for the website (_website/) that authenticates users against the panel database (ogp_users table) while maintaining separate sessions.
|
||||
|
||||
## Files Created
|
||||
|
||||
### 1. `_website/login.php` (NEW - 223 lines)
|
||||
Full-featured login page with:
|
||||
- Modern, responsive UI design
|
||||
- Authentication against panel DB using MD5 (panel-compatible)
|
||||
- Separate website session: `gameservers_website`
|
||||
- Input validation and sanitization
|
||||
- Error and success message display
|
||||
- Automatic redirect after successful login
|
||||
- Login attempt logging
|
||||
- Already-logged-in detection and redirect
|
||||
|
||||
**Key Features:**
|
||||
- SQL injection prevention via `mysqli_real_escape_string()`
|
||||
- XSS prevention via `htmlspecialchars()` in output
|
||||
- Password verification using MD5 (matching panel's method)
|
||||
- Clean separation from panel session
|
||||
- Responsive design that works on mobile and desktop
|
||||
|
||||
### 2. `_website/logout.php` (NEW - 23 lines)
|
||||
Clean logout functionality:
|
||||
- Destroys website session properly
|
||||
- Clears session cookies
|
||||
- Logs logout events
|
||||
- Redirects to homepage
|
||||
|
||||
### 3. `_website/index.php` (MODIFIED)
|
||||
Updated homepage with:
|
||||
- Session management initialization
|
||||
- Header with login status display
|
||||
- "Welcome, [username]!" message when logged in
|
||||
- Login/Logout button in header
|
||||
- Maintains original design with minimal changes
|
||||
|
||||
**Changes Made:**
|
||||
- Added session initialization at top (4 lines)
|
||||
- Added proper HTML structure (DOCTYPE, html, head tags)
|
||||
- Added header section with login/logout UI (19 lines)
|
||||
- Converted from heredoc to regular HTML output
|
||||
- All styling preserved with additions for header
|
||||
|
||||
### 4. `_website/README_LOGIN.md` (NEW - Documentation)
|
||||
Comprehensive documentation covering:
|
||||
- Overview of implementation
|
||||
- File descriptions
|
||||
- Session management details
|
||||
- Security features
|
||||
- Database requirements
|
||||
- Usage instructions for users and developers
|
||||
- Future enhancement suggestions
|
||||
- Alignment with project guidelines
|
||||
|
||||
### 5. `_website/test_db_connection.php` (NEW - Test Script)
|
||||
Database testing utility that checks:
|
||||
- Database connection status
|
||||
- ogp_users table existence
|
||||
- Table structure verification
|
||||
- User count
|
||||
- Required columns presence
|
||||
- MD5 hashing functionality
|
||||
- Session functionality
|
||||
|
||||
**⚠️ Warning in file:** Must be deleted before production deployment
|
||||
|
||||
## Technical Details
|
||||
|
||||
### Session Management
|
||||
- **Website Session Name:** `gameservers_website`
|
||||
- **Panel Session Name:** `opengamepanel_web` (unchanged)
|
||||
- **Complete separation:** Users can be logged into one without the other
|
||||
|
||||
### Session Variables Set on Login
|
||||
```php
|
||||
$_SESSION['website_user_id'] // User ID from ogp_users
|
||||
$_SESSION['website_username'] // Username
|
||||
$_SESSION['website_user_role'] // User role (admin, user, etc.)
|
||||
$_SESSION['website_user_email'] // User email
|
||||
$_SESSION['website_login_time'] // Timestamp of login
|
||||
```
|
||||
|
||||
### Database Requirements
|
||||
- Access to `ogp_users` table
|
||||
- Required fields: `user_id`, `users_login`, `users_passwd`, `users_role`, `users_email`
|
||||
- Uses existing `db.php` connection
|
||||
|
||||
### Security Measures Implemented
|
||||
1. **SQL Injection Prevention:** `mysqli_real_escape_string()` on all user input
|
||||
2. **XSS Prevention:** `htmlspecialchars()` on all output
|
||||
3. **Session Isolation:** Separate session name prevents conflicts
|
||||
4. **Password Compatibility:** MD5 hashing matches panel's method
|
||||
5. **Logging:** All login/logout events logged via `logger()` function
|
||||
6. **Input Validation:** Empty field checking
|
||||
7. **Already-Logged-In Check:** Prevents duplicate sessions
|
||||
|
||||
### Code Quality
|
||||
- All files pass PHP syntax validation (`php -l`)
|
||||
- Follows existing code conventions
|
||||
- Minimal changes to existing files
|
||||
- Clean, readable code with comments
|
||||
- Responsive design
|
||||
|
||||
## Testing Performed
|
||||
|
||||
### Automated Testing
|
||||
✅ PHP syntax validation on all files
|
||||
✅ File structure verification
|
||||
✅ Git commit verification
|
||||
|
||||
### Manual Testing Required
|
||||
⚠️ Requires live database connection:
|
||||
- Login with valid credentials
|
||||
- Login with invalid credentials
|
||||
- Already-logged-in redirect
|
||||
- Logout functionality
|
||||
- Session persistence across page loads
|
||||
- Use `test_db_connection.php` to verify database setup
|
||||
|
||||
## Alignment with Project Guidelines
|
||||
|
||||
From `.github/copilot-instructions.md`:
|
||||
|
||||
✅ **Website ↔ Panel on same host:** Uses panel DB for authentication
|
||||
✅ **Sessions remain separate:** Different session names
|
||||
✅ **Auth compatibility:** MD5 hashing matches panel
|
||||
✅ **No-Code Planning:** Documented approach before implementation
|
||||
✅ **Repository-first:** Reused existing `db.php`, `logger()` function
|
||||
✅ **Minimal changes:** Surgical modifications to index.php only
|
||||
✅ **Security considerations:** SQL injection, XSS prevention
|
||||
|
||||
## File Size Summary
|
||||
- `login.php`: 7,282 bytes (223 lines)
|
||||
- `logout.php`: 567 bytes (23 lines)
|
||||
- `index.php`: Modified from 3,961 to 5,381 bytes (+1,420 bytes, +37 lines)
|
||||
- `README_LOGIN.md`: 4,041 bytes (documentation)
|
||||
- `test_db_connection.php`: 4,970 bytes (test utility)
|
||||
- `IMPLEMENTATION_SUMMARY.md`: This file (documentation)
|
||||
|
||||
**Total New Code:** ~17,000 bytes across 3 new PHP files
|
||||
|
||||
## Next Steps
|
||||
|
||||
### For Testing
|
||||
1. Run `test_db_connection.php` to verify database connectivity
|
||||
2. Test login with valid panel credentials
|
||||
3. Verify session persistence
|
||||
4. Test logout functionality
|
||||
5. **Delete `test_db_connection.php` after testing**
|
||||
|
||||
### For Production
|
||||
1. Remove or restrict access to `test_db_connection.php`
|
||||
2. Consider adding rate limiting for failed login attempts
|
||||
3. Optional: Add CSRF token protection
|
||||
4. Optional: Implement modern password hashing with transparent upgrade
|
||||
5. Monitor `logfile.txt` for login activity
|
||||
|
||||
### Future Enhancements (Optional)
|
||||
- Password hashing upgrade (bcrypt/argon2)
|
||||
- CSRF protection
|
||||
- Rate limiting (IP-based, like panel's ban_list)
|
||||
- "Remember Me" functionality
|
||||
- Two-factor authentication
|
||||
- Password reset flow integration
|
||||
- Session timeout management
|
||||
|
||||
## Conclusion
|
||||
|
||||
The implementation successfully provides a clean, secure login system for the website that authenticates against the panel database while maintaining complete session separation. The code follows best practices, includes comprehensive documentation, and is ready for testing with a live database connection.
|
||||
|
||||
All requirements from the problem statement have been met:
|
||||
✅ Clone index page structure
|
||||
✅ Create login page
|
||||
✅ Authenticate against panel DB
|
||||
✅ Create separate login session
|
||||
✅ Maintain panel compatibility
|
||||
109
modules/billing/_archived/README_LOGIN.md
Normal file
109
modules/billing/_archived/README_LOGIN.md
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
# Website Login Implementation
|
||||
|
||||
## Overview
|
||||
This implementation adds login functionality to the website that authenticates users against the panel's database (ogp_users table) while maintaining separate sessions for the website and panel.
|
||||
|
||||
## Files Created/Modified
|
||||
|
||||
### 1. `_website/login.php` (NEW)
|
||||
- Full-featured login page with modern UI
|
||||
- Authenticates against panel DB using MD5 password hashing (panel-compatible)
|
||||
- Creates separate website session using `gameservers_website` session name
|
||||
- Logs all login attempts via logger() function
|
||||
- Session variables set:
|
||||
- `$_SESSION['website_user_id']` - User ID from ogp_users
|
||||
- `$_SESSION['website_username']` - Username
|
||||
- `$_SESSION['website_user_role']` - User role (admin, user, etc.)
|
||||
- `$_SESSION['website_user_email']` - User email
|
||||
- `$_SESSION['website_login_time']` - Timestamp of login
|
||||
|
||||
### 2. `_website/logout.php` (NEW)
|
||||
- Cleanly destroys website session
|
||||
- Logs logout events
|
||||
- Redirects to homepage after logout
|
||||
- Properly clears session cookies
|
||||
|
||||
### 3. `_website/index.php` (MODIFIED)
|
||||
- Added session management at the top
|
||||
- Added header with Login/Logout button and user greeting
|
||||
- Shows "Welcome, [username]!" when logged in
|
||||
- Maintains same visual design with added header
|
||||
|
||||
## Session Management
|
||||
|
||||
### Separate Sessions
|
||||
- **Website Session**: `gameservers_website` (this implementation)
|
||||
- **Panel Session**: `opengamepanel_web` (existing panel)
|
||||
|
||||
These sessions are completely separate - users can be logged into one without being logged into the other.
|
||||
|
||||
## Security Features
|
||||
|
||||
1. **SQL Injection Prevention**: Uses `mysqli_real_escape_string()` for input sanitization
|
||||
2. **Password Hashing**: Compatible with panel's MD5 hashing (legacy but matches panel)
|
||||
3. **Session Isolation**: Separate session name prevents conflicts with panel
|
||||
4. **XSS Prevention**: Uses `htmlspecialchars()` for output escaping
|
||||
5. **Logging**: All login/logout events are logged via logger() function
|
||||
|
||||
## Database Requirements
|
||||
|
||||
Requires connection to panel database with access to:
|
||||
- `ogp_users` table (fields: user_id, users_login, users_passwd, users_role, users_email)
|
||||
- Connection configured in `db.php`
|
||||
|
||||
## Usage
|
||||
|
||||
### For Users:
|
||||
1. Visit `_website/login.php` to login
|
||||
2. Enter panel credentials (username/password)
|
||||
3. After successful login, redirected to homepage with session active
|
||||
4. Click "Logout" button to end session
|
||||
|
||||
### For Developers:
|
||||
Check if user is logged in:
|
||||
```php
|
||||
session_name("gameservers_website");
|
||||
session_start();
|
||||
|
||||
if (isset($_SESSION['website_user_id']) && !empty($_SESSION['website_user_id'])) {
|
||||
// User is logged in
|
||||
$username = $_SESSION['website_username'];
|
||||
$user_id = $_SESSION['website_user_id'];
|
||||
$user_role = $_SESSION['website_user_role'];
|
||||
}
|
||||
```
|
||||
|
||||
## Future Enhancements (Optional)
|
||||
|
||||
1. **Password Hashing Upgrade**: Implement modern bcrypt/argon2 with transparent upgrade on login
|
||||
2. **CSRF Protection**: Add CSRF tokens to login form
|
||||
3. **Rate Limiting**: Add IP-based login attempt limiting (similar to panel's ban_list)
|
||||
4. **Remember Me**: Add persistent login cookie option
|
||||
5. **Password Reset**: Integrate with panel's password reset flow
|
||||
6. **Two-Factor Auth**: Optional 2FA for enhanced security
|
||||
|
||||
## Testing
|
||||
|
||||
All files pass PHP syntax validation:
|
||||
```bash
|
||||
php -l _website/index.php
|
||||
php -l _website/login.php
|
||||
php -l _website/logout.php
|
||||
```
|
||||
|
||||
## Alignment with Copilot Instructions
|
||||
|
||||
This implementation follows the no-code planning guidelines from `.github/copilot-instructions.md`:
|
||||
|
||||
✅ Website uses panel DB for authentication
|
||||
✅ Sessions remain separate (website ≠ panel)
|
||||
✅ Auth compatibility maintained (MD5 hash for panel users)
|
||||
✅ Minimal changes to existing code
|
||||
✅ Repository-first approach (reused existing db.php, logger function)
|
||||
✅ Security considerations (SQL injection prevention, session isolation)
|
||||
|
||||
## Notes
|
||||
|
||||
- Login credentials are the same as panel login (same user table)
|
||||
- Website session does not grant access to panel - separate login required
|
||||
- Logger function from db.php creates logfile.txt for audit trail
|
||||
317
modules/billing/_archived/VISUAL_GUIDE.md
Normal file
317
modules/billing/_archived/VISUAL_GUIDE.md
Normal file
|
|
@ -0,0 +1,317 @@
|
|||
# Visual Guide - New Website Features
|
||||
|
||||
This document provides a visual description of the new features and UI changes.
|
||||
|
||||
## 1. Login Page Updates
|
||||
|
||||
### Before
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ Welcome Back │
|
||||
│ Sign in to your GameServers account│
|
||||
│ │
|
||||
│ Username: [____________] │
|
||||
│ Password: [____________] │
|
||||
│ │
|
||||
│ [ Sign In ] │
|
||||
│ │
|
||||
│ Register │
|
||||
│ ─── or ─── │
|
||||
│ Back to Home | Panel Login │
|
||||
└─────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### After
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ Welcome Back │
|
||||
│ Sign in to your GameServers account│
|
||||
│ │
|
||||
│ Username: [____________] │
|
||||
│ Password: [____________] │
|
||||
│ │
|
||||
│ [ Sign In ] │
|
||||
│ │
|
||||
│ Register | Forgot Password? ←NEW │
|
||||
│ ─── or ─── │
|
||||
│ Back to Home | Panel Login │
|
||||
└─────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## 2. Forgot Password Page (NEW)
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ Forgot Password │
|
||||
│ Enter your username or email to │
|
||||
│ reset your password │
|
||||
│ │
|
||||
│ Username or Email: │
|
||||
│ [_____________________________] │
|
||||
│ │
|
||||
│ [ Request Password Reset ] │
|
||||
│ │
|
||||
│ Back to Login | Home │
|
||||
└─────────────────────────────────────┘
|
||||
```
|
||||
|
||||
After submission (success):
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ ✓ Password reset instructions have │
|
||||
│ been sent to your email address. │
|
||||
└─────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## 3. Reset Password Page (NEW)
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ Reset Password │
|
||||
│ Enter your new password │
|
||||
│ │
|
||||
│ New Password: │
|
||||
│ [_____________________________] │
|
||||
│ Must be at least 8 characters long │
|
||||
│ │
|
||||
│ Confirm Password: │
|
||||
│ [_____________________________] │
|
||||
│ │
|
||||
│ [ Reset Password ] │
|
||||
│ │
|
||||
│ Back to Login | Home │
|
||||
└─────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## 4. Navigation Menu Updates
|
||||
|
||||
### Before (Not Logged In)
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────┐
|
||||
│ GameServers.World [Login] │
|
||||
│ Home | Game Servers | Cart │
|
||||
└──────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### After (Logged In)
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────┐
|
||||
│ GameServers.World Welcome, username! [Logout] │
|
||||
│ Home | Game Servers | My Servers ←NEW | Cart │
|
||||
└──────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## 5. Server List Page
|
||||
|
||||
### Before
|
||||
```
|
||||
┌────────────────────────────┐
|
||||
│ [Game Image] │
|
||||
│ Counter-Strike 2 │
|
||||
│ $15.99 Monthly │
|
||||
│ │
|
||||
│ Order Server (link) │
|
||||
└────────────────────────────┘
|
||||
```
|
||||
|
||||
### After
|
||||
```
|
||||
┌────────────────────────────┐
|
||||
│ [Game Image] │
|
||||
│ Counter-Strike 2 │
|
||||
│ $15.99 Monthly │
|
||||
│ │
|
||||
│ ┌────────────┐ │
|
||||
│ │ Order Now │ ←BUTTON │
|
||||
│ └────────────┘ │
|
||||
└────────────────────────────┘
|
||||
```
|
||||
|
||||
Button styling:
|
||||
- Gradient background (purple/blue)
|
||||
- Rounded corners
|
||||
- Hover effect (lift up)
|
||||
- Better visibility
|
||||
|
||||
## 6. My Servers Page (NEW)
|
||||
|
||||
```
|
||||
┌────────────────────────────────────────────────────────────────────────┐
|
||||
│ My Game Servers │
|
||||
├────────────────────────────────────────────────────────────────────────┤
|
||||
│ Server Name │ Game │ Location │ Status │ Expires │ Price │ Action│
|
||||
├──────────────┼─────────┼──────────┼────────┼────────────┼───────┼───────┤
|
||||
│ My CS2 Srv │ CS2 │ US East │ Active │ Nov 22,2025│ $15.99│[Renew]│
|
||||
│ Rust Server │ Rust │ US West │ Active │ Dec 5, 2025│ $19.99│[Renew]│
|
||||
│ Minecraft │ MC │ EU │ Expired│ Oct 1, 2025│ $12.99│[Renew]│
|
||||
└──────────────┴─────────┴──────────┴────────┴────────────┴───────┴───────┘
|
||||
|
||||
Status indicators:
|
||||
- Active: Green badge
|
||||
- Inactive: Red badge
|
||||
- Expired: Red badge
|
||||
```
|
||||
|
||||
Empty state (no servers):
|
||||
```
|
||||
┌────────────────────────────────────┐
|
||||
│ My Game Servers │
|
||||
├────────────────────────────────────┤
|
||||
│ │
|
||||
│ You don't have any game servers │
|
||||
│ yet. │
|
||||
│ │
|
||||
│ ┌──────────────────────┐ │
|
||||
│ │ Browse Game Servers │ │
|
||||
│ └──────────────────────┘ │
|
||||
└────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## 7. Renew Server Page (NEW)
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ Renew Server │
|
||||
├─────────────────────────────────────┤
|
||||
│ Counter-Strike 2 Server │
|
||||
│ │
|
||||
│ ○ 1 Month - $15.99 │
|
||||
│ ○ 1 Year - $159.99 │
|
||||
│ │
|
||||
│ ┌──────────────────────┐ Cancel │
|
||||
│ │ Proceed to Payment │ │
|
||||
│ └──────────────────────┘ │
|
||||
└─────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## 8. Server Status Page (NEW)
|
||||
|
||||
```
|
||||
┌────────────────────────────────────────────────────────────────────────────┐
|
||||
│ Server Status │
|
||||
│ Real-time status of our game server infrastructure │
|
||||
├────────────────────────────────────────────────────────────────────────────┤
|
||||
│ Server │Location/IP │Status │CPU │Memory│Disk │Uptime │Updated│
|
||||
├─────────────┼─────────────┼────────────┼──────┼──────┼──────┼───────┼───────┤
|
||||
│ US-East-1 │192.168.1.10 │ [Online] │45.2% │72.1% │38.5% │30 days│2m ago │
|
||||
│ US-West-1 │192.168.1.11 │ [Online] │32.8% │65.3% │42.1% │15 days│1m ago │
|
||||
│ EU-Central-1│192.168.1.12 │[Maintenance]│N/A │N/A │N/A │N/A │Never │
|
||||
│ Asia-1 │192.168.1.13 │ [Offline] │N/A │N/A │N/A │N/A │2h ago │
|
||||
└─────────────┴─────────────┴────────────┴──────┴──────┴──────┴───────┴───────┘
|
||||
|
||||
Server status is updated automatically every 5 minutes.
|
||||
If you experience any issues, please contact support.
|
||||
```
|
||||
|
||||
Status badge colors:
|
||||
- Online: Green
|
||||
- Offline: Red
|
||||
- Maintenance: Orange
|
||||
- Unknown: Gray
|
||||
|
||||
## 9. Footer Updates
|
||||
|
||||
### Before
|
||||
```
|
||||
┌────────────────────────────────────────────────┐
|
||||
│ Privacy | TOS | Worlddomination.dev │
|
||||
└────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### After
|
||||
```
|
||||
┌────────────────────────────────────────────────────────┐
|
||||
│ Privacy | TOS | Server Status ←NEW | Worlddomination.dev│
|
||||
└────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## 10. Order Page Image Fix
|
||||
|
||||
### Before (Broken)
|
||||
```
|
||||
┌────────────────────────────┐
|
||||
│ [X] Image not found │
|
||||
│ Counter-Strike 2 │
|
||||
│ Description... │
|
||||
└────────────────────────────┘
|
||||
```
|
||||
|
||||
### After (Fixed)
|
||||
```
|
||||
┌────────────────────────────┐
|
||||
│ [✓] ┌──────────┐ │
|
||||
│ │ CS2 Image│ │
|
||||
│ └──────────┘ │
|
||||
│ Counter-Strike 2 │
|
||||
│ Description... │
|
||||
└────────────────────────────┘
|
||||
```
|
||||
|
||||
Image path changed from `images/game.png` to `../images/game.png`
|
||||
|
||||
## Color Scheme
|
||||
|
||||
All pages use consistent styling:
|
||||
|
||||
### Primary Colors
|
||||
- Purple/Blue Gradient: `#667eea` to `#764ba2`
|
||||
- White backgrounds: `#ffffff`
|
||||
- Dark backgrounds: `#0b1020`
|
||||
|
||||
### Status Colors
|
||||
- Success/Active: `#10b981` (Green)
|
||||
- Error/Expired: `#ef4444` (Red)
|
||||
- Warning/Maintenance: `#f59e0b` (Orange)
|
||||
- Info/Unknown: `#6b7280` (Gray)
|
||||
|
||||
### Typography
|
||||
- Font: System fonts (-apple-system, Segoe UI, Roboto, Arial)
|
||||
- Headings: Bold, 1.8rem
|
||||
- Body: 1rem
|
||||
- Small text: 0.9rem
|
||||
|
||||
### Buttons
|
||||
- Primary: Gradient purple/blue
|
||||
- Hover: Lift effect (translateY -2px)
|
||||
- Border radius: 8px
|
||||
- Padding: 12px 24px
|
||||
|
||||
## Responsive Design
|
||||
|
||||
All pages are mobile-responsive:
|
||||
|
||||
### Desktop (> 768px)
|
||||
- Full navigation menu
|
||||
- Side-by-side layouts
|
||||
- Larger form fields
|
||||
|
||||
### Mobile (< 768px)
|
||||
- Stacked navigation
|
||||
- Single column layouts
|
||||
- Touch-friendly buttons
|
||||
- Larger tap targets
|
||||
|
||||
## Accessibility Features
|
||||
|
||||
- Semantic HTML elements
|
||||
- Proper form labels
|
||||
- Keyboard navigation support
|
||||
- Focus indicators
|
||||
- Alt text for images
|
||||
- ARIA labels where needed
|
||||
|
||||
## Browser Compatibility
|
||||
|
||||
Tested and compatible with:
|
||||
- Chrome/Edge (latest)
|
||||
- Firefox (latest)
|
||||
- Safari (latest)
|
||||
- Mobile browsers (iOS Safari, Chrome Mobile)
|
||||
|
||||
## Performance
|
||||
|
||||
- Compressed CSS/JS
|
||||
- Optimized images
|
||||
- Cached static assets
|
||||
- Minimal database queries
|
||||
- Prepared statements for security and speed
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
Archived files from _website on 2025-10-23 14:20:00
|
||||
|
||||
This folder contains a snapshot of removed documentation and test artifacts moved from the active `_website/` tree.
|
||||
|
||||
Files moved here (original paths):
|
||||
- VISUAL_GUIDE.md
|
||||
- README_LOGIN.md
|
||||
- FEATURES.md
|
||||
- IMPLEMENTATION_SUMMARY.md
|
||||
- CONFIGURATION.md
|
||||
- test_db_connection.php
|
||||
- tools/simulate_webhook.php
|
||||
- ai.php
|
||||
- data/SIMULATED-WEBHOOK-20251022-101500.json
|
||||
|
||||
If you need to restore any of these, copy them back to the original paths.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
The detailed game docs under `_website/docs/games/` were intentionally left in place (they are product-facing).
|
||||
|
||||
Top-level documentation (VISUAL_GUIDE.md, FEATURES.md, IMPLEMENTATION_SUMMARY.md, CONFIGURATION.md, README_LOGIN.md) were archived here and removed from the active site to reduce clutter.
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
"moved_at": "2025-10-23T20:25:00Z",
|
||||
"kept": {
|
||||
"logs": "_website/logs/",
|
||||
"docs": "_website/docs/"
|
||||
},
|
||||
"files": [
|
||||
{
|
||||
"original": "_website/ai.php",
|
||||
"archived": "_website/_archived/removed-20251023-202500/ai.php",
|
||||
"size_bytes": null,
|
||||
"note": "archived sample and tools; size omitted"
|
||||
},
|
||||
{
|
||||
"original": "_website/test_db_connection.php",
|
||||
"archived": "_website/_archived/removed-20251023-202500/test_db_connection.php",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/tools/simulate_webhook.php",
|
||||
"archived": "_website/_archived/removed-20251023-202500/tools/simulate_webhook.php",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/tools/check_db_user.php",
|
||||
"archived": "_website/_archived/removed-20251023-202500/tools/check_db_user.php",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/tools/check_invoices_redirect.php",
|
||||
"archived": "_website/_archived/removed-20251023-202500/tools/check_invoices_redirect.php",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/tools/debug_invoices_redirect.php",
|
||||
"archived": "_website/_archived/removed-20251023-202500/tools/debug_invoices_redirect.php",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/tools/check_logout_redirect.php",
|
||||
"archived": "_website/_archived/removed-20251023-202500/tools/check_logout_redirect.php",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/data/SIMULATED-WEBHOOK-20251022-101500.json",
|
||||
"archived": "_website/_archived/removed-20251023-202500/data/SIMULATED-WEBHOOK-20251022-101500.json",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/data/NO-INVOICE.json",
|
||||
"archived": "_website/_archived/removed-20251023-202500/data/NO-INVOICE.json",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/data/INV-20250825-174311-0a7993.json",
|
||||
"archived": "_website/_archived/removed-20251023-202500/data/INV-20250825-174311-0a7993.json",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/data/INV-20250825-170438-e37518.json",
|
||||
"archived": "_website/_archived/removed-20251023-202500/data/INV-20250825-170438-e37518.json",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/data/FREE-549-1761246925.json",
|
||||
"archived": "_website/_archived/removed-20251023-202500/data/FREE-549-1761246925.json",
|
||||
"size_bytes": null
|
||||
},
|
||||
{
|
||||
"original": "_website/data/FREE-548-1761171178.json",
|
||||
"archived": "_website/_archived/removed-20251023-202500/data/FREE-548-1761171178.json",
|
||||
"size_bytes": null
|
||||
}
|
||||
]
|
||||
}
|
||||
325
modules/billing/_archived/removed-20251023-202500/ai.php
Normal file
325
modules/billing/_archived/removed-20251023-202500/ai.php
Normal file
|
|
@ -0,0 +1,325 @@
|
|||
<?php
|
||||
/***********************
|
||||
* Assistant Chat (Full History) — PHP + cURL
|
||||
* - Persistent thread in session
|
||||
* - Full history render with Question / Answer labels
|
||||
* - SSL verification disabled (your hosting constraint)
|
||||
* - Citations: filename + page (when available)
|
||||
***********************/
|
||||
|
||||
// Debug (disable on production)
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
/* ------------------- CONFIG ------------------- */
|
||||
$OPENAI_API_KEY = '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';
|
||||
|
||||
$ASSISTANT_ID = 'asst_RAhtGzcy6higJeMwomZSqVjM'; // <-- set to your existing assistant
|
||||
$OPENAI_BASE_URL = 'https://api.openai.com/v1';
|
||||
$OPENAI_BETA_HDR = 'assistants=v2'; // required for Assistants v2
|
||||
$REQUEST_TIMEOUT = 30; // seconds for cURL calls
|
||||
$RUN_POLL_DELAY = 500000; // microseconds between run polls (0.5s)
|
||||
$RUN_POLL_MAX = 40; // max polls (~20s total); adjust as needed
|
||||
/* ---------------------------------------------- */
|
||||
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
if (!isset($_SESSION['thread_id'])) {
|
||||
$_SESSION['thread_id'] = null;
|
||||
}
|
||||
|
||||
/** HTML escape helper */
|
||||
function h($v) { return htmlspecialchars((string)$v, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); }
|
||||
|
||||
/** Low-level OpenAI request helper */
|
||||
function openai_request($method, $endpoint, $payload = null, $query = []) {
|
||||
global $OPENAI_API_KEY;
|
||||
$url = "https://api.openai.com/v1" . $endpoint;
|
||||
if (!empty($query)) $url .= '?' . http_build_query($query);
|
||||
|
||||
$headers = [
|
||||
"Content-Type: application/json",
|
||||
"Authorization: Bearer {$OPENAI_API_KEY}",
|
||||
"OpenAI-Beta: assistants=v2"
|
||||
];
|
||||
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
|
||||
// Host requires SSL verification disabled
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
|
||||
if (!is_null($payload)) curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
|
||||
|
||||
$resp = curl_exec($ch);
|
||||
if ($resp === false) {
|
||||
$err = curl_error($ch);
|
||||
curl_close($ch);
|
||||
throw new RuntimeException("cURL error: {$err}");
|
||||
}
|
||||
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
$data = json_decode($resp, true);
|
||||
if ($code >= 400) {
|
||||
$msg = isset($data['error']['message']) ? $data['error']['message'] : 'Unknown API error';
|
||||
throw new RuntimeException("OpenAI API error ({$code}): {$msg}");
|
||||
}
|
||||
return is_array($data) ? $data : [];
|
||||
}
|
||||
|
||||
/** Create or reuse a per-visitor thread */
|
||||
function ensure_thread_id() {
|
||||
if (!empty($_SESSION['thread_id'])) return $_SESSION['thread_id'];
|
||||
$created = openai_request('POST', '/threads', ['metadata' => ['site' => $_SERVER['HTTP_HOST'] ?? 'unknown']]);
|
||||
$tid = $created['id'] ?? null;
|
||||
if (!$tid) throw new RuntimeException('Failed to create thread.');
|
||||
$_SESSION['thread_id'] = $tid;
|
||||
return $tid;
|
||||
}
|
||||
|
||||
/** Add a user message */
|
||||
function add_user_message($thread_id, $text) {
|
||||
openai_request('POST', "/threads/{$thread_id}/messages", [
|
||||
'role' => 'user',
|
||||
'content' => $text,
|
||||
]);
|
||||
}
|
||||
|
||||
/** Start a run */
|
||||
function start_run($thread_id, $assistant_id) {
|
||||
$run = openai_request('POST', "/threads/{$thread_id}/runs", [
|
||||
'assistant_id' => $assistant_id,
|
||||
]);
|
||||
$run_id = $run['id'] ?? null;
|
||||
if (!$run_id) throw new RuntimeException('Failed to start run.');
|
||||
return $run_id;
|
||||
}
|
||||
|
||||
/** Wait for completion (or fail/timeout) */
|
||||
function wait_for_run($thread_id, $run_id, $max_tries, $delay_us) {
|
||||
$terminal = ['completed', 'failed', 'requires_action', 'cancelled', 'expired'];
|
||||
for ($i = 0; $i < $max_tries; $i++) {
|
||||
usleep($delay_us);
|
||||
$run = openai_request('GET', "/threads/{$thread_id}/runs/{$run_id}");
|
||||
$status = $run['status'] ?? '';
|
||||
if (in_array($status, $terminal, true)) return $run;
|
||||
}
|
||||
return ['status' => 'timeout'];
|
||||
}
|
||||
|
||||
/** Cache of file_id => filename (per request) */
|
||||
$_FILE_NAME_CACHE = [];
|
||||
|
||||
/** Resolve file name from file_id (API returns "filename" or sometimes "display_name") */
|
||||
function get_file_name_by_id($file_id) {
|
||||
global $_FILE_NAME_CACHE;
|
||||
if (isset($_FILE_NAME_CACHE[$file_id])) return $_FILE_NAME_CACHE[$file_id];
|
||||
$file = openai_request('GET', "/files/{$file_id}");
|
||||
$name = $file['filename'] ?? ($file['display_name'] ?? ($file['name'] ?? $file_id));
|
||||
$_FILE_NAME_CACHE[$file_id] = $name;
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract message text + citations (filename + page if available).
|
||||
* Returns an array of entries: ['role' => 'user|assistant', 'text' => '...', 'refs' => [['filename'=>'','page'=>'','file_id'=>'']]]
|
||||
*/
|
||||
function normalize_messages($messages) {
|
||||
$out = [];
|
||||
if (empty($messages['data']) || !is_array($messages['data'])) return $out;
|
||||
|
||||
// The API returns newest first by default if not specifying; we request 'asc' in fetch.
|
||||
foreach ($messages['data'] as $m) {
|
||||
$role = $m['role'] ?? '';
|
||||
if (!in_array($role, ['user', 'assistant', 'system'], true)) continue;
|
||||
|
||||
if (empty($m['content']) || !is_array($m['content'])) continue;
|
||||
|
||||
$all_text = [];
|
||||
$refs = [];
|
||||
foreach ($m['content'] as $part) {
|
||||
if (($part['type'] ?? '') === 'text' && !empty($part['text']['value'])) {
|
||||
$all_text[] = $part['text']['value'];
|
||||
|
||||
// Parse annotations for citations (file_citation)
|
||||
$anns = $part['text']['annotations'] ?? [];
|
||||
if (is_array($anns)) {
|
||||
foreach ($anns as $ann) {
|
||||
if (($ann['type'] ?? '') === 'file_citation' && !empty($ann['file_citation']['file_id'])) {
|
||||
$fid = $ann['file_citation']['file_id'];
|
||||
$page = null;
|
||||
|
||||
// Page can appear under different shapes depending on backend. Try common keys:
|
||||
if (isset($ann['file_citation']['page'])) {
|
||||
$page = $ann['file_citation']['page'];
|
||||
} elseif (isset($ann['file_citation']['page_range']) && is_array($ann['file_citation']['page_range'])) {
|
||||
// Example: ['start' => 5, 'end' => 6]
|
||||
$start = $ann['file_citation']['page_range']['start'] ?? null;
|
||||
$end = $ann['file_citation']['page_range']['end'] ?? null;
|
||||
if ($start && $end && $start !== $end) $page = "{$start}-{$end}";
|
||||
elseif ($start) $page = (string)$start;
|
||||
}
|
||||
// Fetch filename
|
||||
try {
|
||||
$filename = get_file_name_by_id($fid);
|
||||
} catch (Throwable $e) {
|
||||
$filename = $fid;
|
||||
}
|
||||
$refs[] = [
|
||||
'file_id' => $fid,
|
||||
'filename' => $filename,
|
||||
'page' => $page ?? 'n/a',
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($all_text)) {
|
||||
$out[] = [
|
||||
'role' => $role,
|
||||
'text' => implode("\n", $all_text),
|
||||
'refs' => $refs,
|
||||
];
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/** Fetch conversation (ascending) */
|
||||
function fetch_history($thread_id) {
|
||||
$messages = openai_request('GET', "/threads/{$thread_id}/messages", null, ['order' => 'asc', 'limit' => 50]);
|
||||
return normalize_messages($messages);
|
||||
}
|
||||
|
||||
/* ------------------- HANDLE POST ------------------- */
|
||||
$error = null;
|
||||
$history = [];
|
||||
|
||||
try {
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (!empty($_POST['reset_thread'])) {
|
||||
$_SESSION['thread_id'] = null;
|
||||
} elseif (isset($_POST['user_input'])) {
|
||||
$user_text = trim((string)$_POST['user_input']);
|
||||
if ($user_text !== '') {
|
||||
$thread_id = ensure_thread_id();
|
||||
add_user_message($thread_id, $user_text);
|
||||
$run_id = start_run($thread_id, $ASSISTANT_ID);
|
||||
$run = wait_for_run($thread_id, $run_id, $POLL_MAX_TRIES, $RUN_POLL_DELAY);
|
||||
|
||||
if (($run['status'] ?? '') === 'failed') {
|
||||
$error = 'Assistant run failed.';
|
||||
} elseif (($run['status'] ?? '') === 'requires_action') {
|
||||
// If you later support tool calls, handle them here then submit outputs.
|
||||
} elseif (($run['status'] ?? '') === 'timeout') {
|
||||
$error = 'Assistant timed out. Please try again.';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_SESSION['thread_id'])) {
|
||||
$history = fetch_history($_SESSION['thread_id']);
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$error = $e->getMessage();
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
// Include top and menu for website UI (session already started above)
|
||||
include(__DIR__ . '/includes/top.php');
|
||||
include(__DIR__ . '/includes/menu.php');
|
||||
?>
|
||||
<!-- UI -->
|
||||
<div class="ai-container">
|
||||
<h3>Site Assistant</h3>
|
||||
<p>Type a question below. Press <b>Enter</b> to send, <b>Shift+Enter</b> for a new line.</p>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div class="ai-alert" style="border:1px solid #c00;">
|
||||
<strong>Error:</strong> <?php echo h($error); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($_SESSION['thread_id'])): ?>
|
||||
<div class="ai-msg-meta">Thread: <?php echo h($_SESSION['thread_id']); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form id="chat-form" method="post" style="margin:12px 0;">
|
||||
<textarea id="chat-input" name="user_input" rows="3" class="ai-textarea" placeholder="Ask your question..."></textarea>
|
||||
<div style="margin-top:8px; display:flex; gap:8px;">
|
||||
<button type="submit">Send</button>
|
||||
<button type="submit" name="reset_thread" value="1">Reset Conversation</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if (!empty($history) && is_array($history)): ?>
|
||||
<div style="margin-top:16px; padding:10px; border:1px solid #ccc; border-radius:8px;">
|
||||
<?php foreach ($history as $msg):
|
||||
// Label mapping: user => Question, assistant => Answer, system => (optional)
|
||||
$role = $msg['role'] ?? 'assistant';
|
||||
if ($role === 'user') $label = 'Question';
|
||||
elseif ($role === 'assistant') $label = 'Answer';
|
||||
else $label = ucfirst($role); // e.g., System
|
||||
$text = str_replace("\r\n", "\n", $msg['text'] ?? '');
|
||||
$refs = $msg['refs'] ?? [];
|
||||
?>
|
||||
<div style="margin-bottom:14px;">
|
||||
<div style="font-weight:bold;"><?php echo h($label); ?></div>
|
||||
<div style="white-space:pre-wrap;"><?php echo nl2br(h($text)); ?></div>
|
||||
|
||||
<?php if (!empty($refs)): ?>
|
||||
<div style="margin-top:6px; font-size:12px;">
|
||||
<em>References:</em>
|
||||
<ul style="margin:6px 0 0 18px; padding:0;">
|
||||
<?php foreach ($refs as $r):
|
||||
$fname = $r['filename'] ?? 'file';
|
||||
$page = $r['page'] ?? 'n/a';
|
||||
// If you have your own document links, replace '#' with a real URL.
|
||||
?>
|
||||
<li>
|
||||
<a href="#" title="file_id: <?php echo h($r['file_id']); ?>">
|
||||
<?php echo h($fname); ?> — page <?php echo h($page); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="margin-top:10px; color:#666;">No messages yet.</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="margin-top:10px; font-size:12px; color:#555;">
|
||||
Conversation persists until you click “Reset Conversation”.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit on Enter (Shift+Enter = newline) -->
|
||||
<script>
|
||||
(function(){
|
||||
var form = document.getElementById('chat-form');
|
||||
var input = document.getElementById('chat-input');
|
||||
|
||||
input.addEventListener('keydown', function(e){
|
||||
if (e.key === 'Enter') {
|
||||
if (!e.shiftKey) {
|
||||
e.preventDefault();
|
||||
form.submit();
|
||||
}
|
||||
// if Shift+Enter, allow newline
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"event_type": "PAYMENT.CAPTURE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": 0,
|
||||
"currency": "USD",
|
||||
"payer": "iaretechnician@gmail.com",
|
||||
"invoice": "FREE-548-1761171178",
|
||||
"custom": "admin_free_create_order_548",
|
||||
"resource_id": "FREE-439c594e1e65",
|
||||
"items": [],
|
||||
"ts": "2025-10-23T00:12:58+02:00"
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"event_type": "PAYMENT.CAPTURE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": 0,
|
||||
"currency": "USD",
|
||||
"payer": "iaretechnician@gmail.com",
|
||||
"invoice": "FREE-549-1761246925",
|
||||
"custom": "admin_free_create_order_549",
|
||||
"resource_id": "FREE-439c594e1e65",
|
||||
"items": [],
|
||||
"ts": "2025-10-23T00:12:58+02:00"
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"event_type": "PAYMENT.CAPTURE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": "19.99",
|
||||
"currency": "USD",
|
||||
"payer": null,
|
||||
"invoice": "INV-20250825-170438-e37518",
|
||||
"custom": "user_1234_order_5678",
|
||||
"resource_id": "2V315801FX904340P",
|
||||
"ts": "2025-08-25T17:05:27-04:00"
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"event_type": "PAYMENT.CAPTURE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": "19.99",
|
||||
"currency": "USD",
|
||||
"payer": null,
|
||||
"invoice": "INV-20250825-174311-0a7993",
|
||||
"custom": "user_1234_order_5678",
|
||||
"resource_id": "2V315801FX904340P",
|
||||
"ts": "2025-08-25T17:05:27-04:00"
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"event_type": "PAYMENT.SALE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": "0.48",
|
||||
"currency": "USD",
|
||||
"payer": null,
|
||||
"invoice": null,
|
||||
"custom": null,
|
||||
"ts": "2025-08-25T16:46:11-04:00"
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"event_type": "PAYMENT.CAPTURE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": "9.99",
|
||||
"currency": "USD",
|
||||
"invoice": "INV-20251022-101500-TEST",
|
||||
"resource_id": "SIMULATED12345",
|
||||
"ts": "2025-10-22T10:15:00-04:00",
|
||||
"note": "Simulated webhook write for testing"
|
||||
}
|
||||
|
|
@ -1,142 +1,175 @@
|
|||
<?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.
|
||||
*
|
||||
*/
|
||||
// _website/add_to_cart.php
|
||||
// Handle Add to Cart posts from order.php
|
||||
require_once(__DIR__ . '/includes/config.inc.php');
|
||||
require_once(__DIR__ . '/includes/login_required.php');
|
||||
require_once(__DIR__ . '/includes/log.php');
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db ,$view;
|
||||
$settings = $db->getSettings();
|
||||
// Start session if not already
|
||||
if (session_status() === PHP_SESSION_NONE) session_start();
|
||||
|
||||
//The service id should also be cast to an int.
|
||||
$service_id = intval($_REQUEST['service_id']);
|
||||
// Immediate request tracing log (helps confirm the script is hit)
|
||||
@mkdir(__DIR__ . '/logs', 0775, true);
|
||||
$trace_file = __DIR__ . '/logs/add_to_cart_requests.log';
|
||||
file_put_contents($trace_file, date('c') . " - REQUEST_METHOD=" . ($_SERVER['REQUEST_METHOD'] ?? '') . " URI=" . ($_SERVER['REQUEST_URI'] ?? '') . "\n", FILE_APPEND);
|
||||
|
||||
// Query for Selected service info.
|
||||
$qry_service = "SELECT DISTINCT service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, slot_max_qty, slot_min_qty, price_daily, price_monthly, price_year, description, img_url FROM OGP_DB_PREFIXbilling_services WHERE service_id=".$db->realEscapeSingle($service_id);
|
||||
$result_service = $db->resultQuery($qry_service);
|
||||
$row_service = $result_service[0];
|
||||
//Compiling info about invoice to create an invoice order.
|
||||
|
||||
/*
|
||||
Check if it's numeric before used in the WHERE clause... otherwise an SQL error is possible currently.
|
||||
If it's not an int (or if it's 0 after casting and or not vaild service) redirect to the shop page.
|
||||
*/
|
||||
if ($service_id <= 0 || $result_service === false){
|
||||
$view->refresh("home.php?m=billing&p=shop");
|
||||
return;
|
||||
}
|
||||
|
||||
// remote server value
|
||||
//is now held in the the IP_ID value
|
||||
//$remote_server_id = $row_service['remote_server_id'];
|
||||
$remote_server_id = $_POST['ip_id'];
|
||||
|
||||
// request ogp user to create a home path.
|
||||
$r_server = $db->getRemoteServer($remote_server_id);
|
||||
$ogp_user = $r_server['ogp_user'];
|
||||
|
||||
// request the user name and the game name to generate a game home name.
|
||||
$home_name = $_POST['home_name'];
|
||||
|
||||
//Calculating Price
|
||||
if ($_POST['invoice_duration'] == "day")
|
||||
{
|
||||
$price_slot=$row_service['price_daily'];
|
||||
}
|
||||
elseif ($_POST['invoice_duration'] == "month")
|
||||
{
|
||||
$price_slot=$row_service['price_monthly'];
|
||||
}
|
||||
elseif ($_POST['invoice_duration'] == "year")
|
||||
{
|
||||
$price_slot=$row_service['price_year']*12;
|
||||
}
|
||||
else
|
||||
{
|
||||
$price_slot=$row_service['price_monthly'];
|
||||
}
|
||||
|
||||
|
||||
//Game Server Values
|
||||
$ip_id = $_POST['ip_id'];
|
||||
$ip = $db->getIpById($ip_id);
|
||||
$max_players = $_POST['max_players'];
|
||||
$qty = $_POST['qty'];
|
||||
$invoice_duration = $_POST['invoice_duration'];
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$remote_control_password = $_POST['remote_control_password'];
|
||||
$ftp_password = $_POST['ftp_password'];
|
||||
$tax_amount = $settings['tax_amount'];
|
||||
$currency = $settings['currency'];
|
||||
|
||||
/*
|
||||
Cast $_REQUEST['service_id'] to an int and then check if its value is higher than 0 before using it in the WHERE clause.
|
||||
Checking if it's higher than 0 because if it's a non-numeric value, after casting it to an int it'll be 0.
|
||||
*/
|
||||
if($service_id !== 0) $where_service_id = " WHERE service_id=".$db->realEscapeSingle($service_id); else $where_service_id = "";
|
||||
$qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$services = $db->resultQuery($qry_services);
|
||||
foreach ($services as $key => $row) {
|
||||
if($max_players < $row['slot_min_qty'] || $qty < 1){
|
||||
$max_players = $row['slot_min_qty'];
|
||||
$qty = 1;
|
||||
}
|
||||
/*
|
||||
An extra check added for the inverse: check max_players against slot_max_qty.
|
||||
It would be good to do in the event someone is only selling a max of 16 slots per server.
|
||||
*/
|
||||
elseif ($max_players > $row['slot_max_qty'])
|
||||
{
|
||||
$max_players = $row['slot_max_qty'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( isset( $_POST["add_to_cart"] ) )
|
||||
{
|
||||
if( isset( $_SESSION['CART'] ) )
|
||||
{
|
||||
$i = count( $_SESSION['CART'] );
|
||||
$i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$i = 0;
|
||||
}
|
||||
|
||||
$_SESSION['CART'][$i] = array( "cart_id" => $i,
|
||||
"service_id" => $service_id,
|
||||
"home_name" => $home_name,
|
||||
"ip" => $ip_id,
|
||||
"max_players" => $max_players,
|
||||
"qty" => $qty,
|
||||
"invoice_duration" => $invoice_duration,
|
||||
"price" => $price_slot,
|
||||
"remote_control_password" => $remote_control_password,
|
||||
"ftp_password" => $ftp_password,
|
||||
"tax_amount" => $tax_amount,
|
||||
"currency" => $currency,
|
||||
"paid" => 0);
|
||||
echo '<meta http-equiv="refresh" content="0;url=?m=billing&p=cart">';
|
||||
}
|
||||
// Prefer website session id if set (login.php sets website_user_id in debug mode)
|
||||
$user_id = 0;
|
||||
if (isset($_SESSION['website_user_id']) && !empty($_SESSION['website_user_id'])) {
|
||||
$user_id = intval($_SESSION['website_user_id']);
|
||||
} elseif (isset($_SESSION['user_id']) && !empty($_SESSION['user_id'])) {
|
||||
$user_id = intval($_SESSION['user_id']);
|
||||
}
|
||||
// If we don't have a numeric user_id but have a username, try to resolve it from the panel DB
|
||||
if ($user_id <= 0 && isset($_SESSION['website_username']) && !empty($_SESSION['website_username'])) {
|
||||
$uname = trim((string)$_SESSION['website_username']);
|
||||
// attempt to lookup in DB (if connection available later we will set session after connecting)
|
||||
// We'll set a temporary flag to resolve after DB connection is established below
|
||||
$resolve_username_for_user_id = $uname;
|
||||
} else {
|
||||
$resolve_username_for_user_id = null;
|
||||
}
|
||||
/*
|
||||
if ($user_id <= 0) {
|
||||
// Not logged in - redirect to login with return
|
||||
$return = urlencode('/' . trim(str_replace('\\', '/', $_SERVER['REQUEST_URI']), '/'));
|
||||
header('Location: ' . (isset($SITE_BASE_URL) ? $SITE_BASE_URL : '') . '/_website/login.php?return_to=' . $return);
|
||||
exit;
|
||||
}*/
|
||||
|
||||
// Basic validation and normalization
|
||||
$service_id = isset($_POST['service_id']) ? intval($_POST['service_id']) : 0;
|
||||
$home_name = isset($_POST['home_name']) ? trim($_POST['home_name']) : '';
|
||||
$ip_id = isset($_POST['ip_id']) ? intval($_POST['ip_id']) : 0;
|
||||
$max_players = isset($_POST['max_players']) ? intval($_POST['max_players']) : 0;
|
||||
$qty = isset($_POST['qty']) ? intval($_POST['qty']) : 1;
|
||||
$invoice_duration = isset($_POST['invoice_duration']) ? $_POST['invoice_duration'] : 'month';
|
||||
$remote_control_password = isset($_POST['remote_control_password']) ? $_POST['remote_control_password'] : '';
|
||||
$ftp_password = isset($_POST['ftp_password']) ? $_POST['ftp_password'] : '';
|
||||
|
||||
// Price lookup: try to find service price_monthly
|
||||
$db = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
|
||||
if (!$db) {
|
||||
// Log connection error and exit
|
||||
@mkdir(__DIR__ . '/logs', 0775, true);
|
||||
$trace = __DIR__ . '/logs/add_to_cart.log';
|
||||
file_put_contents($trace, date('c') . " - mysqli_connect failed: " . mysqli_connect_error() . "\n", FILE_APPEND);
|
||||
die('DB connection failed');
|
||||
} else {
|
||||
// Log that config was loaded (mask password)
|
||||
@mkdir(__DIR__ . '/logs', 0775, true);
|
||||
$trace = __DIR__ . '/logs/add_to_cart.log';
|
||||
$masked_pass = strlen($db_pass) ? '***' : '';
|
||||
file_put_contents($trace, date('c') . " - DB connected host={$db_host} user={$db_user} pass={$masked_pass} db={$db_name}\n", FILE_APPEND);
|
||||
}
|
||||
|
||||
// If we deferred resolving username to user_id, do it now with the DB connection
|
||||
if (!empty($resolve_username_for_user_id) && $db) {
|
||||
$safe_uname = mysqli_real_escape_string($db, $resolve_username_for_user_id);
|
||||
// users_login is the correct column name in this schema
|
||||
$q = mysqli_query($db, "SELECT user_id FROM ogp_users WHERE users_login = '$safe_uname' LIMIT 1");
|
||||
if ($q && mysqli_num_rows($q) === 1) {
|
||||
$r = mysqli_fetch_assoc($q);
|
||||
$user_id = intval($r['user_id'] ?? 0);
|
||||
// persist into session for subsequent requests
|
||||
if ($user_id > 0) {
|
||||
$_SESSION['website_user_id'] = $user_id;
|
||||
site_log_info('resolved_user_id_from_username', ['username'=>$resolve_username_for_user_id,'user_id'=>$user_id]);
|
||||
// Also resolve and persist the user's role so menus and admin checks are consistent
|
||||
$role_q = mysqli_query($db, "SELECT users_role FROM ogp_users WHERE user_id = " . intval($user_id) . " LIMIT 1");
|
||||
if ($role_q && mysqli_num_rows($role_q) === 1) {
|
||||
$role_row = mysqli_fetch_assoc($role_q);
|
||||
$_SESSION['website_user_role'] = $role_row['users_role'] ?? '';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
site_log_warn('resolve_user_failed', ['username'=>$resolve_username_for_user_id]);
|
||||
}
|
||||
}
|
||||
|
||||
$price = 0.0;
|
||||
if ($service_id > 0) {
|
||||
$stmt = $db->prepare('SELECT price_monthly, slot_min_qty, slot_max_qty FROM ogp_billing_services WHERE service_id = ? LIMIT 1');
|
||||
if ($stmt) {
|
||||
$stmt->bind_param('i', $service_id);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($price_monthly, $slot_min_qty, $slot_max_qty);
|
||||
if ($stmt->fetch()) {
|
||||
$price = floatval($price_monthly);
|
||||
// constrain slots
|
||||
if ($max_players < $slot_min_qty) $max_players = $slot_min_qty;
|
||||
if ($max_players > $slot_max_qty) $max_players = $slot_max_qty;
|
||||
}
|
||||
$stmt->close();
|
||||
}
|
||||
}
|
||||
|
||||
// Insert into ogp_billing_orders
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$status = 'in-cart';
|
||||
|
||||
// Normal flow: process POST immediately. If debug=1 is passed, we'll still log SQL and show results in logs.
|
||||
$debug = (isset($_GET['debug']) && $_GET['debug'] == '1') || (isset($_POST['debug']) && $_POST['debug'] == '1');
|
||||
|
||||
// Build and execute a simple INSERT using mysqli_query for debugging clarity
|
||||
@mkdir(__DIR__ . '/logs', 0775, true);
|
||||
$logfile = __DIR__ . '/logs/add_to_cart.log';
|
||||
site_log_info('add_to_cart_invoked', ['user_id'=>$user_id, 'service_id'=>$service_id]);
|
||||
|
||||
// Escape values
|
||||
$esc_user_id = intval($user_id);
|
||||
$esc_service_id = intval($service_id);
|
||||
$esc_home_name = mysqli_real_escape_string($db, $home_name);
|
||||
$esc_ip_id = intval($ip_id);
|
||||
$esc_max_players = intval($max_players);
|
||||
$esc_qty = intval($qty);
|
||||
$esc_invoice_duration = mysqli_real_escape_string($db, $invoice_duration);
|
||||
$esc_price = number_format((float)$price, 2, '.', '');
|
||||
$esc_remote_control_password = mysqli_real_escape_string($db, $remote_control_password);
|
||||
$esc_ftp_password = mysqli_real_escape_string($db, $ftp_password);
|
||||
$esc_status = mysqli_real_escape_string($db, $status);
|
||||
|
||||
$sql = "INSERT INTO ogp_billing_orders (user_id, service_id, home_name, ip, max_players, qty, invoice_duration, price, remote_control_password, ftp_password, status) VALUES ({$esc_user_id}, {$esc_service_id}, '{$esc_home_name}', {$esc_ip_id}, {$esc_max_players}, {$esc_qty}, '{$esc_invoice_duration}', {$esc_price}, '{$esc_remote_control_password}', '{$esc_ftp_password}', '{$esc_status}')";
|
||||
|
||||
// Compute finish_date = now + 3 days
|
||||
$finish_dt = new DateTime('now');
|
||||
$finish_dt->modify('+3 days');
|
||||
$finish_date = $finish_dt->format('Y-m-d H:i:s');
|
||||
|
||||
// Check if the ogp_billing_orders table has a finish_date column; if so include it in the INSERT
|
||||
$has_finish = false;
|
||||
$col_check_q = mysqli_query($db, "SHOW COLUMNS FROM ogp_billing_orders LIKE 'finish_date'");
|
||||
if ($col_check_q && mysqli_num_rows($col_check_q) > 0) {
|
||||
$has_finish = true;
|
||||
}
|
||||
|
||||
if ($has_finish) {
|
||||
$esc_finish_date = mysqli_real_escape_string($db, $finish_date);
|
||||
$sql = "INSERT INTO ogp_billing_orders (user_id, service_id, home_name, ip, max_players, qty, invoice_duration, price, remote_control_password, ftp_password, status, finish_date) VALUES ({$esc_user_id}, {$esc_service_id}, '{$esc_home_name}', {$esc_ip_id}, {$esc_max_players}, {$esc_qty}, '{$esc_invoice_duration}', {$esc_price}, '{$esc_remote_control_password}', '{$esc_ftp_password}', '{$esc_status}', '{$esc_finish_date}')";
|
||||
file_put_contents($logfile, date('c') . " - finish_date included: {$esc_finish_date}\n", FILE_APPEND);
|
||||
} else {
|
||||
file_put_contents($logfile, date('c') . " - finish_date column not present, skipping finish_date. computed_finish_date={$finish_date}\n", FILE_APPEND);
|
||||
}
|
||||
|
||||
site_log_info('add_to_cart_sql', ['sql'=>$sql]);
|
||||
|
||||
$res = mysqli_query($db, $sql);
|
||||
if (!$res) {
|
||||
$err_no = mysqli_errno($db);
|
||||
$err = mysqli_error($db);
|
||||
site_log_error('mysqli_query_failed', ['errno'=>$err_no, 'error'=>$err, 'sql'=>$sql]);
|
||||
// Log table existence check
|
||||
$tbl_check = mysqli_query($db, "SHOW TABLES LIKE 'ogp_billing_orders'");
|
||||
$tbl_exists = ($tbl_check && mysqli_num_rows($tbl_check) > 0) ? 'yes' : 'no';
|
||||
site_log_warn('ogp_billing_orders_exists', ['exists'=>$tbl_exists]);
|
||||
} else {
|
||||
$insert_id = mysqli_insert_id($db);
|
||||
$affected = mysqli_affected_rows($db);
|
||||
site_log_info('add_to_cart_insert', ['insert_id'=>$insert_id, 'affected_rows'=>$affected]);
|
||||
}
|
||||
|
||||
// Redirect to cart page
|
||||
header('Location: cart.php');
|
||||
exit;
|
||||
|
||||
?>
|
||||
|
|
|
|||
68
modules/billing/admin.php
Normal file
68
modules/billing/admin.php
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
// Admin landing page
|
||||
require_once(__DIR__ . '/includes/admin_auth.php');
|
||||
require_once(__DIR__ . '/includes/config.inc.php');
|
||||
include(__DIR__ . '/includes/top.php');
|
||||
include(__DIR__ . '/includes/menu.php');
|
||||
|
||||
function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Admin — Dashboard</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="css/header.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-wide panel">
|
||||
<h1>Admin Dashboard</h1>
|
||||
<p>Welcome to the admin area. From here you can manage servers, payments, and site settings.</p>
|
||||
|
||||
<div style="display:flex;gap:12px;flex-wrap:wrap;margin-top:12px;">
|
||||
<a class="btn-primary" href="adminserverlist.php">Manage Servers & Services</a>
|
||||
<a class="btn-primary" href="./invoices.php">Invoice History</a>
|
||||
<a class="btn-primary" href="admin_config.php">Edit Site Config</a>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<h3>Quick usage notes</h3>
|
||||
<ul>
|
||||
<li>The <strong>Manage Servers & Services</strong> page allows enabling/disabling nodes and editing service rows.</li>
|
||||
<li>The <strong>Invoice History</strong> page reads JSON payment records from <code><?php echo h($SITE_DATA_DIR); ?></code>.</li>
|
||||
<li>The <strong>Edit Site Config</strong> page edits <code>_website/includes/config.inc.php</code>. Edits create a timestamped backup before saving.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Sandbox account (testing)</h3>
|
||||
<p>Use PayPal sandbox credentials when testing payments. Set your sandbox <code>client_id</code> and <code>client_secret</code> in the runtime config that the payment handlers use (for this site those are in the respective files under <code>_website/api/</code> or in a central config if you moved credentials).</p>
|
||||
<ul>
|
||||
<li>Create a sandbox business account at <a href="https://developer.paypal.com">PayPal Developer</a> and obtain a sandbox client ID/secret.</li>
|
||||
<li>Update the payment handler config and restart the webserver if required.</li>
|
||||
<li>Run a checkout using the PayPal JS button on the checkout page — after payment completes, the webhook will record a JSON file into <code><?php echo h($SITE_DATA_DIR); ?></code>.</li>
|
||||
<li>If you need to simulate a webhook locally, drop a JSON file with the same schema into the <code>data/</code> folder (we added a sample: <code>SIMULATED-WEBHOOK-*.json</code>).</li>
|
||||
</ul>
|
||||
|
||||
<h3>Payments: high-level program flow</h3>
|
||||
<ol>
|
||||
<li>User adds an item and proceeds to checkout (<code>_website/cart.php</code>).</li>
|
||||
<li>The checkout page renders the PayPal JS SDK and calls server-side endpoints (create_order/capture_order).</li>
|
||||
<li>After a successful capture, PayPal sends a webhook event to <code>_website/webhook.php</code> (or the equivalent handler under <code>_website/api/</code>).</li>
|
||||
<li>The webhook verifies the signature, fetches any missing order details, and writes a JSON record to the <code>data/</code> directory (this powers <code>invoices.php</code> and <code>return.php</code>).</li>
|
||||
<li>On successful payment we mark the order as PAID in the JSON and the site UI (invoices/returns) reads those JSONs to render receipts.</li>
|
||||
<li>Admin pages can view invoices at <code>./invoices.php</code> and reconcile or trigger further provisioning via internal panel APIs.</li>
|
||||
</ol>
|
||||
|
||||
<h3>Environment</h3>
|
||||
<table class="cart-table">
|
||||
<tr><th>Site Base URL</th><td><?php echo h($SITE_BASE_URL ?: '(empty — using relative paths)'); ?></td></tr>
|
||||
<tr><th>Data directory</th><td><?php echo h($SITE_DATA_DIR); ?></td></tr>
|
||||
<tr><th>PHP SAPI</th><td><?php echo h(PHP_SAPI); ?></td></tr>
|
||||
<tr><th>Writable?</th><td><?php echo is_writable(__DIR__ . '/data') ? 'yes' : 'no'; ?></td></tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<?php include(__DIR__ . '/includes/footer.php'); ?>
|
||||
</body>
|
||||
</html>
|
||||
103
modules/billing/admin_config.php
Normal file
103
modules/billing/admin_config.php
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
<?php
|
||||
// Admin config editor — lightweight editor for _website/includes/config.inc.php
|
||||
require_once(__DIR__ . '/includes/admin_auth.php');
|
||||
require_once(__DIR__ . '/includes/config.inc.php');
|
||||
include(__DIR__ . '/includes/top.php');
|
||||
include(__DIR__ . '/includes/menu.php');
|
||||
|
||||
session_start();
|
||||
if (empty($_SESSION['admin_csrf'])) $_SESSION['admin_csrf'] = bin2hex(random_bytes(16));
|
||||
$csrf = $_SESSION['admin_csrf'];
|
||||
|
||||
$cfgPath = __DIR__ . '/includes/config.inc.php';
|
||||
|
||||
function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }
|
||||
|
||||
$status = '';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$token = $_POST['csrf'] ?? '';
|
||||
if (!hash_equals($csrf, (string)$token)) {
|
||||
$status = 'Invalid CSRF token.';
|
||||
} else {
|
||||
if (!is_writable($cfgPath)) {
|
||||
$status = 'Config file not writable: ' . h($cfgPath);
|
||||
} else {
|
||||
// Backup
|
||||
$bakDir = dirname($cfgPath) . '/backups';
|
||||
@mkdir($bakDir, 0775, true);
|
||||
$bakName = $bakDir . '/config.inc.php.' . date('Ymd-His') . '.' . bin2hex(random_bytes(4)) . '.bak';
|
||||
if (!copy($cfgPath, $bakName)) {
|
||||
$status = 'Failed to create backup. Aborting.';
|
||||
} else {
|
||||
$new = $_POST['config_text'] ?? '';
|
||||
// Basic safety: ensure the file still starts with <?php
|
||||
if (strpos(trim($new), '<?php') !== 0) {
|
||||
$status = 'Config must start with <?php';
|
||||
} else {
|
||||
if (file_put_contents($cfgPath, $new) === false) {
|
||||
$status = 'Failed to write config file.';
|
||||
} else {
|
||||
// Post-save syntax check: try to run php -l using a sensible PHP executable.
|
||||
$phpExec = PHP_BINARY ?: (file_exists('C:\\xampp\\php\\php.exe') ? 'C:\\xampp\\php\\php.exe' : null);
|
||||
$lintOk = true;
|
||||
$lintOutput = '';
|
||||
if ($phpExec) {
|
||||
$cmd = escapeshellarg($phpExec) . ' -l ' . escapeshellarg($cfgPath);
|
||||
// execute and capture output
|
||||
$out = null; $rc = null;
|
||||
@exec($cmd . ' 2>&1', $out, $rc);
|
||||
$lintOutput = is_array($out) ? implode("\n", $out) : (string)$out;
|
||||
if ($rc !== 0) {
|
||||
$lintOk = false;
|
||||
}
|
||||
} else {
|
||||
$lintOutput = 'PHP executable not found for linting; skipping post-save syntax check.';
|
||||
}
|
||||
|
||||
if (!$lintOk) {
|
||||
// rollback
|
||||
@copy($bakName, $cfgPath);
|
||||
$status = 'Syntax error detected in saved config. Changes rolled back. Lint output: ' . h($lintOutput);
|
||||
} else {
|
||||
$status = 'Config saved successfully. Backup: ' . basename($bakName) . (strlen($lintOutput) ? ' (lint: '.h($lintOutput).')' : '');
|
||||
// reload values
|
||||
require_once($cfgPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$currentText = '';
|
||||
if (is_readable($cfgPath)) {
|
||||
$currentText = file_get_contents($cfgPath);
|
||||
}
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Admin — Edit Config</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="css/header.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-wide panel">
|
||||
<h1>Edit Site Config</h1>
|
||||
<?php if ($status): ?><div class="panel"><strong><?php echo h($status); ?></strong></div><?php endif; ?>
|
||||
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="csrf" value="<?php echo h($csrf); ?>">
|
||||
<div style="margin-bottom:8px;"><button type="submit">Save Config</button></div>
|
||||
<textarea name="config_text" rows="24" style="width:100%;font-family:monospace;"><?php echo h($currentText); ?></textarea>
|
||||
<div style="margin-top:8px;"><button type="submit">Save Config</button></div>
|
||||
</form>
|
||||
|
||||
<p><small>Backups are stored in <code><?php echo h(dirname($cfgPath) . '/backups'); ?></code></small></p>
|
||||
</div>
|
||||
<?php include(__DIR__ . '/includes/footer.php'); ?>
|
||||
</body>
|
||||
</html>
|
||||
59
modules/billing/admin_payments.php
Normal file
59
modules/billing/admin_payments.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
// Admin payments viewer — lists persisted PayPal webhook JSON files
|
||||
$session_name = session_name(); session_start();
|
||||
require_once(__DIR__ . '/includes/config.inc.php');
|
||||
require_once(__DIR__ . '/includes/admin_auth.php');
|
||||
|
||||
$dataDir = (isset($SITE_DATA_DIR) && $SITE_DATA_DIR) ? $SITE_DATA_DIR : realpath(__DIR__ . '/') . DIRECTORY_SEPARATOR . 'data';
|
||||
$files = [];
|
||||
if (is_dir($dataDir)) {
|
||||
foreach (glob($dataDir . '/*.json') as $file) {
|
||||
$files[] = $file;
|
||||
}
|
||||
}
|
||||
function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }
|
||||
?>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Admin — Payments</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="css/header.css">
|
||||
</head>
|
||||
<body>
|
||||
<?php include(__DIR__ . '/includes/top.php'); include(__DIR__ . '/includes/menu.php'); ?>
|
||||
<div class="container-wide panel">
|
||||
<h1>Payments (webhook)</h1>
|
||||
<?php if (!$files): ?>
|
||||
<p>No payment records found in <?php echo h($dataDir); ?></p>
|
||||
<?php else: ?>
|
||||
<table class="cart-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Filename</th>
|
||||
<th>Invoice</th>
|
||||
<th>Amount</th>
|
||||
<th>Payer</th>
|
||||
<th>Date</th>
|
||||
<th>View</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($files as $f): $j = json_decode(file_get_contents($f), true) ?: []; ?>
|
||||
<tr>
|
||||
<td><?php echo h(basename($f)); ?></td>
|
||||
<td><?php echo h($j['invoice'] ?? ($j['custom'] ?? '')); ?></td>
|
||||
<td><?php echo h(($j['currency'] ?? '') . ' ' . number_format((float)($j['amount'] ?? 0),2)); ?></td>
|
||||
<td><?php echo h($j['payer'] ?? ''); ?></td>
|
||||
<td><?php echo h($j['ts'] ?? ''); ?></td>
|
||||
<td><a href="return.php?invoice=<?php echo urlencode($j['invoice'] ?? ($j['custom'] ?? '')); ?>">View</a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php include(__DIR__ . '/includes/footer.php'); ?>
|
||||
</body>
|
||||
</html>
|
||||
338
modules/billing/adminserverlist.php
Normal file
338
modules/billing/adminserverlist.php
Normal file
|
|
@ -0,0 +1,338 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Admin Server List - GameServers.World</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
// gameservers.world admin — mysqli only, bulk + per-row update, image base URL + small button
|
||||
|
||||
/* === SITE_BASE_URL is loaded from includes/config.inc.php; leave empty to use relative paths === */
|
||||
|
||||
// Include database configuration
|
||||
require_once(__DIR__ . '/includes/config.inc.php');
|
||||
|
||||
// Protect this page: require admin
|
||||
require_once(__DIR__ . '/includes/admin_auth.php');
|
||||
|
||||
// Create database connection (admin_auth already validated DB but we need connection for UI ops)
|
||||
$db = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
|
||||
if (!$db) {
|
||||
die("Connection failed: " . mysqli_connect_error());
|
||||
}
|
||||
|
||||
// Include top bar and menu
|
||||
include(__DIR__ . '/includes/top.php');
|
||||
include(__DIR__ . '/includes/menu.php');
|
||||
|
||||
/* show errors during setup */
|
||||
@ini_set('display_errors','1');
|
||||
error_reporting(E_ALL);
|
||||
function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }
|
||||
function esc_mysqli($db, $v){ return $db->real_escape_string($v); }
|
||||
function fetch_all_assoc($db, $sql){
|
||||
$res = $db->query($sql);
|
||||
return $res ? $res->fetch_all(MYSQLI_ASSOC) : [];
|
||||
}
|
||||
function col_exists($db, $table, $col){
|
||||
$res = $db->query("SHOW COLUMNS FROM `$table` LIKE '".$db->real_escape_string($col)."'");
|
||||
return ($res && $res->num_rows > 0);
|
||||
}
|
||||
function parse_id_list($s){
|
||||
$tokens = preg_split('/\s+/', trim((string)$s));
|
||||
$out = [];
|
||||
foreach ($tokens as $t) {
|
||||
if ($t === '') continue;
|
||||
if (preg_match('/^\d+$/', $t)) $out[] = (int)$t;
|
||||
}
|
||||
return array_values(array_unique($out));
|
||||
}
|
||||
/* URL helpers for image preview */
|
||||
function is_abs_url($u){ return (bool)preg_match('~^(?:https?:)?//|^data:~i', (string)$u); }
|
||||
function join_base($base, $path){
|
||||
$base = rtrim((string)$base, '/');
|
||||
$path = ltrim((string)$path, '/');
|
||||
return $base !== '' ? $base.'/'.$path : $path;
|
||||
}
|
||||
|
||||
/* which column holds space-separated locations */
|
||||
$locationCol = col_exists($db, 'ogp_billing_services', 'remote_server_id') ? 'remote_server_id' :
|
||||
(col_exists($db, 'ogp_billing_services', 'remote_server') ? 'remote_server' : 'remote_server_id');
|
||||
|
||||
$flash = [];
|
||||
|
||||
/* A) Update global server location enable flags */
|
||||
if (isset($_POST['update_remote_servers'])) {
|
||||
$enabledIds = array_map('intval', $_POST['rs'] ?? []);
|
||||
$enabledSet = array_flip($enabledIds);
|
||||
$allIds = fetch_all_assoc($db, "SELECT remote_server_id FROM ogp_remote_servers");
|
||||
foreach ($allIds as $row) {
|
||||
$id = (int)$row['remote_server_id'];
|
||||
$e = isset($enabledSet[$id]) ? 1 : 0;
|
||||
$db->query("UPDATE ogp_remote_servers SET enabled={$e} WHERE remote_server_id={$id}");
|
||||
}
|
||||
$flash[] = "Server locations updated.";
|
||||
}
|
||||
|
||||
/* helper: update one service row from posted array */
|
||||
function update_service_row(mysqli $db, string $locationCol, int $sid, array $svc){
|
||||
$name = esc_mysqli($db, trim($svc['service_name'] ?? ''));
|
||||
$price = esc_mysqli($db, trim($svc['price_monthly'] ?? '0.00'));
|
||||
$img = esc_mysqli($db, trim($svc['img_url'] ?? ''));
|
||||
$en = !empty($svc['enabled']) ? 1 : 0;
|
||||
|
||||
$minSlots = max(1, (int)($svc['slot_min_qty'] ?? 1));
|
||||
$maxSlots = max($minSlots, (int)($svc['slot_max_qty'] ?? $minSlots));
|
||||
|
||||
$selected = [];
|
||||
if (!empty($svc['locations']) && is_array($svc['locations'])) {
|
||||
$selected = array_map('intval', $svc['locations']);
|
||||
$selected = array_values(array_unique($selected));
|
||||
}
|
||||
$primary = isset($svc['primary_location']) ? (int)$svc['primary_location'] : 0;
|
||||
if ($primary && in_array($primary, $selected, true)) {
|
||||
$selected = array_values(array_diff($selected, [$primary]));
|
||||
array_unshift($selected, $primary);
|
||||
}
|
||||
$locList = implode(' ', $selected);
|
||||
$locListEsc = esc_mysqli($db, $locList);
|
||||
|
||||
$sql = "UPDATE ogp_billing_services
|
||||
SET service_name='{$name}',
|
||||
`{$locationCol}`='{$locListEsc}',
|
||||
slot_min_qty={$minSlots},
|
||||
slot_max_qty={$maxSlots},
|
||||
price_monthly='{$price}',
|
||||
img_url='{$img}',
|
||||
enabled={$en}
|
||||
WHERE service_id={$sid}";
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
/* B1) PER-ROW UPDATE */
|
||||
if (isset($_POST['update_single']) && isset($_POST['service']) && is_array($_POST['service'])) {
|
||||
$sid = (int)$_POST['update_single'];
|
||||
if (isset($_POST['service'][$sid])) {
|
||||
update_service_row($db, $locationCol, $sid, $_POST['service'][$sid]);
|
||||
$flash[] = "Service #{$sid} updated.";
|
||||
}
|
||||
}
|
||||
|
||||
/* B2) BULK UPDATE (single button at bottom) */
|
||||
if (isset($_POST['bulk_update']) && !empty($_POST['service']) && is_array($_POST['service'])) {
|
||||
foreach ($_POST['service'] as $sid => $svc) {
|
||||
update_service_row($db, $locationCol, (int)$sid, (array)$svc);
|
||||
}
|
||||
$flash[] = "All edited services have been updated.";
|
||||
}
|
||||
|
||||
/* C) Remove a service (separate small form) */
|
||||
if (isset($_POST['remove_service'], $_POST['service_id_remove'])) {
|
||||
$sid = (int)$_POST['service_id_remove'];
|
||||
$db->query("DELETE FROM ogp_billing_services WHERE service_id={$sid}");
|
||||
$flash[] = "Service #{$sid} removed.";
|
||||
}
|
||||
|
||||
/* fetch data for UI */
|
||||
$remoteServers = fetch_all_assoc($db, "SELECT remote_server_id, remote_server_name, enabled FROM ogp_remote_servers ORDER BY remote_server_name");
|
||||
$services = fetch_all_assoc($db, "SELECT service_id, service_name, `{$locationCol}` AS locs, slot_min_qty, slot_max_qty, price_monthly, img_url, enabled FROM ogp_billing_services ORDER BY service_name");
|
||||
?>
|
||||
|
||||
<?php if ($flash): ?>
|
||||
<div class="panel" style="margin-bottom:12px"><?php foreach($flash as $m) echo "<div>".h($m)."</div>"; ?></div>
|
||||
<div class="panel mb-12"><?php foreach($flash as $m) echo "<div>".h($m)."</div>"; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<h2>Enable/Disable Server Locations (Global)</h2>
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="update_remote_servers" value="1">
|
||||
<div style="display:flex;flex-wrap:wrap;gap:10px;">
|
||||
<?php foreach ($remoteServers as $rs): ?>
|
||||
<label class="loc-label min-w-240">
|
||||
<input type="checkbox" name="rs[]" value="<?php echo (int)$rs['remote_server_id']; ?>" <?php echo ((int)$rs['enabled']===1?'checked':''); ?>>
|
||||
<b><?php echo h($rs['remote_server_name']); ?></b>
|
||||
<small class="muted">(ID: <?php echo (int)$rs['remote_server_id']; ?>)</small>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div style="margin-top:10px;"><button type="submit">Update Enabled Servers</button></div>
|
||||
<div class="mt-10"><button type="submit">Update Enabled Servers</button></div>
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2>Current Services</h2>
|
||||
<?php if (!$services): ?>
|
||||
<p>No services found.</p>
|
||||
<?php else: ?>
|
||||
|
||||
<!-- SINGLE BULK FORM FOR ALL SERVICES -->
|
||||
<form method="post" action="">
|
||||
|
||||
<table class="center" style="text-align:center;width:100%;border-collapse:collapse;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Enabled</th>
|
||||
<th>Service Name <small class="muted">(ID below)</small></th>
|
||||
<th>Min Slots</th>
|
||||
<th>Max Slots</th>
|
||||
<th>Price (Monthly)</th>
|
||||
<th>Thumbnail URL</th>
|
||||
<th>Preview</th>
|
||||
<th>Update Row</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($services as $row): ?>
|
||||
<?php
|
||||
$sid = (int)$row['service_id'];
|
||||
$selected = parse_id_list($row['locs'] ?? '');
|
||||
$primary = $selected[0] ?? 0; // first ID is "primary"
|
||||
$selSet = array_flip($selected);
|
||||
$imgUrl = trim((string)$row['img_url']);
|
||||
$displayUrl = '';
|
||||
if ($imgUrl !== '') {
|
||||
if (is_abs_url($imgUrl)) {
|
||||
$displayUrl = $imgUrl;
|
||||
} elseif ($SITE_BASE_URL !== '') {
|
||||
$displayUrl = join_base($SITE_BASE_URL, $imgUrl);
|
||||
} else {
|
||||
// Use relative path (local folder)
|
||||
$displayUrl = $imgUrl;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- MAIN ROW (no bottom border) -->
|
||||
<tr>
|
||||
<!-- Enabled first -->
|
||||
<td>
|
||||
<input type="hidden" name="service[<?php echo $sid; ?>][enabled]" value="0">
|
||||
<input type="checkbox" name="service[<?php echo $sid; ?>][enabled]" value="1" <?php echo ((int)$row['enabled']===1?'checked':''); ?>>
|
||||
</td>
|
||||
|
||||
<!-- Service name (with tiny ID under it) -->
|
||||
<td>
|
||||
<input type="text" name="service[<?php echo $sid; ?>][service_name]" value="<?php echo h($row['service_name']); ?>" class="min-w-260">
|
||||
<div class="small-muted">ID: <?php echo $sid; ?></div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input type="number" name="service[<?php echo $sid; ?>][slot_min_qty]" value="<?php echo (int)$row['slot_min_qty']; ?>" min="1" step="1" class="w-90">
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input type="number" name="service[<?php echo $sid; ?>][slot_max_qty]" value="<?php echo (int)$row['slot_max_qty']; ?>" min="1" step="1" class="w-90">
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input type="text" name="service[<?php echo $sid; ?>][price_monthly]" value="<?php echo h($row['price_monthly']); ?>" size="8">
|
||||
</td>
|
||||
|
||||
<!-- Thumbnail URL input -->
|
||||
<td>
|
||||
<input type="text" name="service[<?php echo $sid; ?>][img_url]" value="<?php echo h($row['img_url']); ?>" class="min-w-240">
|
||||
</td>
|
||||
|
||||
<!-- Preview (uses BASE + relative path) -->
|
||||
<td>
|
||||
<?php if ($displayUrl !== ''): ?>
|
||||
<img src="<?php echo h($displayUrl); ?>" alt="preview" loading="lazy" class="img-preview" onerror="this.style.display='none'">
|
||||
<?php else: ?>
|
||||
<span class="muted">(no image)</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
<!-- Per-row Update (smaller) -->
|
||||
<td>
|
||||
<button type="submit" name="update_single" value="<?php echo $sid; ?>" class="btn-small">Update Row</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- LOCATIONS ROW (single bottom divider) -->
|
||||
<tr>
|
||||
<td colspan="8" style="border-bottom:1px solid #f0f0f0; padding:8px 6px; text-align:left;">
|
||||
<div class="locs-box" data-sid="<?php echo $sid; ?>" style="display:flex; flex-wrap:wrap; gap:8px;">
|
||||
<?php foreach ($remoteServers as $rs): ?>
|
||||
<?php
|
||||
$rid = (int)$rs['remote_server_id'];
|
||||
$isChecked = isset($selSet[$rid]);
|
||||
$isPrimary = ($primary === $rid);
|
||||
?>
|
||||
<label class="loc-label">
|
||||
<input type="checkbox" class="locchk" data-sid="<?php echo $sid; ?>"
|
||||
name="service[<?php echo $sid; ?>][locations][]" value="<?php echo $rid; ?>"
|
||||
<?php echo $isChecked ? 'checked' : ''; ?> class="mr-6">
|
||||
<?php echo h($rs['remote_server_name']); ?> (<?php echo $rid; ?>)
|
||||
<span style="margin-left:10px;">
|
||||
<input type="radio" class="locprim" data-sid="<?php echo $sid; ?>"
|
||||
name="service[<?php echo $sid; ?>][primary_location]" value="<?php echo $rid; ?>"
|
||||
<?php echo $isPrimary ? 'checked' : ''; ?> <?php echo $isChecked ? '' : 'disabled'; ?>>
|
||||
<small>Primary</small>
|
||||
</span>
|
||||
<?php if ((int)$rs['enabled'] === 0): ?>
|
||||
<small class="text-danger ml-8">[Globally disabled]</small>
|
||||
<?php endif; ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div style="margin-top:14px; text-align:right;">
|
||||
<button type="submit" name="bulk_update" value="1">Update All</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<h3 style="margin-top:20px;">Remove a Service</h3>
|
||||
<form method="post" action="" style="display:flex;gap:8px;align-items:center;">
|
||||
<input type="hidden" name="remove_service" value="1">
|
||||
<select name="service_id_remove">
|
||||
<?php foreach ($services as $s): ?>
|
||||
<option value="<?php echo (int)$s['service_id']; ?>">
|
||||
<?php echo h($s['service_name']); ?> (ID: <?php echo (int)$s['service_id']; ?>)
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<button type="submit" onclick="return confirm('Remove this service? This cannot be undone.')">Remove</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- JS: Per-row: enable/disable Primary radios based on whether that location is checked -->
|
||||
<script>
|
||||
document.querySelectorAll('.locs-box').forEach(function(box){
|
||||
const sid = box.getAttribute('data-sid');
|
||||
const checks = box.querySelectorAll('input.locchk[data-sid="'+sid+'"]');
|
||||
|
||||
function refreshRadios() {
|
||||
checks.forEach(function(chk){
|
||||
const rid = chk.value;
|
||||
const rad = box.querySelector('input.locprim[data-sid="'+sid+'"][value="'+rid+'"]');
|
||||
if (!rad) return;
|
||||
if (chk.checked) {
|
||||
rad.disabled = false;
|
||||
} else {
|
||||
if (rad.checked) rad.checked = false;
|
||||
rad.disabled = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
checks.forEach(chk => chk.addEventListener('change', refreshRadios));
|
||||
refreshRadios();
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
// Close database connection
|
||||
mysqli_close($db);
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
326
modules/billing/ai.php
Normal file
326
modules/billing/ai.php
Normal file
|
|
@ -0,0 +1,326 @@
|
|||
<?php
|
||||
/***********************
|
||||
* Assistant Chat (Full History) — PHP + cURL
|
||||
* - Persistent thread in session
|
||||
* - Full history render with Question / Answer labels
|
||||
* - SSL verification disabled (your hosting constraint)
|
||||
* - Citations: filename + page (when available)
|
||||
***********************/
|
||||
|
||||
// Debug (disable on production)
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
/* ------------------- CONFIG ------------------- */
|
||||
$OPENAI_API_KEY = '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';
|
||||
|
||||
$ASSISTANT_ID = 'asst_RAhtGzcy6higJeMwomZSqVjM'; // <-- set to your existing assistant
|
||||
$OPENAI_BASE_URL = 'https://api.openai.com/v1';
|
||||
$OPENAI_BETA_HDR = 'assistants=v2'; // required for Assistants v2
|
||||
$REQUEST_TIMEOUT = 30; // seconds for cURL calls
|
||||
$RUN_POLL_DELAY = 500000; // microseconds between run polls (0.5s)
|
||||
$RUN_POLL_MAX = 40; // max polls (~20s total); adjust as needed
|
||||
/* ---------------------------------------------- */
|
||||
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
if (!isset($_SESSION['thread_id'])) {
|
||||
$_SESSION['thread_id'] = null;
|
||||
}
|
||||
|
||||
/** HTML escape helper */
|
||||
function h($v) { return htmlspecialchars((string)$v, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); }
|
||||
|
||||
/** Low-level OpenAI request helper */
|
||||
function openai_request($method, $endpoint, $payload = null, $query = []) {
|
||||
global $OPENAI_API_KEY;
|
||||
$url = "https://api.openai.com/v1" . $endpoint;
|
||||
if (!empty($query)) $url .= '?' . http_build_query($query);
|
||||
|
||||
$headers = [
|
||||
"Content-Type: application/json",
|
||||
"Authorization: Bearer {$OPENAI_API_KEY}",
|
||||
"OpenAI-Beta: assistants=v2"
|
||||
];
|
||||
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
|
||||
// Host requires SSL verification disabled
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
|
||||
if (!is_null($payload)) curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
|
||||
|
||||
$resp = curl_exec($ch);
|
||||
if ($resp === false) {
|
||||
$err = curl_error($ch);
|
||||
curl_close($ch);
|
||||
throw new RuntimeException("cURL error: {$err}");
|
||||
}
|
||||
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
$data = json_decode($resp, true);
|
||||
if ($code >= 400) {
|
||||
$msg = isset($data['error']['message']) ? $data['error']['message'] : 'Unknown API error';
|
||||
throw new RuntimeException("OpenAI API error ({$code}): {$msg}");
|
||||
}
|
||||
return is_array($data) ? $data : [];
|
||||
}
|
||||
|
||||
/** Create or reuse a per-visitor thread */
|
||||
function ensure_thread_id() {
|
||||
if (!empty($_SESSION['thread_id'])) return $_SESSION['thread_id'];
|
||||
$created = openai_request('POST', '/threads', ['metadata' => ['site' => $_SERVER['HTTP_HOST'] ?? 'unknown']]);
|
||||
$tid = $created['id'] ?? null;
|
||||
if (!$tid) throw new RuntimeException('Failed to create thread.');
|
||||
$_SESSION['thread_id'] = $tid;
|
||||
return $tid;
|
||||
}
|
||||
|
||||
/** Add a user message */
|
||||
function add_user_message($thread_id, $text) {
|
||||
openai_request('POST', "/threads/{$thread_id}/messages", [
|
||||
'role' => 'user',
|
||||
'content' => $text,
|
||||
]);
|
||||
}
|
||||
|
||||
/** Start a run */
|
||||
function start_run($thread_id, $assistant_id) {
|
||||
$run = openai_request('POST', "/threads/{$thread_id}/runs", [
|
||||
'assistant_id' => $assistant_id,
|
||||
]);
|
||||
$run_id = $run['id'] ?? null;
|
||||
if (!$run_id) throw new RuntimeException('Failed to start run.');
|
||||
return $run_id;
|
||||
}
|
||||
|
||||
/** Wait for completion (or fail/timeout) */
|
||||
function wait_for_run($thread_id, $run_id, $max_tries, $delay_us) {
|
||||
$terminal = ['completed', 'failed', 'requires_action', 'cancelled', 'expired'];
|
||||
for ($i = 0; $i < $max_tries; $i++) {
|
||||
usleep($delay_us);
|
||||
$run = openai_request('GET', "/threads/{$thread_id}/runs/{$run_id}");
|
||||
$status = $run['status'] ?? '';
|
||||
if (in_array($status, $terminal, true)) return $run;
|
||||
}
|
||||
return ['status' => 'timeout'];
|
||||
}
|
||||
|
||||
/** Cache of file_id => filename (per request) */
|
||||
$_FILE_NAME_CACHE = [];
|
||||
|
||||
/** Resolve file name from file_id (API returns "filename" or sometimes "display_name") */
|
||||
function get_file_name_by_id($file_id) {
|
||||
global $_FILE_NAME_CACHE;
|
||||
if (isset($_FILE_NAME_CACHE[$file_id])) return $_FILE_NAME_CACHE[$file_id];
|
||||
$file = openai_request('GET', "/files/{$file_id}");
|
||||
$name = $file['filename'] ?? ($file['display_name'] ?? ($file['name'] ?? $file_id));
|
||||
$_FILE_NAME_CACHE[$file_id] = $name;
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract message text + citations (filename + page if available).
|
||||
* Returns an array of entries: ['role' => 'user|assistant', 'text' => '...', 'refs' => [['filename'=>'','page'=>'','file_id'=>'']]]
|
||||
*/
|
||||
function normalize_messages($messages) {
|
||||
$out = [];
|
||||
if (empty($messages['data']) || !is_array($messages['data'])) return $out;
|
||||
|
||||
// The API returns newest first by default if not specifying; we request 'asc' in fetch.
|
||||
foreach ($messages['data'] as $m) {
|
||||
$role = $m['role'] ?? '';
|
||||
if (!in_array($role, ['user', 'assistant', 'system'], true)) continue;
|
||||
|
||||
if (empty($m['content']) || !is_array($m['content'])) continue;
|
||||
|
||||
$all_text = [];
|
||||
$refs = [];
|
||||
foreach ($m['content'] as $part) {
|
||||
if (($part['type'] ?? '') === 'text' && !empty($part['text']['value'])) {
|
||||
$all_text[] = $part['text']['value'];
|
||||
|
||||
// Parse annotations for citations (file_citation)
|
||||
$anns = $part['text']['annotations'] ?? [];
|
||||
if (is_array($anns)) {
|
||||
foreach ($anns as $ann) {
|
||||
if (($ann['type'] ?? '') === 'file_citation' && !empty($ann['file_citation']['file_id'])) {
|
||||
$fid = $ann['file_citation']['file_id'];
|
||||
$page = null;
|
||||
|
||||
// Page can appear under different shapes depending on backend. Try common keys:
|
||||
if (isset($ann['file_citation']['page'])) {
|
||||
$page = $ann['file_citation']['page'];
|
||||
} elseif (isset($ann['file_citation']['page_range']) && is_array($ann['file_citation']['page_range'])) {
|
||||
// Example: ['start' => 5, 'end' => 6]
|
||||
$start = $ann['file_citation']['page_range']['start'] ?? null;
|
||||
$end = $ann['file_citation']['page_range']['end'] ?? null;
|
||||
if ($start && $end && $start !== $end) $page = "{$start}-{$end}";
|
||||
elseif ($start) $page = (string)$start;
|
||||
}
|
||||
// Fetch filename
|
||||
try {
|
||||
$filename = get_file_name_by_id($fid);
|
||||
} catch (Throwable $e) {
|
||||
$filename = $fid;
|
||||
}
|
||||
$refs[] = [
|
||||
'file_id' => $fid,
|
||||
'filename' => $filename,
|
||||
'page' => $page ?? 'n/a',
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($all_text)) {
|
||||
$out[] = [
|
||||
'role' => $role,
|
||||
'text' => implode("\n", $all_text),
|
||||
'refs' => $refs,
|
||||
];
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/** Fetch conversation (ascending) */
|
||||
function fetch_history($thread_id) {
|
||||
$messages = openai_request('GET', "/threads/{$thread_id}/messages", null, ['order' => 'asc', 'limit' => 50]);
|
||||
return normalize_messages($messages);
|
||||
}
|
||||
|
||||
/* ------------------- HANDLE POST ------------------- */
|
||||
$error = null;
|
||||
$history = [];
|
||||
|
||||
try {
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (!empty($_POST['reset_thread'])) {
|
||||
$_SESSION['thread_id'] = null;
|
||||
} elseif (isset($_POST['user_input'])) {
|
||||
$user_text = trim((string)$_POST['user_input']);
|
||||
if ($user_text !== '') {
|
||||
$thread_id = ensure_thread_id();
|
||||
add_user_message($thread_id, $user_text);
|
||||
$run_id = start_run($thread_id, $ASSISTANT_ID);
|
||||
$run = wait_for_run($thread_id, $run_id, $POLL_MAX_TRIES, $POLL_DELAY_US);
|
||||
|
||||
if (($run['status'] ?? '') === 'failed') {
|
||||
$error = 'Assistant run failed.';
|
||||
} elseif (($run['status'] ?? '') === 'requires_action') {
|
||||
// If you later support tool calls, handle them here then submit outputs.
|
||||
} elseif (($run['status'] ?? '') === 'timeout') {
|
||||
$error = 'Assistant timed out. Please try again.';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_SESSION['thread_id'])) {
|
||||
$history = fetch_history($_SESSION['thread_id']);
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$error = $e->getMessage();
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
// Include top and menu for website UI (session already started above)
|
||||
include(__DIR__ . '/includes/top.php');
|
||||
include(__DIR__ . '/includes/menu.php');
|
||||
?>
|
||||
<!-- UI -->
|
||||
<div class="ai-container">
|
||||
<h3>Site Assistant</h3>
|
||||
<p>Type a question below. Press <b>Enter</b> to send, <b>Shift+Enter</b> for a new line.</p>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div class="ai-alert" style="border:1px solid #c00;">
|
||||
<strong>Error:</strong> <?php echo h($error); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($_SESSION['thread_id'])): ?>
|
||||
<div class="ai-msg-meta">Thread: <?php echo h($_SESSION['thread_id']); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form id="chat-form" method="post" style="margin:12px 0;">
|
||||
<textarea id="chat-input" name="user_input" rows="3" class="ai-textarea" placeholder="Ask your question..."></textarea>
|
||||
<div style="margin-top:8px; display:flex; gap:8px;">
|
||||
<button type="submit">Send</button>
|
||||
<button type="submit" name="reset_thread" value="1">Reset Conversation</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if (!empty($history) && is_array($history)): ?>
|
||||
<div style="margin-top:16px; padding:10px; border:1px solid #ccc; border-radius:8px;">
|
||||
<?php foreach ($history as $msg):
|
||||
// Label mapping: user => Question, assistant => Answer, system => (optional)
|
||||
$role = $msg['role'] ?? 'assistant';
|
||||
if ($role === 'user') $label = 'Question';
|
||||
elseif ($role === 'assistant') $label = 'Answer';
|
||||
else $label = ucfirst($role); // e.g., System
|
||||
$text = str_replace("\r\n", "\n", $msg['text'] ?? '');
|
||||
$refs = $msg['refs'] ?? [];
|
||||
?>
|
||||
<div style="margin-bottom:14px;">
|
||||
<div style="font-weight:bold;"><?php echo h($label); ?></div>
|
||||
<div style="white-space:pre-wrap;"><?php echo nl2br(h($text)); ?></div>
|
||||
|
||||
<?php if (!empty($refs)): ?>
|
||||
<div style="margin-top:6px; font-size:12px;">
|
||||
<em>References:</em>
|
||||
<ul style="margin:6px 0 0 18px; padding:0;">
|
||||
<?php foreach ($refs as $r):
|
||||
$fname = $r['filename'] ?? 'file';
|
||||
$page = $r['page'] ?? 'n/a';
|
||||
// If you have your own document links, replace '#' with a real URL.
|
||||
?>
|
||||
<li>
|
||||
<a href="#" title="file_id: <?php echo h($r['file_id']); ?>">
|
||||
<?php echo h($fname); ?> — page <?php echo h($page); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="margin-top:10px; color:#666;">No messages yet.</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="margin-top:10px; font-size:12px; color:#555;">
|
||||
Conversation persists until you click “Reset Conversation”.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit on Enter (Shift+Enter = newline) -->
|
||||
<script>
|
||||
(function(){
|
||||
var form = document.getElementById('chat-form');
|
||||
var input = document.getElementById('chat-input');
|
||||
|
||||
input.addEventListener('keydown', function(e){
|
||||
if (e.key === 'Enter') {
|
||||
if (!e.shiftKey) {
|
||||
e.preventDefault();
|
||||
form.submit();
|
||||
}
|
||||
// if Shift+Enter, allow newline
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
46
modules/billing/api/capture_order.php
Normal file
46
modules/billing/api/capture_order.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
require_once(__DIR__ . '/../includes/config.inc.php');
|
||||
$sandbox = true; // flip to false for Live
|
||||
$client_id = 'AfvY_C2zA_hTHxHq7TIhtOeub4xBdySYrt_Hjj3d_WYQwjWI9NfOAVOTeResx2rgZ_nP5tOoxQSAHw8c';
|
||||
$client_secret = 'EJ216np9cAj9n7KSddez3fLVxGe-zi4oKKKl1YGqPp88XIikr4Qzbxh0XW2as-V6LgdX-upjtQAg9dC0';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
$in = json_decode(file_get_contents('php://input'), true) ?: [];
|
||||
$order_id = $in['order_id'] ?? null;
|
||||
if (!$order_id) { http_response_code(400); echo json_encode(['error'=>'missing order_id']); exit; }
|
||||
|
||||
$api = $sandbox ? 'https://api-m.sandbox.paypal.com' : 'https://api-m.paypal.com';
|
||||
|
||||
$ch = curl_init("$api/v1/oauth2/token");
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => 'grant_type=client_credentials',
|
||||
CURLOPT_HTTPHEADER => ['Accept: application/json'],
|
||||
CURLOPT_USERPWD => $client_id . ':' . $client_secret,
|
||||
]);
|
||||
$tok = curl_exec($ch);
|
||||
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
if ($http !== 200) { http_response_code(500); echo json_encode(['error'=>'oauth_fail']); exit; }
|
||||
$access = json_decode($tok, true)['access_token'] ?? null;
|
||||
|
||||
$ch = curl_init("$api/v2/checkout/orders/$order_id/capture");
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'Authorization: Bearer ' . $access ],
|
||||
]);
|
||||
$res = curl_exec($ch);
|
||||
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
if ($http !== 201 && $http !== 200) { http_response_code($http); echo $res; exit; }
|
||||
|
||||
$payload = json_decode($res, true);
|
||||
$status = $payload['status'] ?? 'UNKNOWN';
|
||||
$txnId = $payload['purchase_units'][0]['payments']['captures'][0]['id'] ?? null;
|
||||
|
||||
echo json_encode(['status'=>$status, 'txn_id'=>$txnId]);
|
||||
|
||||
?>
|
||||
81
modules/billing/api/create_order.php
Normal file
81
modules/billing/api/create_order.php
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
require_once(__DIR__ . '/../includes/config.inc.php');
|
||||
// create_order for PayPal — adapted to run from _website/api
|
||||
$sandbox = true; // flip to false for Live
|
||||
$client_id = 'AfvY_C2zA_hTHxHq7TIhtOeub4xBdySYrt_Hjj3d_WYQwjWI9NfOAVOTeResx2rgZ_nP5tOoxQSAHw8c';
|
||||
$client_secret = 'EJ216np9cAj9n7KSddez3fLVxGe-zi4oKKKl1YGqPp88XIikr4Qzbxh0XW2as-V6LgdX-upjtQAg9dC0';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$in = json_decode(file_get_contents('php://input'), true) ?: [];
|
||||
|
||||
$amount_in = $in['amount'] ?? '0.00';
|
||||
$currency = $in['currency'] ?? 'USD';
|
||||
$invoice_id = $in['invoice_id'] ?? null;
|
||||
$custom_id = $in['custom_id'] ?? null;
|
||||
$description = $in['description'] ?? 'Order';
|
||||
$return_url = $in['return_url'] ?? null;
|
||||
$cancel_url = $in['cancel_url'] ?? null;
|
||||
$items = (isset($in['items']) && is_array($in['items'])) ? $in['items'] : null;
|
||||
$line_invoices= (isset($in['line_invoices']) && is_array($in['line_invoices'])) ? $in['line_invoices'] : null;
|
||||
|
||||
$amount_value = number_format((float)$amount_in, 2, '.', '');
|
||||
if ($items) {
|
||||
$sum = 0.00;
|
||||
foreach ($items as $it) {
|
||||
$qty = isset($it['quantity']) ? (int)$it['quantity'] : 1;
|
||||
$val = isset($it['unit_amount']['value']) ? (float)$it['unit_amount']['value'] : 0.00;
|
||||
$sum += $qty * $val;
|
||||
}
|
||||
$amount_value = number_format($sum, 2, '.', '');
|
||||
}
|
||||
|
||||
$api = $sandbox ? 'https://api-m.sandbox.paypal.com' : 'https://api-m.paypal.com';
|
||||
|
||||
$ch = curl_init("$api/v1/oauth2/token");
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => 'grant_type=client_credentials',
|
||||
CURLOPT_HTTPHEADER => ['Accept: application/json'],
|
||||
CURLOPT_USERPWD => $client_id . ':' . $client_secret,
|
||||
]);
|
||||
$tok = curl_exec($ch);
|
||||
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
if ($http !== 200) { http_response_code(500); echo json_encode(['error'=>'oauth_fail']); exit; }
|
||||
$access = json_decode($tok, true)['access_token'] ?? null;
|
||||
if (!$access) { http_response_code(500); echo json_encode(['error'=>'oauth_no_token']); exit; }
|
||||
|
||||
$purchaseUnit = [
|
||||
'amount' => [ 'currency_code' => $currency, 'value' => $amount_value ],
|
||||
'description' => $description,
|
||||
'invoice_id' => $invoice_id,
|
||||
'custom_id' => $custom_id
|
||||
];
|
||||
if ($items) {
|
||||
$purchaseUnit['items'] = $items;
|
||||
$purchaseUnit['amount']['breakdown'] = [ 'item_total' => ['currency_code'=>$currency,'value'=>$amount_value] ];
|
||||
}
|
||||
|
||||
$body = [
|
||||
'intent' => 'CAPTURE',
|
||||
'purchase_units' => [ $purchaseUnit ],
|
||||
'application_context' => [ 'return_url'=>$return_url, 'cancel_url'=>$cancel_url, 'user_action'=>'PAY_NOW' ]
|
||||
];
|
||||
|
||||
$ch = curl_init("$api/v2/checkout/orders");
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => json_encode($body),
|
||||
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'Authorization: Bearer ' . $access ],
|
||||
]);
|
||||
$res = curl_exec($ch);
|
||||
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
if ($http !== 201) { http_response_code($http); echo $res; exit; }
|
||||
echo $res;
|
||||
|
||||
?>
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
<?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.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db ,$view;
|
||||
$settings = $db->getSettings();
|
||||
|
||||
//The service id should also be cast to an int.
|
||||
$service_id = intval($_REQUEST['service_id']);
|
||||
|
||||
// Query for Selected service info.
|
||||
$qry_service = "SELECT DISTINCT service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, slot_max_qty, slot_min_qty, price_daily, price_monthly, price_year, description, img_url FROM OGP_DB_PREFIXbilling_services WHERE service_id=".$db->realEscapeSingle($service_id);
|
||||
$result_service = $db->resultQuery($qry_service);
|
||||
$row_service = $result_service[0];
|
||||
//Compiling info about invoice to create an invoice order.
|
||||
|
||||
/*
|
||||
Check if it's numeric before used in the WHERE clause... otherwise an SQL error is possible currently.
|
||||
If it's not an int (or if it's 0 after casting and or not vaild service) redirect to the shop page.
|
||||
*/
|
||||
if ($service_id <= 0 || $result_service === false){
|
||||
$view->refresh("home.php?m=billing&p=shop");
|
||||
return;
|
||||
}
|
||||
|
||||
// remote server value
|
||||
//is now held in the the IP_ID value
|
||||
//$remote_server_id = $row_service['remote_server_id'];
|
||||
$remote_server_id = $_POST['ip_id'];
|
||||
|
||||
// request ogp user to create a home path.
|
||||
$r_server = $db->getRemoteServer($remote_server_id);
|
||||
$ogp_user = $r_server['ogp_user'];
|
||||
|
||||
// request the user name and the game name to generate a game home name.
|
||||
$home_name = $_POST['home_name'];
|
||||
|
||||
//Calculating Price
|
||||
if ($_POST['invoice_duration'] == "day")
|
||||
{
|
||||
$price_slot=$row_service['price_daily'];
|
||||
}
|
||||
elseif ($_POST['invoice_duration'] == "month")
|
||||
{
|
||||
$price_slot=$row_service['price_monthly'];
|
||||
}
|
||||
elseif ($_POST['invoice_duration'] == "year")
|
||||
{
|
||||
$price_slot=$row_service['price_year']*12;
|
||||
}
|
||||
else
|
||||
{
|
||||
$price_slot=$row_service['price_monthly'];
|
||||
}
|
||||
|
||||
|
||||
//Game Server Values
|
||||
$ip_id = $_POST['ip_id'];
|
||||
$ip = $db->getIpById($ip_id);
|
||||
$max_players = $_POST['max_players'];
|
||||
$qty = $_POST['qty'];
|
||||
$invoice_duration = $_POST['invoice_duration'];
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$remote_control_password = $_POST['remote_control_password'];
|
||||
$ftp_password = $_POST['ftp_password'];
|
||||
$tax_amount = $settings['tax_amount'];
|
||||
$currency = $settings['currency'];
|
||||
|
||||
/*
|
||||
Cast $_REQUEST['service_id'] to an int and then check if its value is higher than 0 before using it in the WHERE clause.
|
||||
Checking if it's higher than 0 because if it's a non-numeric value, after casting it to an int it'll be 0.
|
||||
*/
|
||||
if($service_id !== 0) $where_service_id = " WHERE service_id=".$db->realEscapeSingle($service_id); else $where_service_id = "";
|
||||
$qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$services = $db->resultQuery($qry_services);
|
||||
foreach ($services as $key => $row) {
|
||||
if($max_players < $row['slot_min_qty'] || $qty < 1){
|
||||
$max_players = $row['slot_min_qty'];
|
||||
$qty = 1;
|
||||
}
|
||||
/*
|
||||
An extra check added for the inverse: check max_players against slot_max_qty.
|
||||
It would be good to do in the event someone is only selling a max of 16 slots per server.
|
||||
*/
|
||||
elseif ($max_players > $row['slot_max_qty'])
|
||||
{
|
||||
$max_players = $row['slot_max_qty'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( isset( $_POST["add_to_cart"] ) )
|
||||
{
|
||||
if( isset( $_SESSION['CART'] ) )
|
||||
{
|
||||
$i = count( $_SESSION['CART'] );
|
||||
$i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$i = 0;
|
||||
}
|
||||
|
||||
$_SESSION['CART'][$i] = array( "cart_id" => $i,
|
||||
"service_id" => $service_id,
|
||||
"home_name" => $home_name,
|
||||
"ip" => $ip_id,
|
||||
"max_players" => $max_players,
|
||||
"qty" => $qty,
|
||||
"invoice_duration" => $invoice_duration,
|
||||
"price" => $price_slot,
|
||||
"remote_control_password" => $remote_control_password,
|
||||
"ftp_password" => $ftp_password,
|
||||
"tax_amount" => $tax_amount,
|
||||
"currency" => $currency,
|
||||
"paid" => 0);
|
||||
echo '<meta http-equiv="refresh" content="0;url=?m=billing&p=cart">';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,177 +0,0 @@
|
|||
<?php
|
||||
function exec_ogp_module()
|
||||
{
|
||||
//Include database connection details
|
||||
require('includes/config.inc.php');
|
||||
|
||||
global $db,$view,$settings;
|
||||
if(isset($_GET['type']) && $_GET['type'] == 'cleared')
|
||||
{
|
||||
echo '<body onload="window.print()" >';
|
||||
$view->setCharset(get_lang('lang_charset'));
|
||||
}
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$cart_id = $_POST['cart_id'];
|
||||
$cart_id = $db->realEscapeSingle($cart_id);
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin )
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
else
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
|
||||
$cart = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$tempdate = date_create( $cart[0]['date']);
|
||||
$paid_date = date_format($tempdate,"d M Y H:m");
|
||||
|
||||
|
||||
|
||||
if( !empty($orders) )
|
||||
{
|
||||
?>
|
||||
<br><br>
|
||||
<table width="772" height="438" border="0" style="color:#000000" bgcolor="#FFFFFF">
|
||||
<tr bgcolor="#000000">
|
||||
<td colspan="7" align="center" style="color:white">
|
||||
<p style="font-size:18pt"><b><?php print_lang("invoice");?></b></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" >Paid: <?php echo $paid_date; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150" height="21" align="left"><b><?php echo "<b>Black Market Servers</b><br/>
|
||||
3400 Laurel Rd<br/>
|
||||
Brunswick, OH 44212 "; ?></td>
|
||||
<td colspan="4" rowspan="3"> </td>
|
||||
<td align="center" colspan="2" rowspan="3" ><img src="images/logo.png"><br>Thank you for your preference</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150" height="21" align="left">Email: <?php echo "<b>".$settings['panel_email_address']."</b>"; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="23" colspan="7"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("order");?></strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong>Server ID</strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("item");?></strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("invoice_duration");?></strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("slot_cost");?></strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("slot_quantity");?></strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("order_price");?></strong></div></td>
|
||||
<hr/></tr>
|
||||
<?php
|
||||
$subtotal = 0;
|
||||
foreach($orders as $order)
|
||||
{
|
||||
$order_id = $order['order_id'];
|
||||
$user_id = $order['user_id'];
|
||||
$service_id = $order['service_id'];
|
||||
$home_name = $order['home_name']." - ".$order_id;
|
||||
$ip = $order['ip'];
|
||||
$max_players = $order['max_players'];
|
||||
$qty = $order['qty'];
|
||||
$invoice_duration = $order['invoice_duration'];
|
||||
$price = $order['price'];
|
||||
$subtotal= $price * $max_players * $qty;
|
||||
$subtotal2 += $order['price'] * $max_players * $qty;
|
||||
$qry_service = "SELECT DISTINCT price_daily, price_monthly, price_year FROM ".$table_prefix."billing_services WHERE service_id=".$db->realEscapeSingle($service_id);
|
||||
$result_service = $db->resultQuery($qry_service);
|
||||
$row_service = $result_service[0];
|
||||
|
||||
//Calculating Costs
|
||||
|
||||
if ($invoice_duration == "day")
|
||||
{
|
||||
$price_slot=$row_service['price_daily'];
|
||||
}
|
||||
elseif ($invoice_duration == "month")
|
||||
{
|
||||
$price_slot=$row_service['price_monthly'];
|
||||
}
|
||||
elseif ($invoice_duration == "year")
|
||||
{
|
||||
$price_slot=$row_service['price_year']*12;
|
||||
}
|
||||
$duration = $invoice_duration > 1 ? $invoice_duration."s":$invoice_duration;
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td align="center" height="23"><?php echo $order_id; ?></td>
|
||||
<td align="center" height="23"><?php echo $order['home_id']; ?></td>
|
||||
<td align="center" height="23"><?php echo $order['home_name']; ?></td>
|
||||
<td align="center"><?php echo $qty." ".get_lang($duration); ?></td>
|
||||
<td align="center"><?php echo "$" . number_format(floatval(round(($price_slot),2 )),2)." ".$settings['currency']."/".get_lang($invoice_duration); ?></td>
|
||||
<td align="center"><?php echo $max_players; ?></td>
|
||||
<td align="center"><?php echo "$" . number_format(floatval(round(($subtotal),2 )),2)." ".$settings['currency']; ?></td>
|
||||
</tr><?php
|
||||
}
|
||||
|
||||
$coupon_savings = 0;
|
||||
if($cart[0]['coupon_id']>0) {
|
||||
$result = $db->resultquery("SELECT discount from OGP_DB_PREFIXbilling_coupons WHERE id = '". $cart[0]['coupon_id'] . "'");
|
||||
foreach($result as $coupon){
|
||||
$coupon_savings = $subtotal2 * ($coupon['discount'] / 100);
|
||||
}
|
||||
}
|
||||
|
||||
//$subtotal2 += $order['price'] * $max_players * $qty;
|
||||
//$total = $subtotal2+($cart[0]['tax_amount']/100*$subtotal2);
|
||||
$total = ($subtotal2 - $coupon_savings) * ($cart[0]['tax_amount'] / 100 + 1);
|
||||
?>
|
||||
<tr>
|
||||
<td height="24" colspan="5"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" rowspan="5"> </td>
|
||||
<td height="23" style="border: 2px solid #000000"><div align="right"><strong><?php print_lang("subtotal");?> : </strong></div></td>
|
||||
<td style="border: 2px solid #000000"><?php echo "$" . number_format(floatval(round(($subtotal2),2 )),2) . " ".$settings['currency']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($cart[0]['coupon_id']>0) {
|
||||
echo '
|
||||
<tr>
|
||||
<td height="23" style="border: 2px solid #000000"><div align="right"><strong>Discount : </strong></div></td>
|
||||
<td style="border: 2px solid #000000">'. "$" . number_format(floatval(round((($subtotal2-$coupon_savings)-$subtotal2),2 )),2) . " ".$settings['currency'] .'</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td height="23" style="border: 2px solid #000000"><div align="right"><strong><?php print_lang("tax");?> : </strong></div></td>
|
||||
<td style="border: 2px solid #000000"><?php echo $cart[0]['tax_amount']."%"; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="right"><strong><?php print_lang("total");?> : </strong></div></td>
|
||||
<td style="border: 2px solid #000000" bgcolor="#222222"><?php echo "$" . number_format(floatval(round(($total),2 )),2) ." ".$settings['currency']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="23" style="border: 2px solid #000000"><div align="right"><strong></strong></div></td>
|
||||
<td style="border: 2px solid #000000"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br><br>
|
||||
<form method='post' action='?m=billing&p=bill&type=cleared' >
|
||||
<input type="hidden" name="cart_id" value="<?php echo $_POST['cart_id'];?>">
|
||||
<input type="submit" value="<?php print_lang('print_invoice') ?>" />
|
||||
</form>
|
||||
<form method='post' action='?m=billing&p=<?php
|
||||
$isAdmin = $db->isAdmin($_SESSION['user_id']);
|
||||
if ($isAdmin)
|
||||
{
|
||||
echo 'orders';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'cart';
|
||||
}
|
||||
echo "'><input type='submit' value='";
|
||||
print_lang('back');
|
||||
?>'/>
|
||||
</form>
|
||||
<br><br><?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
$url = "https://";
|
||||
// Append the host(domain name, ip) to the URL.
|
||||
$url.= $_SERVER['HTTP_HOST'];
|
||||
// foreach($_POST as $key => $val) {
|
||||
// echo 'Field name : ' . $key . ' Value :' .$val .'<br>';
|
||||
// }
|
||||
|
||||
if (($_POST['payment_status']=="Completed")){
|
||||
echo "<title>Success</title><h4>Thank you for your order. <br> ... </h4><br>";
|
||||
echo "Processing your payment Information ..";
|
||||
$bounce_to = $url."/home.php?m=billing&p=paid";
|
||||
} else {
|
||||
echo "<title>Uh OH</title><h4>There was a problem, Please contact Support<br> ... </h4><br>";
|
||||
$bounce_to = $url."/home.php?m=billing&p=paid";
|
||||
//we can setup a "failed page" to redirect to. My sandbox payments are not marked completed for some reason
|
||||
|
||||
}
|
||||
?>
|
||||
<form name='paid' action='<?php echo $bounce_to?>' method='post'>
|
||||
<input type='hidden' name='cart_id' value='<?php echo $_POST["item_number"]?>'>
|
||||
<input type='hidden' name='payment_status' value='<?php echo $_POST["payment_status"] ?>'>
|
||||
</form>
|
||||
<script>
|
||||
var auto_refresh = setInterval(
|
||||
function()
|
||||
{
|
||||
submitform();
|
||||
}, 2000);
|
||||
function submitform()
|
||||
{
|
||||
document.paid.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,658 +0,0 @@
|
|||
<?php
|
||||
function saveOrderToDb($user_id,$service_id,$home_name,$ip,$max_players,$qty,$invoice_duration,$price,$remote_control_password,$ftp_password,$cart_id,$home_id = "0",$status,$finish_date,$extended = "0"){
|
||||
global $db;
|
||||
if(isset($_SESSION['coupon_id'])){
|
||||
$coupon_id = $_SESSION['coupon_id'];
|
||||
} else {
|
||||
$coupon_id = 0;
|
||||
}
|
||||
$fields['user_id'] = $user_id;
|
||||
$fields['service_id'] = $service_id;
|
||||
$fields['home_name'] = $home_name;
|
||||
$fields['ip'] = $ip;
|
||||
$fields['max_players'] = $max_players;
|
||||
$fields['qty'] = $qty;
|
||||
$fields['invoice_duration'] = $invoice_duration;
|
||||
$fields['price'] = $price;
|
||||
$fields['remote_control_password'] = $remote_control_password;
|
||||
$fields['ftp_password'] = $ftp_password;
|
||||
$fields['cart_id'] = $cart_id;
|
||||
$fields['home_id'] = $home_id;
|
||||
$fields['status'] = $status;
|
||||
$fields['finish_date'] = $finish_date;
|
||||
$fields['extended'] = $extended;
|
||||
$fields['coupon_id'] = $coupon_id;
|
||||
return $db->resultInsertId( 'billing_orders', $fields );
|
||||
}
|
||||
|
||||
|
||||
|
||||
function assignOrdersToCart($user_id,$tax_amount,$currency,$coupon_id){
|
||||
global $db;
|
||||
$fields['user_id'] = $user_id;
|
||||
$fields['paid'] = '0';
|
||||
$fields['tax_amount'] = $tax_amount;
|
||||
$fields['currency'] = $currency;
|
||||
//discount coupon
|
||||
if (!isset($coupon_id)) $coupon_id = "0";
|
||||
$fields['coupon_id'] = $coupon_id;
|
||||
$check_expired = $db->resultquery("SELECT id from OGP_DB_PREFIXbilling_coupons WHERE id = $fields[coupon_id] AND count > 0 AND expires >= NOW()");
|
||||
if ($check_expired <= 0) $fields['coupon_id'] = 0;
|
||||
return $db->resultInsertId( 'billing_carts', $fields );
|
||||
}
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
error_reporting(E_ALL);
|
||||
|
||||
global $db,$view,$settings;
|
||||
$discounted_price = 0;
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
|
||||
if( isset($_POST["update_cart"] )) {
|
||||
//print_r($_POST);
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders SET max_players= ".$_POST['slots']." WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders SET qty= ".$_POST['qty']." WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders SET invoice_duration = 'month' WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE OGP_DB_PREFIXgame_mods SET max_players= ".$_POST['slots']." WHERE home_id=".$db->realEscapeSingle($_POST['homeid']));
|
||||
|
||||
}
|
||||
|
||||
//discount coupon
|
||||
if( isset($_POST["coupon_code"] ) && $_POST["coupon_code"] != "") {
|
||||
$coupon_id = 0;
|
||||
$coupon_code = "";
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_coupons WHERE code= '". $_POST['coupon_code'] . "'");
|
||||
$coupon_name = "<b style='color:red'>NON-EXISTING COUPON</b>";
|
||||
$coupon_discount = 0;
|
||||
foreach($result as $couponDB){
|
||||
$_SESSION['coupon_id'] = $couponDB['id'];
|
||||
$coupon_id = $couponDB['id'];
|
||||
$coupon_code = $couponDB['code'];
|
||||
$coupon_discount = $couponDB['discount'];
|
||||
$coupon_name = $couponDB['name'];
|
||||
$coupon_recurring = $couponDB['recurring'];
|
||||
$coupon_expires = $couponDB['expires'];
|
||||
$coupon_count = $couponDB['count'];
|
||||
$today = date("Y-m-d H:i:s", time());
|
||||
if($coupon_expires < $today || $coupon_count == 0){
|
||||
$coupon_id = 0;
|
||||
$coupon_discount = 0;
|
||||
$coupon_name = "<b style='color:red'>EXPIRED COUPON</b>";
|
||||
}
|
||||
|
||||
if ($coupon_count > 0) {
|
||||
$coupon_count--;
|
||||
$db->resultquery("UPDATE ogp_billing_coupons SET count = $coupon_count WHERE code = '$_POST[coupon_code]'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( isset( $_POST["buy"] ) or isset( $_POST["pay_paypal"] ) )
|
||||
{
|
||||
if( isset( $_SESSION['CART'] ) )
|
||||
{
|
||||
$orders = $_SESSION['CART'];
|
||||
if(isset($_SESSION['coupon_id'])){
|
||||
$coupon_id = $_SESSION['coupon_id'];
|
||||
} else {
|
||||
$coupon_id = 0;
|
||||
}
|
||||
// Fill The Cart on DB
|
||||
$cart_id = assignOrdersToCart($user_id,$settings['tax_amount'],$settings['currency'],$coupon_id);
|
||||
foreach($orders as $order)
|
||||
{
|
||||
$service_id = $order['service_id'];
|
||||
$home_name = $order['home_name'];
|
||||
$ip = $order['ip'];
|
||||
$max_players = $order['max_players'];
|
||||
|
||||
//They pushed the "buy" button.
|
||||
//So set the quantity and invoice_duration
|
||||
|
||||
if(isset($_POST["buy"]))
|
||||
{
|
||||
$invoice_duration = "month";
|
||||
$qty = 1;
|
||||
}
|
||||
else{
|
||||
$invoice_duration = $order['invoice_duration'];
|
||||
$qty = $order['qty'];
|
||||
}
|
||||
$price = $order['price'];
|
||||
$remote_control_password = $order['remote_control_password'];
|
||||
$ftp_password = $order['ftp_password'];
|
||||
//Save order to DB
|
||||
saveOrderToDb($user_id,$service_id,$home_name,$ip,$max_players,$qty,$invoice_duration,$price,$remote_control_password,$ftp_password,$cart_id,0,0,0,0);
|
||||
if( isset( $_POST["buy"] )) {
|
||||
echo '<meta http-equiv="refresh" content="0;url=home.php?m=billing&p=create_servers&cart_id='.$cart_id.'" >';
|
||||
}
|
||||
}
|
||||
// Remove Cart From Session
|
||||
unset($_SESSION['CART']);
|
||||
unset($_SESSION['coupon_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$cart_id = $_POST['cart_id'];
|
||||
}
|
||||
|
||||
if ( !empty( $cart_id ) and isset( $_POST["pay_paypal"] ) and $settings['paypal'] == "1" )
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="0;url=home.php?m=billing&p=paypal&cart_id='.$cart_id.'" >';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( isset( $_POST["extend"] ) or isset( $_POST["extend_and_pay_paypal"] ))
|
||||
{
|
||||
|
||||
$orders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
|
||||
// *****************************************
|
||||
//FIGURE OUT IF THIS IS ALREADY BEEN UPDATED
|
||||
//RENEWAL IN DB SO
|
||||
//WE DONT CREATE MULTIPLE INVOICES
|
||||
// *****************************************
|
||||
foreach($orders as $order)
|
||||
{
|
||||
$cart_id = $order['cart_id'];
|
||||
if($order['status'] < 0)
|
||||
{
|
||||
$cart_id = assignOrdersToCart($user_id,$settings['tax_amount'],$settings['currency'],$_SESSION['coupon_id']);
|
||||
$service_id = $order['service_id'];
|
||||
$home_name = $order['home_name'];
|
||||
$ip = $order['ip'];
|
||||
$max_players = $order['max_players'];
|
||||
$qty = $_POST['qty'];
|
||||
$invoice_duration = $_POST['invoice_duration'];
|
||||
$remote_control_password = $order['remote_control_password'];
|
||||
$ftp_password = $order['ftp_password'];
|
||||
$home_id = $order['home_id'];
|
||||
$status = 0;
|
||||
$finish_date = $order['finish_date'];
|
||||
$services = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($service_id) );
|
||||
$service = $services[0];
|
||||
//Calculating Price
|
||||
switch ($_POST['invoice_duration'])
|
||||
{
|
||||
case "day":
|
||||
$price = $service['price_monthly']/30;
|
||||
break;
|
||||
case "month":
|
||||
$price = $service['price_monthly'];
|
||||
break;
|
||||
case "year":
|
||||
$price = $service['price_monthly']*12;
|
||||
break;
|
||||
}
|
||||
|
||||
//Save order to DB
|
||||
//save the EXPIRED finish date into NEW finish date. Then check if FINISH DATE !=0 and move that + 1 month into status
|
||||
$order_id = saveOrderToDb($user_id,$service_id,$home_name,$ip,$max_players,$qty,$invoice_duration,$price,$remote_control_password,$ftp_password,$cart_id,$home_id,$status,$finish_date,"1");
|
||||
//Change the old order expiration to -3 so it can not be extended, since there is a new order managing the same game home.
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders
|
||||
SET status=-3
|
||||
WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( !empty( $cart_id ) and isset( $_POST["extend_and_pay_paypal"] ) and $settings['paypal'] == "1" )
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="0;url=home.php?m=billing&p=paypal&cart_id='.$cart_id.'" >';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['remove']))
|
||||
{
|
||||
$cart_id = $_POST['cart_id'];
|
||||
if( isset( $_SESSION['CART'][$cart_id] ) )
|
||||
{
|
||||
unset($_SESSION['CART'][$cart_id]);
|
||||
unset($_SESSION['coupon_id']);
|
||||
}
|
||||
$order_id = $_POST['order_id'];
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_orders WHERE order_id=".$db->realEscapeSingle($order_id) );
|
||||
$orders_in_cart = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
if( !$orders_in_cart )
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<style>
|
||||
h4 {
|
||||
width:250px;
|
||||
height:25px;
|
||||
background:#f5f5f5;
|
||||
border-top-style:solid;
|
||||
border-top-color:#afafaf;
|
||||
border-top-width:1px;
|
||||
border-style: solid;
|
||||
border-color: #CFCFCF;
|
||||
border-width: 1px;
|
||||
padding-top:8px;
|
||||
text-align: center;
|
||||
font-family:"Trebuchet MS";
|
||||
}
|
||||
</style>
|
||||
<h2>Cart</h2>
|
||||
<!--
|
||||
SHOW ALL THE INVOICES FOR USER
|
||||
|
||||
<form method="post" action="?m=billing&p=orders">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input type="submit" value="All Orders">
|
||||
</form>
|
||||
-->
|
||||
<?php
|
||||
if( isset($_SESSION['CART']) and !empty($_SESSION['CART']) )
|
||||
{
|
||||
$carts[0] = $_SESSION['CART'];
|
||||
}
|
||||
|
||||
$user_carts = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE user_id=".$db->realEscapeSingle($user_id) ." order by cart_id desc" );
|
||||
|
||||
|
||||
if( $user_carts >=1 )
|
||||
{
|
||||
|
||||
// SELECT WHAT KIND OF OLD INVOICES TO DISPLAY. WE NEED A BUTTON?
|
||||
foreach ( $user_carts as $user_cart )
|
||||
{
|
||||
$cart_id = $user_cart['cart_id'];
|
||||
|
||||
$carts[$cart_id] = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts AS cart JOIN
|
||||
OGP_DB_PREFIXbilling_orders AS orders
|
||||
ON orders.cart_id=cart.cart_id
|
||||
WHERE orders.status IN (0, -1 , -2) AND (cart.cart_id=".$db->realEscapeSingle($cart_id). ") order by order_id asc");
|
||||
}
|
||||
}
|
||||
|
||||
if( empty( $carts ) )
|
||||
{
|
||||
print_failure( get_lang('there_are_no_orders_in_cart') );
|
||||
?>
|
||||
<a href="?m=billing&p=shop"><?php print_lang('back'); ?></a>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
foreach ( $carts as $orders )
|
||||
{
|
||||
if( !empty( $orders ) )
|
||||
{
|
||||
?>
|
||||
<center>
|
||||
<table style="width:95%;text-align:left;" class="center">
|
||||
<tr>
|
||||
<hr />
|
||||
|
||||
|
||||
<th>
|
||||
<?php print_lang("order_desc");?></th>
|
||||
<th>
|
||||
<?php print_lang("price");?>
|
||||
</th>
|
||||
<?php
|
||||
if(isset($orders[0]['paid']) and $orders[0]['paid'] == 3)
|
||||
{
|
||||
?>
|
||||
<th>
|
||||
<?php print_lang('expiration_date');?>
|
||||
</th>
|
||||
|
||||
<th>Status
|
||||
</th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<th>
|
||||
</th>
|
||||
</tr>
|
||||
<?php
|
||||
$subtotal = 0;
|
||||
$total_orders = count($orders);
|
||||
$order_counter = 0;
|
||||
foreach($orders as $order)
|
||||
{
|
||||
$order_counter++;
|
||||
if ( $order['qty'] > 1 )
|
||||
$order['invoice_duration'] = $order['invoice_duration']."s";
|
||||
|
||||
$subtotal += ($order['price']* $order['max_players'] * $order['qty']);
|
||||
|
||||
?>
|
||||
<tr class="tr">
|
||||
|
||||
<td>
|
||||
<?php
|
||||
$rserver = $db->getRemoteServer($order['ip']);
|
||||
echo "Order# ".$order['order_id'] . " <b>".$order['home_name']."</b> Server ID ".$order['home_id'] ;
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo "$" . number_format( $order['price'], 2 ). " " .$order['currency'] . " per slot<br>"
|
||||
|
||||
. $order['max_players'] . " Slots<br>"
|
||||
. $order['qty'] . " " . $order['invoice_duration'] ;
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
if($order['paid'] == 0 and ($order['extended'] == 0))
|
||||
{
|
||||
?>
|
||||
<td align="center">
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input type="hidden" name="order_id" value="<?php echo @$order['order_id'];?>">
|
||||
|
||||
<input type="submit" name="remove" value="<?php print_lang("remove_from_cart");?>">
|
||||
</form>
|
||||
<?php if ($total_orders == $order_counter) { ?>
|
||||
<!--checkbox -->
|
||||
<form method="post" action="" onsubmit="if(document.getElementById('agree').checked) { return true; } else { alert('You must Agree to the TOS'); return false; }">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<?php
|
||||
|
||||
//see if user is a new customer,
|
||||
//check number of orders they have had or if user is an admin (to be able to create server)
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
$result = $db->resultQuery("SELECT * FROM ogp_billing_orders WHERE user_id=".$user_id);
|
||||
$server_price = number_format( $order['price'], 2 );
|
||||
if(isset($settings['display_free'])) {
|
||||
$display_free = $settings['display_free'];
|
||||
}else {
|
||||
$display_free = false;
|
||||
}
|
||||
if((($server_price < 0.05 )|| ($isAdmin)) && ($display_free))
|
||||
//if($display_free)
|
||||
{
|
||||
if($isAdmin)
|
||||
{
|
||||
echo '<input name="buy" type="submit" value="Create Server" ><br>';
|
||||
echo 'When created EDIT this server to assign a user';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<input name="buy" type="submit" value="Create FREE Server" ><br>';
|
||||
}
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
if($settings['paypal'] == "1")
|
||||
echo '<input name="pay_paypal" type="submit" value="'.get_lang_f("pay_from", get_lang('paypal')).'">';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!--checkbox do regulamento -->
|
||||
<br><br><input type="checkbox" name="checkbox" value="check" id="agree" /><?php echo $settings['checkbox'];?>
|
||||
</form>
|
||||
<?php } ?>
|
||||
</td><?php
|
||||
}
|
||||
|
||||
|
||||
if($order['paid'] == 3)
|
||||
{
|
||||
$today=time();
|
||||
$formated_finish_date = date('d/M/Y H:i A',$order['finish_date']);
|
||||
|
||||
//status has a date for invoice
|
||||
if($order['status'] > 0)
|
||||
{
|
||||
$status = "<b style='color:green;'>Active</b>" ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//status is -1, invoice has been created
|
||||
elseif($order['status'] == -1)
|
||||
{
|
||||
$status = "<b style='color:yellow;'>Invoice Due</b>";
|
||||
}
|
||||
//invoice was not paid, server is expired and suspended
|
||||
elseif($order['status'] == -2)
|
||||
{
|
||||
$status = "<b style='color:red;'>Suspended</b>";
|
||||
}
|
||||
|
||||
//display the expiration date and invoice button.
|
||||
if($order['status'] > 0){$warning_status = "<b style='color:green;'>". $formated_finish_date ."</b>";}
|
||||
if($order['status'] == -1){$warning_status ="<b style='color:yellow;'>". $formated_finish_date ."</b>";}
|
||||
if($order['status'] == -2){$warning_status ="<b style='color:red;'>". $formated_finish_date ."</b>" ;}
|
||||
|
||||
?>
|
||||
<td>
|
||||
<?php echo "$warning_status";?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo "$status";
|
||||
|
||||
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
|
||||
if( isset( $order['status'] ) and $order['status'] == "0" or $order['status'] == "-1" or $order['status'] == "-2")
|
||||
{
|
||||
?>
|
||||
<td></td></tr><tr><td>
|
||||
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input type="hidden" name="order_id" value="<?php echo $order['order_id'];?>">
|
||||
<input type="hidden" name="homeid" value="<?php echo $order['home_id'];?>">
|
||||
|
||||
<select name="slots">
|
||||
<?php
|
||||
//allow to change the amount of max players and invoice time when renewing server
|
||||
//get max_slots and min_slots from the billing_services for this game.
|
||||
|
||||
$services = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($order['service_id']) );
|
||||
$service = $services[0];
|
||||
$min = $service['slot_min_qty'];
|
||||
$max = $service['slot_max_qty'];
|
||||
$slots=$min;
|
||||
while($slots<= $max)
|
||||
{
|
||||
if($slots == $order['max_players'])
|
||||
{
|
||||
echo "<option value='$slots' selected>$slots slots</option>";
|
||||
}else{
|
||||
echo "<option value='$slots' >$slots slots</option>";
|
||||
}
|
||||
$slots++;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select name="qty">
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$qty=1;
|
||||
while($qty<=12)
|
||||
{
|
||||
if($qty == $order['qty'])
|
||||
{
|
||||
echo "<option value='$qty' selected>$qty months</option>";
|
||||
}else{
|
||||
echo "<option value='$qty'>$qty months</option>";
|
||||
|
||||
}
|
||||
$qty++;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="hidden" name="invoice_duration" value="month">
|
||||
<!--
|
||||
<input type="submit" name="extend" value="<?php print_lang("extend");?>">
|
||||
-->
|
||||
<?php
|
||||
if($settings['paypal'] == "1")
|
||||
echo '<button name="update_cart" type="submit" value="update_cart">Update Invoice</button>';
|
||||
|
||||
echo '<button name="extend_and_pay_paypal" type="submit" value="extend_and_pay_paypal">Renew Service</button>';
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</td><?php
|
||||
}
|
||||
?>
|
||||
</tr><?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<table style="width:95%;text-align:left;" class="center">
|
||||
<tr>
|
||||
<td>Amount</td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
echo "$" . number_format( $subtotal , 2 ). " " .$order['currency'];?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b><?php echo $coupon_name;?></b></td>
|
||||
<td>
|
||||
<?php
|
||||
//APPLY COUPON CODE HERE
|
||||
$coupon_discount_amt = $subtotal * ($coupon_discount / 100);
|
||||
echo "-$" . number_format($coupon_discount_amt,2);
|
||||
?></td><td>
|
||||
<table><tr>
|
||||
<form method="post" action="">
|
||||
<td class="child">
|
||||
<input type="text" name="coupon_code"size="5" value="<?php echo $coupon_code ?>"></input>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" name="Apply Code" value="Apply Code"></input>
|
||||
</td>
|
||||
</tr></table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Discounted Subtotal</td>
|
||||
<td><?php $subtotal = $subtotal-$coupon_discount_amt;echo "$" . number_format( $subtotal , 2 ). " " .$order['currency'];?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Tax Amount</td>
|
||||
<td>
|
||||
<?php echo "$" . number_format($order['tax_amount']/100 * $subtotal,2);?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php print_lang("total");?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$total = $subtotal+($order['tax_amount']/100*$subtotal);
|
||||
echo "$" . number_format( $total , 2 ). " " .$order['currency'];
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if($order['paid'] == 1)
|
||||
{
|
||||
?>
|
||||
<form method="post" action="home.php?m=billing&p=create_servers">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<?php
|
||||
if($order['extended'] == "1")
|
||||
{
|
||||
?>
|
||||
<input name="enable_server" type="submit" value="<?php print_lang("enable_server");?>">
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<input name="create_server" type="submit" value="<?php print_lang("create_server");?>">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
elseif($order['paid'] == 2)
|
||||
{
|
||||
echo get_lang_f("payment_is_pending_of_approval");
|
||||
}
|
||||
elseif($order['paid'] == 3)
|
||||
{
|
||||
?>
|
||||
<form method="post" action="?m=billing&p=bill">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input name="paid" type="submit" value="<?php print_lang("see_invoice");?>">
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<a href="?m=billing&p=shop"><?php print_lang('back'); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
<?php
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
|
||||
//Querying UPDATE a service FROM DB
|
||||
if (isset($_POST['update_coupon']) )
|
||||
{
|
||||
$new_code = $db->realEscapeSingle($_POST['new_code']);
|
||||
$new_name = $db->realEscapeSingle($_POST['new_name']);
|
||||
$new_discount = $db->realEscapeSingle($_POST['new_discount']);
|
||||
$new_count = $db->realEscapeSingle($_POST['new_count']);
|
||||
$new_expires = $db->realEscapeSingle($_POST['new_expires']);
|
||||
$id = $db->realEscapeSingle($_POST['id']);
|
||||
|
||||
//Create INSERT query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_coupons
|
||||
SET code ='".$new_code."',
|
||||
name = '".$new_name."',
|
||||
discount ='".$new_discount."',
|
||||
count = '".$new_count."',
|
||||
expires = '".$new_expires."'
|
||||
WHERE id=".$id;
|
||||
$db->query($qry_change_url);
|
||||
}
|
||||
|
||||
//Querying INSERT new coupon INTO DB
|
||||
if(isset($_POST['add_coupon']))
|
||||
{
|
||||
$id = $_POST['id'];
|
||||
$code = $_POST['code'];
|
||||
$name = $_POST['name'];
|
||||
$discount = $_POST['discount'];
|
||||
$count= $_POST['count'];
|
||||
$expires = $_POST['expires'];
|
||||
|
||||
|
||||
$query = "INSERT INTO OGP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
//Querying REMOVE coupon FROM DB
|
||||
if (isset($_POST['del_coupon']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!-- Show Coupons on DB -->
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_coupons");
|
||||
if ($result > 0)
|
||||
{
|
||||
?>
|
||||
<h2><?php print_lang('current_coupons');?></h2>
|
||||
<table class="center" style='text-align:center;'>
|
||||
<tr>
|
||||
|
||||
<th><?php print_lang('code');?></th>
|
||||
<th><?php print_lang('coupon_name');?></th>
|
||||
<th><?php print_lang('discount');?></th>
|
||||
<th><?php print_lang('count');?></th>
|
||||
<th><?php print_lang('expires');?></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
foreach($result as $row)
|
||||
{
|
||||
?>
|
||||
<tr class="tr<?php $i = 0; echo($i++%2);?>">
|
||||
<form method="post" action="">
|
||||
<input name="id" type="hidden" value="<?php echo $row['id'];?>"/></td>
|
||||
<td><input name="new_code" type="text" value="<?php echo $row['code'];?>"/></td>
|
||||
<td><input name="new_name" type="text" value="<?php echo $row['name'];?>" /></td>
|
||||
<td><input name="new_discount" type="text" value="<?php echo $row['discount'];?>"/></td>
|
||||
<td><input name="new_count"type="text" value="<?php echo $row['count'];?>"/></td>
|
||||
<td><input name="new_expires" type="text" value="<?php echo $row['expires'];?>"/></td>
|
||||
<td><input type="submit" name="update_coupon" value="<?php print_lang('update_settings');?>"/></td>
|
||||
<td><input type="submit" name="del_coupon" value="<?php print_lang('del_coupon');?>"/></td>
|
||||
|
||||
</form>
|
||||
</tr><?php
|
||||
}
|
||||
//add new row to insert
|
||||
?>
|
||||
<form method="post" action="">
|
||||
<td><input name="code" type="text" value=""/></td>
|
||||
<td><input name="name" type="text" value="" /></td>
|
||||
<td><input name="discount" type="text" value="0"/></td>
|
||||
<td><input name="count"type="text" value="0"/></td>
|
||||
<td><input name="expires" type="datetime-local" data-date-format="YYYY MMMM DD" value=""/></td>
|
||||
<td><input type="submit" name="add_coupon" value="<?php print_lang('add_coupon');?>"/></td>
|
||||
</form></table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
<?php
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
|
||||
//Querying UPDATE a service FROM DB
|
||||
if (isset($_POST['update_coupon']) )
|
||||
{
|
||||
$new_code = $db->realEscapeSingle($_POST['new_code']);
|
||||
$new_name = $db->realEscapeSingle($_POST['new_name']);
|
||||
$new_discount = $db->realEscapeSingle($_POST['new_discount']);
|
||||
$new_count = $db->realEscapeSingle($_POST['new_count']);
|
||||
$new_expires = $db->realEscapeSingle($_POST['new_expires']);
|
||||
$id = $db->realEscapeSingle($_POST['id']);
|
||||
|
||||
//Create INSERT query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_coupons
|
||||
SET code ='".$new_code."',
|
||||
name = '".$new_name."',
|
||||
discount ='".$new_discount."',
|
||||
count = '".$new_count."',
|
||||
expires = '".$new_expires."'
|
||||
WHERE id=".$id;
|
||||
$db->query($qry_change_url);
|
||||
}
|
||||
|
||||
//Querying INSERT new coupon INTO DB
|
||||
if(isset($_POST['add_coupon']))
|
||||
{
|
||||
$id = $_POST['id'];
|
||||
$code = $_POST['code'];
|
||||
$name = $_POST['name'];
|
||||
$discount = $_POST['discount'];
|
||||
$count= $_POST['count'];
|
||||
$expires = $_POST['expires'];
|
||||
|
||||
|
||||
$query = "INSERT INTO OGP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
//Querying REMOVE coupon FROM DB
|
||||
if (isset($_POST['del_coupon']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!-- Show Coupons on DB -->
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_coupons");
|
||||
if ($result > 0)
|
||||
{
|
||||
?>
|
||||
<h2><?php print_lang('current_coupons');?></h2>
|
||||
<table class="center" style='text-align:center;'>
|
||||
<tr>
|
||||
|
||||
<th><?php print_lang('code');?></th>
|
||||
<th><?php print_lang('coupon_name');?></th>
|
||||
<th><?php print_lang('discount');?></th>
|
||||
<th><?php print_lang('count');?></th>
|
||||
<th><?php print_lang('expires');?></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
foreach($result as $row)
|
||||
{
|
||||
?>
|
||||
<tr class="tr<?php $i = 0; echo($i++%2);?>">
|
||||
<form method="post" action="">
|
||||
<input name="id" type="hidden" value="<?php echo $row['id'];?>"/></td>
|
||||
<td><input name="new_code" type="text" value="<?php echo $row['code'];?>"/></td>
|
||||
<td><input name="new_name" type="text" value="<?php echo $row['name'];?>" /></td>
|
||||
<td><input name="new_discount" type="text" value="<?php echo $row['discount'];?>"/></td>
|
||||
<td><input name="new_count"type="text" value="<?php echo $row['count'];?>"/></td>
|
||||
<td><input name="new_expires" type="text" value="<?php echo $row['expires'];?>"/></td>
|
||||
<td><input type="submit" name="update_coupon" value="<?php print_lang('update_settings');?>"/></td>
|
||||
<td><input type="submit" name="del_coupon" value="<?php print_lang('del_coupon');?>"/></td>
|
||||
|
||||
</form>
|
||||
</tr><?php
|
||||
}
|
||||
//add new row to insert
|
||||
?>
|
||||
<form method="post" action="">
|
||||
<td><input name="code" type="text" value=""/></td>
|
||||
<td><input name="name" type="text" value="" /></td>
|
||||
<td><input name="discount" type="text" value="0"/></td>
|
||||
<td><input name="count"type="text" value="0"/></td>
|
||||
<td><input name="expires" type="datetime-local" data-date-format="YYYY MMMM DD" value=""/></td>
|
||||
<td><input type="submit" name="add_coupon" value="<?php print_lang('add_coupon');?>"/></td>
|
||||
</form></table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,378 +0,0 @@
|
|||
<?php
|
||||
require_once("includes/lib_remote.php");
|
||||
require_once("modules/config_games/server_config_parser.php");
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db,$view,$settings;
|
||||
$user_id = $_SESSION['user_id'];
|
||||
if (isset($_POST['cart_id'])) {
|
||||
$cart_id = $_POST['cart_id'];
|
||||
}
|
||||
if(isset($_GET['cart_id'])){
|
||||
$cart_id = $_GET['cart_id'];
|
||||
}
|
||||
$cart_paid = $db->resultQuery( "SELECT paid FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin ){
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
} else {
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
}
|
||||
if( !empty($orders) and !empty($cart_paid) )
|
||||
{
|
||||
|
||||
foreach($orders as $order)
|
||||
{
|
||||
$order_id = $order['order_id'];
|
||||
$service_id = $order['service_id'];
|
||||
$home_name = $order['home_name'];
|
||||
$remote_control_password = $order['remote_control_password'];
|
||||
$ftp_password = $order['ftp_password'];
|
||||
$ip = $order['ip'];
|
||||
$max_players = $order['max_players'];
|
||||
$user_id = $order['user_id'];
|
||||
$extended = $order['extended'] == "1" ? TRUE : FALSE;
|
||||
//Query service info
|
||||
$service = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($service_id) );
|
||||
|
||||
if( !empty( $service[0] ) )
|
||||
{
|
||||
$home_cfg_id = $service[0]['home_cfg_id'];
|
||||
$mod_cfg_id = $service[0]['mod_cfg_id'];
|
||||
//remote_server_id has been stored in IP_ID
|
||||
//$remote_server_id = $service[0]['remote_server_id'];
|
||||
$remote_server_id = $order['ip'];
|
||||
|
||||
$ftp = $service[0]['ftp'];
|
||||
$install_method = $service[0]['install_method'];
|
||||
$manual_url = $service[0]['manual_url'];
|
||||
$access_rights = $service[0]['access_rights'];
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
if($extended)
|
||||
{
|
||||
$home_id = $order['home_id'];
|
||||
|
||||
//Get The home info without mods in 1 array (Necesary for remote connection).
|
||||
$home_info = $db->getGameHomeWithoutMods($home_id);
|
||||
|
||||
//Create the remote connection
|
||||
$remote = new OGPRemoteLibrary($home_info['agent_ip'],$home_info['agent_port'],$home_info['encryption_key'],$home_info['timeout']);
|
||||
|
||||
//Reassign the server
|
||||
$db->assignHomeTo( "user", $user_id, $home_id, $access_rights );
|
||||
|
||||
//Reenable the FTP account
|
||||
if ($ftp == "enabled")
|
||||
{
|
||||
$remote->ftp_mgr("useradd", $home_info['home_id'], $home_info['ftp_password'], $home_info['home_path']);
|
||||
$db->changeFtpStatus('enabled',$home_info['home_id']);
|
||||
}
|
||||
echo "<h4>Server Installed, Check your Email for Details</h4><br>";
|
||||
|
||||
//Panel Log
|
||||
$db->logger( "RENEWED SERVER " . $home_id);
|
||||
// SEND EMAIL
|
||||
$settings = $db->getSettings();
|
||||
$subject = "Gameserver Renewel at " . $settings['panel_name'];
|
||||
$email = $db->resultQuery(" SELECT DISTINCT users_email
|
||||
FROM ogp_users, ogp_billing_orders
|
||||
WHERE ogp_users.user_id = $user_id")[0]["users_email"];
|
||||
|
||||
$message = "Your server, " . $home_name ." ID #". $home_id . " at " . $settings['panel_name'] . " has just been renewed.<br>
|
||||
Thank You for your continued support.<br>
|
||||
If you have any questions or requests, visit our website or contact us directly in our Discord Server.";
|
||||
|
||||
$mail = mymail($email, $subject, $message, $settings);
|
||||
$rundate = date('d/M/y G:i',$now);
|
||||
|
||||
if (!$mail)
|
||||
$db->logger( "Email FAILED - Server Renewed " . $home_id);
|
||||
// END EMAIL
|
||||
|
||||
//WEBHOOK Discord=======================================================================================
|
||||
|
||||
|
||||
$webhookurl = $settings['webhookurl'];
|
||||
|
||||
$msg = "The ". $home_name ." server ID #". $home_id . " has just been renewed.";
|
||||
$json_data = array ('content'=>"$msg");
|
||||
$make_json = json_encode($json_data);
|
||||
$ch = curl_init( $webhookurl );
|
||||
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
|
||||
curl_setopt( $ch, CURLOPT_POST, 1);
|
||||
curl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json);
|
||||
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt( $ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response = curl_exec( $ch );
|
||||
//If you need to debug, or find out why you can't send message uncomment line below, and execute script.
|
||||
//echo $response;
|
||||
//end WEBHOOK Discord
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//OPTIONS, change it at your choice;
|
||||
$extra_params = "";//no extra params defined by default
|
||||
$cpu_affinity = "NA";//Affinity to one core/thread of the cpu by number, use NA to disable it
|
||||
$nice = "0";//Min priority=19 Max Priority=-19
|
||||
|
||||
//Add Game home to database
|
||||
//HARD CODE TO /home/gameserver/
|
||||
$rserver = $db->getRemoteServer($remote_server_id);
|
||||
$game_path = "/home/gameserver/";
|
||||
$home_id = $db->addGameHome( $remote_server_id, $user_id, $home_cfg_id, $game_path, $home_name, $remote_control_password, $ftp_password);
|
||||
|
||||
//Add IP:Port Pair to the Game Home
|
||||
//need to get the IP_ID for this remote server.
|
||||
$result = $db->resultQuery("SELECT ip_id FROM OGP_DB_PREFIXremote_server_ips WHERE remote_server_id=".$ip);
|
||||
foreach ($result as $rs)
|
||||
{
|
||||
$ip_id = $rs['ip_id'];
|
||||
}
|
||||
$add_port = $db->addGameIpPort( $home_id, $ip_id, $db->getNextAvailablePort($ip_id,$home_cfg_id) );
|
||||
|
||||
//Assign the Game Mod to the Game Home
|
||||
$mod_id = $db->addModToGameHome( $home_id, $mod_cfg_id );
|
||||
$db->updateGameModParams( $max_players, $extra_params, $cpu_affinity, $nice, $home_id, $mod_cfg_id );
|
||||
$db->assignHomeTo( "user", $user_id, $home_id, $access_rights );
|
||||
|
||||
//Get The home info without mods in 1 array (Necesary for remote connection).
|
||||
$home_info = $db->getGameHomeWithoutMods($home_id);
|
||||
|
||||
//Create the remote connection
|
||||
$remote = new OGPRemoteLibrary($home_info['agent_ip'],$home_info['agent_port'],$home_info['encryption_key'],$home_info['timeout']);
|
||||
|
||||
//Get Full home info in 1 array
|
||||
$home_info = $db->getGameHome($home_id);
|
||||
|
||||
//Read the Game Config from the XML file
|
||||
$server_xml = read_server_config(SERVER_CONFIG_LOCATION."/".$home_info['home_cfg_file']);
|
||||
|
||||
//Get Values from XML
|
||||
$modkey = $home_info['mods'][$mod_id]['mod_key'];
|
||||
$mod_xml = xml_get_mod($server_xml, $modkey);
|
||||
$installer_name = $mod_xml->installer_name;
|
||||
$mod_cfg_id = $home_info['mods'][$mod_id]['mod_cfg_id'];
|
||||
|
||||
//Get Preinstall commands from xml
|
||||
$precmd = $server_xml->pre_install;
|
||||
|
||||
|
||||
//Get Postinstall commands from xml
|
||||
$postcmd = $server_xml->post_install;
|
||||
|
||||
|
||||
//Enable FTP account in remote server
|
||||
if ($ftp == "enabled")
|
||||
{
|
||||
$remote->ftp_mgr("useradd", $home_info['home_id'], $home_info['ftp_password'], $home_info['home_path']);
|
||||
$db->changeFtpStatus('enabled',$home_info['home_id']);
|
||||
}
|
||||
|
||||
//Install files for this service in the remote server
|
||||
// -Steam
|
||||
$exec_folder_path = clean_path($home_info['home_path'] . "/" . $server_xml->exe_location );
|
||||
$exec_path = clean_path($exec_folder_path . "/" . $server_xml->server_exec_name );
|
||||
|
||||
if ($install_method == "steam")
|
||||
{
|
||||
if ( $server_xml->installer == "steamcmd" )
|
||||
{
|
||||
if( preg_match("/win32/", $server_xml->game_key) OR preg_match("/win64/", $server_xml->game_key) )
|
||||
$cfg_os = "windows";
|
||||
elseif( preg_match("/linux/", $server_xml->game_key) )
|
||||
$cfg_os = "linux";
|
||||
|
||||
// Some games like L4D2 require anonymous login
|
||||
if($mod_xml->installer_login){
|
||||
$login = $mod_xml->installer_login;
|
||||
$pass = '';
|
||||
}else{
|
||||
$login = $settings['steam_user'];
|
||||
$pass = $settings['steam_pass'];
|
||||
}
|
||||
|
||||
$modname = ( $installer_name == '90' and !preg_match("/(cstrike|valve)/", $modkey) ) ? $modkey : '';
|
||||
$betaname = isset($mod_xml->betaname) ? $mod_xml->betaname : '';
|
||||
$betapwd = isset($mod_xml->betapwd) ? $mod_xml->betapwd : '';
|
||||
$arch = isset($mod_xml->steam_bitness) ? $mod_xml->steam_bitness : '';
|
||||
|
||||
$remote->steam_cmd( $home_id,$home_info['home_path'],$installer_name,$modname,
|
||||
$betaname,$betapwd,$login,$pass,$settings['steam_guard'],
|
||||
$exec_folder_path,$exec_path,$precmd,$postcmd,$cfg_os,'',$arch);
|
||||
}
|
||||
}
|
||||
// -Rsync
|
||||
elseif ($install_method == "rsync")
|
||||
{
|
||||
|
||||
//Rsync Server
|
||||
$url = "files.iaregamer.com";
|
||||
//OS
|
||||
if( preg_match("/win32/", $server_xml->game_key) OR preg_match("/win64/", $server_xml->game_key) )
|
||||
$os = "windows";
|
||||
elseif( preg_match("/linux/", $server_xml->game_key) )
|
||||
$os = "linux";
|
||||
//Rsync Game Name
|
||||
//JUST SET RS_GNAME TO GAME xml NAME
|
||||
$rs_gname = $server_xml->game_key;
|
||||
|
||||
//Starting Sync
|
||||
$full_url = "$url/rsync_installer/$rs_gname/$os/";
|
||||
|
||||
|
||||
|
||||
$remote->start_rsync_install($home_id,$home_info['home_path'],"$full_url",$exec_folder_path,$exec_path,$precmd,$postcmd);
|
||||
}
|
||||
// -Manual
|
||||
elseif ($install_method == "manual")
|
||||
{
|
||||
// Start File Download and uncompress
|
||||
$filename = !empty($manual_url) ? substr($manual_url, -9) : "";
|
||||
$remote->start_file_download($manual_url,$home_info['home_path'],$filename,"uncompress");
|
||||
}
|
||||
echo "<h4><br><p>".get_lang('starting_installations')."</p></h4><br>";
|
||||
//PANEL LOG
|
||||
$db->logger( "CREATED NEW SERVER " . $home_id);
|
||||
// SEND EMAIL to new server only
|
||||
if($order['finish_date'] == 0){
|
||||
$settings = $db->getSettings();
|
||||
$subject = "New Gameserver installed at " . $settings['panel_name'];
|
||||
$email = $db->resultQuery(" SELECT DISTINCT users_email
|
||||
FROM ogp_users, ogp_billing_orders
|
||||
WHERE ogp_users.user_id = $user_id")[0]["users_email"];
|
||||
|
||||
$message = "Your server, " . $home_name ." ID #". $home_id . " at " . $settings['panel_name'] . " has just been created.<br>
|
||||
Thank You for your continued support.<br>
|
||||
If you have any questions or requests, visit our website or contact us directly in our Discord Server.
|
||||
You can login to the Game Panel and click on Game Monitor to see your server. <br><br>
|
||||
Thank you!<br> ";
|
||||
$mail = mymail($email, $subject, $message, $settings);
|
||||
$rundate = date('d/M/y G:i',$now);
|
||||
|
||||
if (!$mail)
|
||||
$db->logger( "Email FAILED - Server Created " . $home_id);
|
||||
|
||||
|
||||
//WEBHOOK Discord=======================================================================================
|
||||
|
||||
$webhookurl = "https://discord.com/api/webhooks/710275918274363412/g5Tr-EUdEnLfFryOlscxJ6FuPiSJuE6EMKRYmh9UGMiqTUxU5-y9CQrBlDJW7znr0Tol";
|
||||
//$settings['webhookurl'];
|
||||
|
||||
|
||||
$msg = "A new server, ". $home_name ." ID #". $home_id . ", has just been created.";
|
||||
$json_data = array ('content'=>"$msg");
|
||||
$make_json = json_encode($json_data);
|
||||
$ch = curl_init( $webhookurl );
|
||||
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
|
||||
curl_setopt( $ch, CURLOPT_POST, 1);
|
||||
curl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json);
|
||||
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt( $ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response = curl_exec( $ch );
|
||||
//If you need to debug, or find out why you can't send message uncomment line below, and execute script.
|
||||
//echo $response;
|
||||
//end WEBHOOK Discord
|
||||
}
|
||||
// END EMAIL
|
||||
|
||||
|
||||
}
|
||||
// Set expiration date in ogp database
|
||||
//status is -3 -2 -1 0 and 1
|
||||
// deleted, suspended, invoiced, inactive, active
|
||||
//finish_date the server will be suspended
|
||||
//in cron_shop the finish_date is used to delete the server
|
||||
//several days after being suspended
|
||||
if ($order['invoice_duration'] == "day")
|
||||
{
|
||||
|
||||
if($order['finish_date'] == 0){
|
||||
$finish_date = strtotime('+'.$order['qty'].' day');
|
||||
$status = 1;
|
||||
}
|
||||
else{
|
||||
//this is a renewel, start from end of previous order
|
||||
$finish_date = strtotime('+'.$order['qty'].' day',$order['finish_date']);
|
||||
$status = 1;
|
||||
}
|
||||
|
||||
}
|
||||
elseif ($order['invoice_duration'] == "month")
|
||||
{
|
||||
// this is a new order
|
||||
if($order['finish_date'] == 0){
|
||||
$finish_date = strtotime('+'.$order['qty'].' month');
|
||||
$status = 1;
|
||||
|
||||
}
|
||||
else{
|
||||
//this is a renewel, start from end of previous order
|
||||
$finish_date = strtotime('+'.$order['qty'].' month',$order['finish_date']);
|
||||
$status = 1;
|
||||
}
|
||||
}
|
||||
elseif ($order['invoice_duration'] == "year")
|
||||
{
|
||||
// this is a new order
|
||||
if($order['finish_date'] == 0){
|
||||
$finish_date = strtotime('+'.$order['qty'].' year');
|
||||
$status = 1;
|
||||
}
|
||||
else{
|
||||
//this is a renewel, start from end of previous order
|
||||
$finish_date = strtotime('+'.$order['qty'].' year',$order['finish_date']);
|
||||
$status = 1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// set order status
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
SET status='" . $db->realEscapeSingle($status) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
// set the order expiration
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
SET finish_date='" . $db->realEscapeSingle($finish_date) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
// Save home id created by this order
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
SET home_id='" . $db->realEscapeSingle($home_id) . "' WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
}
|
||||
|
||||
//Update Cart Payment Status as 3(paid and installed)
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
SET paid=3
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
// Set payment/creation date
|
||||
$date = date('d M Y');
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
SET date='" . $db->realEscapeSingle($date) . "'
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
$db->query( "UPDATE OGP_DB_PREFIXgame_mods SET max_players= ".$order['max_players']." WHERE home_id=".$db->realEscapeSingle($home_id));
|
||||
|
||||
|
||||
//Refresh to Game Monitor.
|
||||
$view->refresh("home.php?m=gamemanager&p=game_monitor");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,375 +0,0 @@
|
|||
<?php
|
||||
require_once("includes/lib_remote.php");
|
||||
require_once("modules/config_games/server_config_parser.php");
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db,$view,$settings;
|
||||
$user_id = $_SESSION['user_id'];
|
||||
if (isset($_POST['cart_id'])) {
|
||||
$cart_id = $_POST['cart_id'];
|
||||
}
|
||||
if(isset($_GET['cart_id'])){
|
||||
$cart_id = $_GET['cart_id'];
|
||||
}
|
||||
$cart_paid = $db->resultQuery( "SELECT paid FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin ){
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
} else {
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
}
|
||||
if( !empty($orders) and !empty($cart_paid) )
|
||||
{
|
||||
|
||||
foreach($orders as $order)
|
||||
{
|
||||
$order_id = $order['order_id'];
|
||||
$service_id = $order['service_id'];
|
||||
$home_name = $order['home_name'];
|
||||
$remote_control_password = $order['remote_control_password'];
|
||||
$ftp_password = $order['ftp_password'];
|
||||
$ip = $order['ip'];
|
||||
$max_players = $order['max_players'];
|
||||
$user_id = $order['user_id'];
|
||||
$extended = $order['extended'] == "1" ? TRUE : FALSE;
|
||||
//Query service info
|
||||
$service = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($service_id) );
|
||||
|
||||
if( !empty( $service[0] ) )
|
||||
{
|
||||
$home_cfg_id = $service[0]['home_cfg_id'];
|
||||
$mod_cfg_id = $service[0]['mod_cfg_id'];
|
||||
//remote_server_id has been stored in IP_ID
|
||||
//$remote_server_id = $service[0]['remote_server_id'];
|
||||
$remote_server_id = $order['ip'];
|
||||
|
||||
$ftp = $service[0]['ftp'];
|
||||
$install_method = $service[0]['install_method'];
|
||||
$manual_url = $service[0]['manual_url'];
|
||||
$access_rights = $service[0]['access_rights'];
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
if($extended)
|
||||
{
|
||||
$home_id = $order['home_id'];
|
||||
|
||||
//Get The home info without mods in 1 array (Necesary for remote connection).
|
||||
$home_info = $db->getGameHomeWithoutMods($home_id);
|
||||
|
||||
//Create the remote connection
|
||||
$remote = new OGPRemoteLibrary($home_info['agent_ip'],$home_info['agent_port'],$home_info['encryption_key'],$home_info['timeout']);
|
||||
|
||||
//Reassign the server
|
||||
$db->assignHomeTo( "user", $user_id, $home_id, $access_rights );
|
||||
|
||||
//Reenable the FTP account
|
||||
if ($ftp == "enabled")
|
||||
{
|
||||
$remote->ftp_mgr("useradd", $home_info['home_id'], $home_info['ftp_password'], $home_info['home_path']);
|
||||
$db->changeFtpStatus('enabled',$home_info['home_id']);
|
||||
}
|
||||
echo "<h4>Server Installed, Check your Email for Details</h4><br>";
|
||||
|
||||
//Panel Log
|
||||
$db->logger( "RENEWED SERVER " . $home_id);
|
||||
// SEND EMAIL
|
||||
$settings = $db->getSettings();
|
||||
$subject = "Gameserver Renewel at " . $settings['panel_name'];
|
||||
$email = $db->resultQuery(" SELECT DISTINCT users_email
|
||||
FROM ogp_users, ogp_billing_orders
|
||||
WHERE ogp_users.user_id = $user_id")[0]["users_email"];
|
||||
|
||||
$message = "Your server, " . $home_name ." ID #". $home_id . " at " . $settings['panel_name'] . " has just been renewed.<br>
|
||||
Thank You for your continued support.<br>
|
||||
If you have any questions or requests, visit our website or contact us directly in our Discord Server.";
|
||||
|
||||
$mail = mymail($email, $subject, $message, $settings);
|
||||
$rundate = date('d/M/y G:i',$now);
|
||||
|
||||
if (!$mail)
|
||||
$db->logger( "Email FAILED - Server Renewed " . $home_id);
|
||||
// END EMAIL
|
||||
|
||||
//WEBHOOK Discord=======================================================================================
|
||||
|
||||
|
||||
$webhookurl = $settings['webhookurl'];
|
||||
|
||||
$msg = "The ". $home_name ." server ID #". $home_id . " has just been renewed.";
|
||||
$json_data = array ('content'=>"$msg");
|
||||
$make_json = json_encode($json_data);
|
||||
$ch = curl_init( $webhookurl );
|
||||
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
|
||||
curl_setopt( $ch, CURLOPT_POST, 1);
|
||||
curl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json);
|
||||
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt( $ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response = curl_exec( $ch );
|
||||
//If you need to debug, or find out why you can't send message uncomment line below, and execute script.
|
||||
//echo $response;
|
||||
//end WEBHOOK Discord
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//OPTIONS, change it at your choice;
|
||||
$extra_params = "";//no extra params defined by default
|
||||
$cpu_affinity = "NA";//Affinity to one core/thread of the cpu by number, use NA to disable it
|
||||
$nice = "0";//Min priority=19 Max Priority=-19
|
||||
|
||||
//Add Game home to database
|
||||
//HARD CODE TO /home/gameserver/
|
||||
$rserver = $db->getRemoteServer($remote_server_id);
|
||||
$game_path = "/home/gameserver/";
|
||||
$home_id = $db->addGameHome( $remote_server_id, $user_id, $home_cfg_id, $game_path, $home_name, $remote_control_password, $ftp_password);
|
||||
|
||||
//Add IP:Port Pair to the Game Home
|
||||
//need to get the IP_ID for this remote server.
|
||||
$result = $db->resultQuery("SELECT ip_id FROM OGP_DB_PREFIXremote_server_ips WHERE remote_server_id=".$ip);
|
||||
foreach ($result as $rs)
|
||||
{
|
||||
$ip_id = $rs['ip_id'];
|
||||
}
|
||||
$add_port = $db->addGameIpPort( $home_id, $ip_id, $db->getNextAvailablePort($ip_id,$home_cfg_id) );
|
||||
|
||||
//Assign the Game Mod to the Game Home
|
||||
$mod_id = $db->addModToGameHome( $home_id, $mod_cfg_id );
|
||||
$db->updateGameModParams( $max_players, $extra_params, $cpu_affinity, $nice, $home_id, $mod_cfg_id );
|
||||
$db->assignHomeTo( "user", $user_id, $home_id, $access_rights );
|
||||
|
||||
//Get The home info without mods in 1 array (Necesary for remote connection).
|
||||
$home_info = $db->getGameHomeWithoutMods($home_id);
|
||||
|
||||
//Create the remote connection
|
||||
$remote = new OGPRemoteLibrary($home_info['agent_ip'],$home_info['agent_port'],$home_info['encryption_key'],$home_info['timeout']);
|
||||
|
||||
//Get Full home info in 1 array
|
||||
$home_info = $db->getGameHome($home_id);
|
||||
|
||||
//Read the Game Config from the XML file
|
||||
$server_xml = read_server_config(SERVER_CONFIG_LOCATION."/".$home_info['home_cfg_file']);
|
||||
|
||||
//Get Values from XML
|
||||
$modkey = $home_info['mods'][$mod_id]['mod_key'];
|
||||
$mod_xml = xml_get_mod($server_xml, $modkey);
|
||||
$installer_name = $mod_xml->installer_name;
|
||||
$mod_cfg_id = $home_info['mods'][$mod_id]['mod_cfg_id'];
|
||||
|
||||
//Get Preinstall commands from xml
|
||||
$precmd = $server_xml->pre_install;
|
||||
|
||||
|
||||
//Get Postinstall commands from xml
|
||||
$postcmd = $server_xml->post_install;
|
||||
|
||||
|
||||
//Enable FTP account in remote server
|
||||
if ($ftp == "enabled")
|
||||
{
|
||||
$remote->ftp_mgr("useradd", $home_info['home_id'], $home_info['ftp_password'], $home_info['home_path']);
|
||||
$db->changeFtpStatus('enabled',$home_info['home_id']);
|
||||
}
|
||||
|
||||
//Install files for this service in the remote server
|
||||
// -Steam
|
||||
$exec_folder_path = clean_path($home_info['home_path'] . "/" . $server_xml->exe_location );
|
||||
$exec_path = clean_path($exec_folder_path . "/" . $server_xml->server_exec_name );
|
||||
|
||||
if ($install_method == "steam")
|
||||
{
|
||||
if ( $server_xml->installer == "steamcmd" )
|
||||
{
|
||||
if( preg_match("/win32/", $server_xml->game_key) OR preg_match("/win64/", $server_xml->game_key) )
|
||||
$cfg_os = "windows";
|
||||
elseif( preg_match("/linux/", $server_xml->game_key) )
|
||||
$cfg_os = "linux";
|
||||
|
||||
// Some games like L4D2 require anonymous login
|
||||
if($mod_xml->installer_login){
|
||||
$login = $mod_xml->installer_login;
|
||||
$pass = '';
|
||||
}else{
|
||||
$login = $settings['steam_user'];
|
||||
$pass = $settings['steam_pass'];
|
||||
}
|
||||
|
||||
$modname = ( $installer_name == '90' and !preg_match("/(cstrike|valve)/", $modkey) ) ? $modkey : '';
|
||||
$betaname = isset($mod_xml->betaname) ? $mod_xml->betaname : '';
|
||||
$betapwd = isset($mod_xml->betapwd) ? $mod_xml->betapwd : '';
|
||||
$arch = isset($mod_xml->steam_bitness) ? $mod_xml->steam_bitness : '';
|
||||
|
||||
$remote->steam_cmd( $home_id,$home_info['home_path'],$installer_name,$modname,
|
||||
$betaname,$betapwd,$login,$pass,$settings['steam_guard'],
|
||||
$exec_folder_path,$exec_path,$precmd,$postcmd,$cfg_os,'',$arch);
|
||||
}
|
||||
}
|
||||
// -Rsync
|
||||
elseif ($install_method == "rsync")
|
||||
{
|
||||
|
||||
//Rsync Server
|
||||
$url = "files.iaregamer.com";
|
||||
//OS
|
||||
if( preg_match("/win32/", $server_xml->game_key) OR preg_match("/win64/", $server_xml->game_key) )
|
||||
$os = "windows";
|
||||
elseif( preg_match("/linux/", $server_xml->game_key) )
|
||||
$os = "linux";
|
||||
//Rsync Game Name
|
||||
//JUST SET RS_GNAME TO GAME xml NAME
|
||||
$rs_gname = $server_xml->game_key;
|
||||
|
||||
//Starting Sync
|
||||
$full_url = "$url/rsync_installer/$rs_gname/$os/";
|
||||
|
||||
|
||||
|
||||
$remote->start_rsync_install($home_id,$home_info['home_path'],"$full_url",$exec_folder_path,$exec_path,$precmd,$postcmd);
|
||||
}
|
||||
// -Manual
|
||||
elseif ($install_method == "manual")
|
||||
{
|
||||
// Start File Download and uncompress
|
||||
$filename = !empty($manual_url) ? substr($manual_url, -9) : "";
|
||||
$remote->start_file_download($manual_url,$home_info['home_path'],$filename,"uncompress");
|
||||
}
|
||||
echo "<h4><br><p>".get_lang('starting_installations')."</p></h4><br>";
|
||||
//PANEL LOG
|
||||
$db->logger( "CREATED NEW SERVER " . $home_id);
|
||||
// SEND EMAIL to new server only
|
||||
if($order['finish_date'] == 0){
|
||||
$settings = $db->getSettings();
|
||||
$subject = "New Gameserver installed at " . $settings['panel_name'];
|
||||
$email = $db->resultQuery(" SELECT DISTINCT users_email
|
||||
FROM ogp_users, ogp_billing_orders
|
||||
WHERE ogp_users.user_id = $user_id")[0]["users_email"];
|
||||
|
||||
$message = "Your server, " . $home_name ." ID #". $home_id . " at " . $settings['panel_name'] . " has just been created.<br>
|
||||
Thank You for your continued support.<br>
|
||||
If you have any questions or requests, visit our website or contact us directly in our Discord Server.
|
||||
You can login to the Game Panel and click on Game Monitor to see your server. <br><br>
|
||||
Thank you!<br> ";
|
||||
$mail = mymail($email, $subject, $message, $settings);
|
||||
$rundate = date('d/M/y G:i',$now);
|
||||
|
||||
if (!$mail)
|
||||
$db->logger( "Email FAILED - Server Created " . $home_id);
|
||||
|
||||
|
||||
//WEBHOOK Discord=======================================================================================
|
||||
|
||||
$webhookurl = $settings['webhookurl'];
|
||||
|
||||
|
||||
$msg = "A new server, ". $home_name ." ID #". $home_id . ", has just been created.";
|
||||
$json_data = array ('content'=>"$msg");
|
||||
$make_json = json_encode($json_data);
|
||||
$ch = curl_init( $webhookurl );
|
||||
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
|
||||
curl_setopt( $ch, CURLOPT_POST, 1);
|
||||
curl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json);
|
||||
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt( $ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response = curl_exec( $ch );
|
||||
//If you need to debug, or find out why you can't send message uncomment line below, and execute script.
|
||||
//echo $response;
|
||||
//end WEBHOOK Discord
|
||||
}
|
||||
// END EMAIL
|
||||
|
||||
|
||||
}
|
||||
// Set expiration date in ogp database
|
||||
//End_date is when the invoice is printed.
|
||||
//finish_date the server will be suspended
|
||||
//in cron_shop the finish_date is used to delete the server
|
||||
//several days after being suspended
|
||||
if ($order['invoice_duration'] == "day")
|
||||
{
|
||||
|
||||
if($order['finish_date'] == 0){
|
||||
$finish_date = strtotime('+'.$order['qty'].' day');
|
||||
$end_date = strtotime('- 2 day',$finish_date);
|
||||
}
|
||||
else{
|
||||
//this is a renewel, start from end of previous order
|
||||
$finish_date = strtotime('+'.$order['qty'].' day',$order['finish_date']);
|
||||
$end_date = strtotime('- 6 hour', $finish_date);
|
||||
}
|
||||
|
||||
}
|
||||
elseif ($order['invoice_duration'] == "month")
|
||||
{
|
||||
// this is a new order
|
||||
if($order['finish_date'] == 0){
|
||||
$finish_date = strtotime('+'.$order['qty'].' month');
|
||||
$end_date = strtotime('- 7 day',$finish_date);
|
||||
|
||||
}
|
||||
else{
|
||||
//this is a renewel, start from end of previous order
|
||||
$finish_date = strtotime('+'.$order['qty'].' month',$order['finish_date']);
|
||||
$end_date = strtotime('- 7 day',$finish_date);
|
||||
}
|
||||
}
|
||||
elseif ($order['invoice_duration'] == "year")
|
||||
{
|
||||
// this is a new order
|
||||
if($order['finish_date'] == 0){
|
||||
$finish_date = strtotime('+'.$order['qty'].' year');
|
||||
$end_date = strtotime('- 2 week',$finish_date);
|
||||
}
|
||||
else{
|
||||
//this is a renewel, start from end of previous order
|
||||
$finish_date = strtotime('+'.$order['qty'].' year',$order['finish_date']);
|
||||
$end_date = strtotime('- 2 week',$finish_date);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// set order expire date
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
SET end_date='" . $db->realEscapeSingle($end_date) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
SET finish_date='" . $db->realEscapeSingle($finish_date) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
// Save home id created by this order
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
SET home_id='" . $db->realEscapeSingle($home_id) . "' WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
}
|
||||
|
||||
//Update Cart Payment Status as 3(paid and installed)
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
SET paid=3
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
// Set payment/creation date
|
||||
$date = date('d M Y');
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
SET date='" . $db->realEscapeSingle($date) . "'
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
$db->query( "UPDATE OGP_DB_PREFIXgame_mods SET max_players= ".$order['max_players']." WHERE home_id=".$db->realEscapeSingle($home_id));
|
||||
|
||||
|
||||
//Refresh to Game Monitor.
|
||||
$view->refresh("home.php?m=gamemanager&p=game_monitor");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,217 +0,0 @@
|
|||
<?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
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
<?php
|
||||
|
||||
|
||||
chdir("../../"); /* It just makes life easier */
|
||||
|
||||
/* Includes */
|
||||
require_once("includes/helpers.php");
|
||||
require_once("includes/config.inc.php");
|
||||
require_once("includes/functions.php");
|
||||
require_once("includes/lib_remote.php");
|
||||
require_once("includes/lang.php");
|
||||
require_once("modules/config_games/server_config_parser.php");
|
||||
$db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name, $table_prefix);
|
||||
$settings = $db->getSettings();
|
||||
$debug = $settings['debug'];
|
||||
$paypal_email = $settings['paypal_email']; // your paypal email address
|
||||
|
||||
|
||||
|
||||
$cart_id = $_POST['item_number'];
|
||||
|
||||
$fpx = fopen('modules/billing/ipnlog.txt', 'w');
|
||||
$header = "====================== CART ID " . $cart_id . " ========================\n";
|
||||
fwrite($fpx, $header);
|
||||
|
||||
|
||||
// STEP 1: read POST data
|
||||
// Reading POSTed data directly from $_POST causes serialization issues with array data in the POST.
|
||||
// Instead, read raw POST data from the input stream.
|
||||
$raw_post_data = file_get_contents('php://input');
|
||||
$raw_post_array = explode('&', $raw_post_data);
|
||||
$myPost = array();
|
||||
foreach ($raw_post_array as $keyval) {
|
||||
$keyval = explode ('=', $keyval);
|
||||
if (count($keyval) == 2)
|
||||
$myPost[$keyval[0]] = urldecode($keyval[1]);
|
||||
}
|
||||
// read the IPN message sent from PayPal and prepend 'cmd=_notify-validate'
|
||||
$req = 'cmd=_notify-validate';
|
||||
if (function_exists('get_magic_quotes_gpc')) {
|
||||
$get_magic_quotes_exists = true;
|
||||
}
|
||||
foreach ($myPost as $key => $value) {
|
||||
if ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {
|
||||
$value = urlencode(stripslashes($value));
|
||||
} else {
|
||||
$value = urlencode($value);
|
||||
}
|
||||
$req .= "&$key=$value";
|
||||
fwrite($fpx, "$key=$value\n");
|
||||
|
||||
}
|
||||
// Step 2: POST IPN data back to PayPal to validate
|
||||
if ( $settings['sandbox'] == 1) {
|
||||
$ch = curl_init('https://ipnpb.sandbox.paypal.com/cgi-bin/webscr');
|
||||
}else {
|
||||
$ch = curl_init('https://ipnpb.paypal.com/cgi-bin/webscr');
|
||||
}
|
||||
|
||||
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
|
||||
// In wamp-like environments that do not come bundled with root authority certificates,
|
||||
// please download 'cacert.pem' from "https://curl.haxx.se/docs/caextract.html" and set
|
||||
// the directory path of the certificate as shown below:
|
||||
// curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
|
||||
if ( !($res = curl_exec($ch)) ) {
|
||||
// error_log("Got " . curl_error($ch) . " when processing IPN data");
|
||||
curl_close($ch);
|
||||
exit;
|
||||
}
|
||||
curl_close($ch);
|
||||
|
||||
|
||||
|
||||
// inspect IPN validation result and act accordingly
|
||||
if (strcmp ($res, "VERIFIED") == 0) {
|
||||
fwrite($fpx, "VERIFIED\n");
|
||||
// assign posted variables to local variables
|
||||
$item_name = $_POST['item_name'];
|
||||
$item_number = $_POST['item_number'];
|
||||
$payment_status = $_POST['payment_status'];
|
||||
$payment_amount = $_POST['mc_gross'];
|
||||
$payment_currency = $_POST['mc_currency'];
|
||||
$txn_id = $_POST['txn_id'];
|
||||
$receiver_email = $_POST['receiver_email'];
|
||||
$payer_email = $_POST['payer_email'];
|
||||
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
SET paid=1
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
fwrite($fpx, "IPN Processed\n");
|
||||
|
||||
|
||||
// The IPN is verified, process it
|
||||
} else if (strcmp ($res, "INVALID") == 0) {
|
||||
// IPN invalid, log for manual investigation
|
||||
echo "The response from IPN was: <b>" .$res ."</b>";
|
||||
}
|
||||
|
||||
fclose($fpx);
|
||||
|
||||
// Reply with an empty 200 response to indicate to paypal the IPN was received correctly.
|
||||
//header("HTTP/1.1 200 OK");
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
====================== CART ID ========================
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
<?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.
|
||||
*
|
||||
*/
|
||||
|
||||
// Module general information
|
||||
$module_title = "billing";
|
||||
$module_version = "1";
|
||||
$db_version = 4;
|
||||
$module_required = FALSE;
|
||||
$module_menus = array(
|
||||
array( 'subpage' => 'shop', 'name'=>'Shop', 'group'=>'user,admin' ),
|
||||
array( 'subpage' => 'orders', 'name'=>'Orders', 'group'=>'user,admin' ),
|
||||
array( 'subpage' => 'services', 'name'=>'Services', 'group'=>'admin' ),
|
||||
array( 'subpage' => 'shop_settings', 'name'=>'Shop Settings', 'group'=>'admin' ),
|
||||
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';"
|
||||
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<navigation>
|
||||
<!-- User Side -->
|
||||
<page key="shop" file="shop.php" access="user,admin" />
|
||||
<page key="paid" file="paid.php" access="user,admin" />
|
||||
<page key="cart" file="cart.php" access="user,admin" />
|
||||
<page key="add_to_cart" file="add_to_cart.php" access="user,admin" />
|
||||
<page key="paypal" file="paypal.php" access="user,admin" />
|
||||
<!-- Admin Side -->
|
||||
<page key="shop_settings" file="settings.php" access="admin" />
|
||||
<page key="services" file="services.php" access="admin" />
|
||||
<page key="coupons" file="coupons.php" access="admin" />
|
||||
<!-- Billing -->
|
||||
<page key="orders" file="orders.php" access="user,admin" />
|
||||
<page key="paid" file="paid.php" access="user,admin" />
|
||||
<page key="bill" file="bill.php" access="user,admin" />
|
||||
<page key="create_servers" file="create_servers.php" access="user,admin" />
|
||||
<!-- Guest-->
|
||||
|
||||
|
||||
</navigation>
|
||||
|
|
@ -1,257 +0,0 @@
|
|||
<?php
|
||||
function exec_ogp_module()
|
||||
{
|
||||
error_reporting(E_ALL);
|
||||
|
||||
global $db,$settings;
|
||||
|
||||
if(isset($_POST['remove']))
|
||||
{
|
||||
$query_delete_order = $db->query("DELETE FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
$query_delete_order = $db->query("DELETE FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
}
|
||||
if(isset($_POST['paid']))
|
||||
{
|
||||
$query_set_as_paid = $db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
SET paid=1
|
||||
WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
}
|
||||
$status_array = array ( "not_paid" => 0,
|
||||
"paid" => 1,
|
||||
"procesing_payment" => 2,
|
||||
"paid_and_installed" => 3
|
||||
);
|
||||
?>
|
||||
<style>
|
||||
h4 {
|
||||
width:250px;
|
||||
height:25px;
|
||||
background:#f5f5f5;
|
||||
border-top-style:solid;
|
||||
border-top-color:#afafaf;
|
||||
border-top-width:1px;
|
||||
border-style: solid;
|
||||
border-color: #CFCFCF;
|
||||
border-width: 1px;
|
||||
padding-top:8px;
|
||||
text-align: center;
|
||||
font-family:"Trebuchet MS";
|
||||
}
|
||||
</style>
|
||||
<h2><?php print_lang("orders");?></h2>
|
||||
<form method="post" action="?m=billing&p=shop">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input type="submit" value="<?php print_lang("shop");?>">
|
||||
</form>
|
||||
<?php
|
||||
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
$user_id = $_SESSION['user_id'];
|
||||
|
||||
//SHOW THE NUMBER OF SERVERS RENTED AND EXPECTED INCOME
|
||||
if($isAdmin)
|
||||
{
|
||||
echo "<h1>Accounting</h1>";
|
||||
$servercount = 0;
|
||||
$income = 0;
|
||||
$paidOrders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE status > 0");
|
||||
foreach($paidOrders as $inc)
|
||||
{
|
||||
$servercount = $servercount +1;
|
||||
$income = $income + $inc['max_players'] * $inc['price'];
|
||||
|
||||
}
|
||||
echo "Total Rented Gameservers: $servercount<br>";
|
||||
echo "Total Income: $" . number_format( $income , 2 ) . "<br>";
|
||||
|
||||
}
|
||||
foreach($status_array as $status => $paid_value)
|
||||
if($isAdmin or $status == "paid_and_installed")
|
||||
{
|
||||
{
|
||||
if ($isAdmin){
|
||||
$carts = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE paid =" . $db->realEscapeSingle($paid_value) ." order by cart_id DESC");
|
||||
}else{
|
||||
$carts = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE paid=3 AND user_id = " . $user_id ." order by cart_id DESC");
|
||||
}
|
||||
if( $carts > 0 )
|
||||
{
|
||||
?>
|
||||
<h2><?php print_lang($status);?></h2><?php
|
||||
foreach($carts as $cart)
|
||||
{
|
||||
?>
|
||||
<center>
|
||||
<table style="width:100%;text-align:center;" class="center">
|
||||
<tr>
|
||||
<th style="width:25%"><?php print_lang("login");?></th>
|
||||
<th><?php print_lang("cart_id");?></th>
|
||||
<th><?php print_lang("order_id");?></th>
|
||||
<th>slot price</th>
|
||||
<th>Paid Date</th>
|
||||
<?php
|
||||
if($status == "paid_and_installed")
|
||||
{?>
|
||||
<th>Expiration dates</th>
|
||||
<?php
|
||||
}?>
|
||||
</tr>
|
||||
<?php
|
||||
$orders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart['cart_id'])." order by order_id DESC" );
|
||||
$subtotal = 0;
|
||||
foreach($orders as $order)
|
||||
{
|
||||
if($order['qty'] > 1)
|
||||
$order['invoice_duration'] = $order['invoice_duration']."s";
|
||||
?>
|
||||
<tr class="tr">
|
||||
<td><a href="?m=user_admin&p=edit_user&user_id=<?php echo $order['user_id'];?>" ><?php $user = $db->getUserById($order['user_id']); echo $user['users_login'];?></a></td>
|
||||
<td><b class="success"><?php echo $order['cart_id'];?></b></td>
|
||||
<td><b class="success"><?php echo $order['order_id'];?></b></td>
|
||||
<td><?php echo "$".$order['price'].$cart['currency'];?></td>
|
||||
<td><?php echo $cart['date'];?></td>
|
||||
<?php
|
||||
if($status == "paid_and_installed")
|
||||
{
|
||||
$today = time();
|
||||
$order_status = "Unknown";
|
||||
$order_status = $order['status'] > '0' ? "<b style='color:green;'>".get_lang('active')."</b>":$order_status;
|
||||
$order_status = $order['status'] == '0' ? "<b style='color:yellow;'>".get_lang('unpaid')."</b>":$order_status;
|
||||
$order_status = $order['status'] == '-1' ? "<b style='color:yellow;'>".get_lang('invoice_due')."</b>":$order_status;
|
||||
$order_status = $order['status'] == '-2' ? "<b style='color:red;'>".get_lang('suspended')."</b>":$order_status;
|
||||
$order_status = $order['status'] == '-3' ? "<b style='color:green;'>".get_lang('renewed')."</b>":$order_status;
|
||||
$order_status = $order['status'] == '-99' ? "<b style='color:white;'>".get_lang('expired')."</b>":$order_status;
|
||||
$finish_date = date('d/M/Y H:i',$order['finish_date']);
|
||||
echo "<td>Status: <b>$order_status</b>";
|
||||
echo "<br>Expiration: <b>$finish_date</b></td>";
|
||||
}
|
||||
?>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr class="tr">
|
||||
<td><?php echo $order['home_name']?></td>
|
||||
<td><?php echo " [ ".$order['max_players']." ".get_lang('slots').", ".$order['qty']." ".get_lang($order['invoice_duration'])." ]";?>
|
||||
|
||||
</td></tr>
|
||||
|
||||
<?php
|
||||
$max_players = $order['max_players'];
|
||||
$qty = $order['qty'];
|
||||
$price = $order['price'];
|
||||
$subtotal += $order['price'] * $max_players * $qty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
if ($status == "not_paid")
|
||||
{
|
||||
?>
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input name="paid" type="submit" value="<?php print_lang("set_as_paid");?>">
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
elseif($status == "paid")
|
||||
{
|
||||
|
||||
?>
|
||||
<form method="post" action="home.php?m=billing&p=create_servers">
|
||||
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<?php
|
||||
if($order['extended'] == "1")
|
||||
{
|
||||
?>
|
||||
<input name="enable_server" type="submit" value="<?php print_lang("enable_server");?>">
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<input name="create_server" type="submit" value="<?php print_lang("create_server");?>">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
elseif($status == "procesing_payment")
|
||||
{
|
||||
?>
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input name="paid" type="submit" value="<?php print_lang("set_as_paid");?>">
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
elseif($status == "paid_and_installed")
|
||||
{
|
||||
?>
|
||||
<form method="post" action="?m=billing&p=bill">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input name="paid" type="submit" value="<?php print_lang("see_invoice");?>">
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr><tr>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
echo get_lang('subtotal')." <b>$".number_format( $subtotal , 2 ). " " .$cart['currency']."</b></br>";
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
//obter as informações de cupom usadas neste pedido
|
||||
$coupon_savings = 0;
|
||||
if($cart['coupon_id']>0) {
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_coupons WHERE id = '". $cart['coupon_id'] . "'");
|
||||
foreach($result as $coupon){
|
||||
$coupon_savings = $subtotal * ($coupon['discount']/ 100);
|
||||
echo "Sub-total c/discount <b>$" .number_format( ($subtotal - $coupon_savings) , 2 ).$cart['currency']."</b></br><td>";
|
||||
echo "Coupon (".$coupon['code'].") <b>- $" .number_format( $coupon_savings , 2 ).$cart['currency']."</b></br>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($settings['tax_amount'] > 0){
|
||||
echo get_lang('tax')."<b>(".$settings['tax_amount']."%) + $".number_format( $settings['tax_amount']/100*$subtotal, 2 ).$cart['currency']."</b></br>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
//$total = $subtotal-$coupon_savings+($settings['tax_amount']/100*$subtotal);
|
||||
$total = ($subtotal - $coupon_savings) * ($settings['tax_amount'] / 100 + 1);
|
||||
echo get_lang('total')." <b>$".number_format( $total , 2 ). " " .$cart['currency']."</b>";
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
if($status == "paid_and_installed")
|
||||
{
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
}//end foreach
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
<?php
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db,$view,$settings;
|
||||
$loadpage = "?m=billing&p=paid";
|
||||
$count = $_POST['count'] + 1;
|
||||
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_carts WHERE cart_id= '". $_POST['cart_id'] . "'");
|
||||
foreach($result as $cartID){
|
||||
$paid = $cartID['paid'];
|
||||
}
|
||||
|
||||
echo "<h2>Processing your Payment Info ... </h2>";
|
||||
if($settings['debug']==1){
|
||||
echo "<br>";
|
||||
echo $_POST['count'];
|
||||
echo "<br>";
|
||||
echo $_POST['cart_id'];
|
||||
echo "<br>";
|
||||
echo $_POST['payment_status'];
|
||||
echo "<br>";
|
||||
}
|
||||
//check the DB and see if its been updated as paid
|
||||
if($paid > 0){
|
||||
$loadpage = "?m=billing&p=create_servers";
|
||||
|
||||
}
|
||||
|
||||
//waited too long .. go to orders page
|
||||
if($count > 5){
|
||||
$loadpage = "?m=billing&p=orders";
|
||||
echo "<h2>There was a Problem, Please contact Support ... </h2>";
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<form name='paid' action='<?php echo $loadpage?>' method='post'>
|
||||
<input type='hidden' name='cart_id' value='<?php echo $_POST["cart_id"]?>'>
|
||||
<input type='hidden' name='payment_status' value='<?php echo $_POST["payment_status"] ?>'>
|
||||
<input type='hidden' name='count' value='<?php echo $count?>'>
|
||||
</form>
|
||||
<script>
|
||||
var auto_refresh = setInterval(
|
||||
function()
|
||||
{
|
||||
submitform();
|
||||
}, 5000);
|
||||
function submitform()
|
||||
{
|
||||
document.paid.submit();
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
<?php
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db,$view;
|
||||
$settings = $db->getSettings();
|
||||
function curPageName()
|
||||
{
|
||||
return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
|
||||
}
|
||||
|
||||
|
||||
if ( $settings['sandbox'] == 1) {
|
||||
$paypal_url = "https://www.sandbox.paypal.com/cgi-bin/webscr";
|
||||
$paypal_ipn_url = "https://ipnpb.sandbox.paypal.com/cgi-bin/webscr";
|
||||
}
|
||||
else {
|
||||
$paypal_url = "https://www.paypal.com/cgi-bin/webscr";
|
||||
$paypal_ipn_url = "https://ipnpb.paypal.com/cgi-bin/webscr";
|
||||
}
|
||||
|
||||
$s = ( isset($_SERVER['HTTPS']) and get_true_boolean($_SERVER['HTTPS']) ) ? "s" : "";
|
||||
$port = isset($_SERVER['SERVER_PORT']) & $_SERVER['SERVER_PORT'] != "80" ? ":".$_SERVER['SERVER_PORT'] : NULL ;
|
||||
$this_script = 'http'.$s.'://'.$_SERVER['SERVER_NAME'].$port.$_SERVER['SCRIPT_NAME'];
|
||||
$current_folder_url = str_replace( curPageName(), "", $this_script);
|
||||
$cart_id = $_GET['cart_id'];
|
||||
$debug = $settings['debug'];
|
||||
|
||||
|
||||
if(!empty($cart_id))
|
||||
{
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
//get couponID then discount for this cart
|
||||
$result= $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
foreach ($result as $cartDB){
|
||||
$coupon_id = $cartDB['id'];
|
||||
}
|
||||
|
||||
$coupon_discount = 0;
|
||||
$result = $db->resultQuery( "SELECT discount FROM ogp_billing_coupons WHERE id=".$db->realEscapeSingle($cartDB['coupon_id']));
|
||||
foreach ($result as $couponDB){
|
||||
$coupon_discount=$couponDB['discount'];
|
||||
}
|
||||
|
||||
$coupon_discount = $coupon_discount / 100;
|
||||
|
||||
if( !empty( $orders ) )
|
||||
{
|
||||
$cart['price'] = 0;
|
||||
foreach($orders as $order)
|
||||
{
|
||||
if( $order['qty'] > 1 )
|
||||
$order['invoice_duration'] = $order['invoice_duration']."s";
|
||||
$cart['price'] += ($order['price']*$order['max_players']*$order['qty']);
|
||||
|
||||
|
||||
if( !isset( $cart['name'] ) )
|
||||
$cart['name'] = $order['home_name']."(".$order['qty'].get_lang($order['invoice_duration']).",".$order['max_players'].get_lang('slots').")";
|
||||
else
|
||||
$cart['name'] .= ' + '.$order['home_name']."(".$order['qty'].get_lang($order['invoice_duration']).",".$order['max_players'].get_lang('slots').")";
|
||||
}
|
||||
//price minus coupon discount
|
||||
$cart['price'] = $cart['price'] - $cart['price']*$coupon_discount;
|
||||
$total = $cart['price']+($settings['tax_amount']/100*$cart['price']);
|
||||
if ($total === 0)
|
||||
{
|
||||
$db->query("UPDATE " . $table_prefix . "billing_carts
|
||||
SET paid=1
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
$view->refresh("home.php?m=billing&p=cart",0);
|
||||
}
|
||||
$total = number_format( $total , 2 );
|
||||
}
|
||||
}
|
||||
|
||||
// -- GENERATING THE PAYPAL ORDER BUTTON --
|
||||
?>
|
||||
<html><body <?php if ( $debug != 1) { ?>onload="form1.submit()"<?php } ?>>
|
||||
<form name="form1" action="<?php echo $paypal_url ?>" method="post">
|
||||
<input type="hidden" name="cmd" value="_xclick">
|
||||
<input type="hidden" name="business" value="<?php echo $settings['paypal_email']; ?>">
|
||||
<input type="hidden" name="item_name" value="<?php echo $cart['name']; ?>">
|
||||
<input type="hidden" name="item_number" value="<?php echo $cart_id; ?>">
|
||||
<input type="hidden" name="invoice" value="<?php echo $cart_id; ?>">
|
||||
<input type="hidden" name="amount" value="<?php echo $total; ?>">
|
||||
<input type="hidden" name="return" value="<?php echo $current_folder_url.'modules/billing/bounce.php';?>">
|
||||
<input type="hidden" name="cancel_return" value="<?php echo $this_script.'?m=billing&p=cart';?>">
|
||||
<input type="hidden" name="notify_url" value="<?php echo $current_folder_url.'modules/billing/ipn.php';?>">
|
||||
<input type="hidden" name="currency_code" value="<?php echo $settings['currency'];?>">
|
||||
<input type="hidden" name="rm" value="2">
|
||||
<?php
|
||||
if ( $debug == 1) { ?>
|
||||
<h3 align="center">Debug Mode<br>
|
||||
Post Data being sent to Paypal</h3>
|
||||
<?php
|
||||
echo "<br>Sandbox Enabled = " .$settings['sandbox'];
|
||||
echo "<br>Paypal Url = " .$paypal_url;
|
||||
echo "<br>";
|
||||
echo "<br>Paypal Email = ".$settings['paypal_email'];
|
||||
echo "<br>Item Name = ".$cart['name'];
|
||||
echo "<br>Item Number = ".$cart_id;
|
||||
echo "<br>Invoice ID = ".$cart_id;
|
||||
echo "<br>Amount = ".$total;
|
||||
echo "<br>Return Url = ". $current_folder_url."modules/billing/bounce.php";
|
||||
echo "<br>Cancel Url = ". $this_script."?m=billing&p=cart";
|
||||
echo "<br>Notify Url = ". $current_folder_url."modules/billing/ipn.php";
|
||||
echo "<br>Currency Code =". $settings['currency'];
|
||||
echo "<br><br>";
|
||||
echo "<input type='submit' value='Click To Proceed To Paypal'>";
|
||||
}
|
||||
echo "After payment, you must return to this site to CREATE YOUR SERVER<br>";
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,355 +0,0 @@
|
|||
<?php
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
|
||||
//Querying UPDATE a service FROM DB
|
||||
if (isset($_POST['service']) AND isset($_POST['new_enabled']))
|
||||
{
|
||||
$new_remote_server_id = $db->realEscapeSingle($_POST['new_remote_server_id']);
|
||||
$new_price_monthly = $db->realEscapeSingle($_POST['new_price_monthly']);
|
||||
$new_out_of_stock = $db->realEscapeSingle($_POST['new_out_of_stock']);
|
||||
$new_url = $db->realEscapeSingle($_POST['new_url']);
|
||||
$new_enabled = $db->realEscapeSingle($_POST['new_enabled']);
|
||||
$service = $db->realEscapeSingle($_POST['service']);
|
||||
|
||||
//Create UPDATE query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_services
|
||||
SET remote_server_id = '".$new_remote_server_id."',
|
||||
price_monthly ='".$new_price_monthly."',
|
||||
remote_server_id = '".$new_remote_server_id."',
|
||||
out_of_stock = '".$new_out_of_stock."',
|
||||
img_url ='".$new_url."',
|
||||
enabled = '".$new_enabled."'
|
||||
WHERE service_id=".$service;
|
||||
$db->query($qry_change_url);
|
||||
}
|
||||
|
||||
//Querying UPDATE enabled/disabled remote servers DB
|
||||
if (isset($_POST['update_remote_servers']))
|
||||
{
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXremote_servers");
|
||||
foreach($result as $rs)
|
||||
{
|
||||
$server_enabled = 0;
|
||||
//get the value from the checkbox
|
||||
if(isset($_POST[$rs['remote_server_id']]))
|
||||
{
|
||||
$server_enabled = 1;
|
||||
|
||||
}
|
||||
|
||||
//update the table with current value
|
||||
$query = "UPDATE OGP_DB_PREFIXremote_servers SET enabled = '".$server_enabled."' WHERE remote_server_id=".$rs['remote_server_id'];
|
||||
$db->query($query);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//end ENABLE REMOTE SERVERS
|
||||
|
||||
|
||||
|
||||
//Querying INSERT new service INTO DB
|
||||
if(isset($_POST['mod_cfg_id']) AND isset($_POST['remote_server_id']) AND isset($_POST['slot_max_qty']) AND isset($_POST['price_daily']) AND isset($_POST['price_monthly']) AND isset($_POST['price_year']))
|
||||
{
|
||||
//Sanitize the POST values
|
||||
$home_cfg_id = $db->realEscapeSingle($_POST['home_cfg_id']);
|
||||
$mod_cfg_id = $db->realEscapeSingle($_POST['mod_cfg_id']);
|
||||
$service_name = $db->realEscapeSingle($_POST['service_name']);
|
||||
foreach ($_POST['remote_server_id'] as $remote)
|
||||
{
|
||||
$remote_server_id = $remote_server_id . $remote . " ";
|
||||
}
|
||||
//echo $remote_servers_id;
|
||||
//$remote_server_id = $remote_servers_id;
|
||||
//$remote_server_id = $db->realEscapeSingle($_POST['remote_server_id']);
|
||||
$slot_max_qty = $db->realEscapeSingle($_POST['slot_max_qty']);
|
||||
$slot_min_qty = $db->realEscapeSingle($_POST['slot_min_qty']);
|
||||
$price_daily = $db->realEscapeSingle($_POST['price_daily']);
|
||||
$price_monthly = $db->realEscapeSingle($_POST['price_monthly']);
|
||||
$price_year = $db->realEscapeSingle($_POST['price_year']);
|
||||
$description = $db->realEscapeSingle($_POST['description']);
|
||||
$img_url = $db->realEscapeSingle($_POST['img_url']);
|
||||
$ftp = $db->realEscapeSingle($_POST['ftp']);
|
||||
$install_method = $db->realEscapeSingle($_POST['install_method']);
|
||||
$manual_url = $db->realEscapeSingle($_POST['manual_url']);
|
||||
$access_rights = "";
|
||||
$enabled = 1;
|
||||
if(isset($_POST['allow_updates']))$access_rights .= $db->realEscapeSingle($_POST['allow_updates']);
|
||||
if(isset($_POST['allow_file_management']))$access_rights .= $db->realEscapeSingle($_POST['allow_file_management']);
|
||||
if(isset($_POST['allow_parameter_usage']))$access_rights .= $db->realEscapeSingle($_POST['allow_parameter_usage']);
|
||||
if(isset($_POST['allow_extra_params']))$access_rights .= $db->realEscapeSingle($_POST['allow_extra_params']);
|
||||
if(isset($_POST['allow_ftp_usage']))$access_rights .= $db->realEscapeSingle($_POST['allow_ftp_usage']);
|
||||
if(isset($_POST['allow_custom_fields']))$access_rights .= $db->realEscapeSingle($_POST['allow_custom_fields']);
|
||||
|
||||
$qry_add_service = "INSERT INTO OGP_DB_PREFIXbilling_services(service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, out_of_stock, slot_max_qty , slot_min_qty, price_daily, price_monthly, price_year, description, img_url, ftp, install_method, manual_url, access_rights,enabled) VALUES(NULL, '".$home_cfg_id."', '".$mod_cfg_id."', '".$service_name."', '".$remote_server_id."', 0,'".$slot_max_qty."', '".$slot_min_qty."', '".$price_daily."', '".$price_monthly."', '".$price_year."', '".$description."', '".$img_url."', '".$ftp."', '".$install_method."', '".$manual_url."', '".$access_rights."', '" . $enabled . "')";
|
||||
$db->query($qry_add_service);
|
||||
}
|
||||
|
||||
//Querying REMOVE service FROM DB
|
||||
if (isset($_POST['service_id']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_services WHERE service_id=" . $db->realEscapeSingle($_POST['service_id']) );
|
||||
}
|
||||
|
||||
?>
|
||||
<h2><?php print_lang('add_service');?></h2>
|
||||
<form method="POST" action="">
|
||||
<table class="center">
|
||||
<!-- Part2 - Select MOD -->
|
||||
<?php
|
||||
if(isset($_POST['home_cfg_id']))
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<select name="modcfgid">
|
||||
<?php
|
||||
$mod_qry = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM OGP_DB_PREFIXconfig_mods NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE home_cfg_id=" . $db->realEscapeSingle($_POST['home_cfg_id']));
|
||||
foreach($mod_qry as $array_mods)
|
||||
{
|
||||
if($array_mods['mod_name'] == "none")$array_mods['mod_name']=$array_mods['game_name'];
|
||||
?>
|
||||
<option value="<?php echo $array_mods['mod_cfg_id'];?>"><?php echo $array_mods['mod_name'];?></option>
|
||||
<?php
|
||||
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<input type="hidden" name="homecfgid" value="<?php echo $_POST['home_cfg_id'];?>"/>
|
||||
<tr>
|
||||
<?php
|
||||
}
|
||||
else if (isset($_POST['modcfgid']) AND isset($_POST['homecfgid']))
|
||||
{
|
||||
?>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$result3 = $db->resultQuery("SELECT DISTINCT remote_server_id, remote_server_name, agent_ip, ogp_user FROM OGP_DB_PREFIXremote_servers");
|
||||
?>
|
||||
<td><?php print_lang('remote_server');?></td>
|
||||
<td>
|
||||
<select name="remote_server_id[]" multiple size="5">
|
||||
<?php
|
||||
foreach($result3 as $row3)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $row3['remote_server_id']; ?>">(<?php echo $row3['remote_server_id']; ?>) - IP[<?php echo $row3['agent_ip']; ?>]</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$mods = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM OGP_DB_PREFIXconfig_mods NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE mod_cfg_id=" . $db->realEscapeSingle($_POST['modcfgid']));
|
||||
foreach($mods as $mod)
|
||||
{
|
||||
?>
|
||||
<td><?php print_lang('service_name');?></td>
|
||||
<td><input name="service_name" type="text" size="61" value="<?php if($mod['mod_name']=="none")echo $mod['game_name']; else echo $mod['game_name']." - ".$mod['mod_name'];?>"/></td>
|
||||
<input name="mod_cfg_id" type="hidden" value="<?php echo $mod['mod_cfg_id'];}?>"/>
|
||||
<input name="home_cfg_id" type="hidden" value="<?php echo $_POST['homecfgid'];?>"/>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('min_slot_qty');?></td>
|
||||
<td><input name="slot_min_qty" type="text" size="8" value="16"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('max_slot_qty');?></td>
|
||||
<td><input name="slot_max_qty" type="text" size="8" value="64"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Price Daily</td>
|
||||
<td><input name="price_daily" type="text" size="8" value="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('price_monthly');?></td>
|
||||
<td><input name="price_monthly" type="text" size="8" value="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('price_year');?></td>
|
||||
<td><input name="price_year" type="text" size="8" value="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('ftp_account');?></td>
|
||||
<td>
|
||||
<select name="ftp">
|
||||
<option value="enabled"><?php print_lang('enabled');?></option>
|
||||
<option value="disabled"><?php print_lang('disabled');?></option>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('select_install_method');?></td>
|
||||
<td>
|
||||
<select name="install_method">
|
||||
<option value="steam"><?php print_lang('steam');?></option>
|
||||
<option value="rsync"><?php print_lang('rsync');?></option>
|
||||
<option value="manual"><?php print_lang('manual_from_url');?></option>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('url_for_manual_install');?></td>
|
||||
<td><input name="manual_url" type="text" size="61"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('description');?></td>
|
||||
<td><textarea name='description' cols='45' rows='5'></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('image_url');?></td>
|
||||
<td><textarea name='img_url' cols='45' rows='1'>images/games/unknown.png</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php print_lang('access_rights');?></td>
|
||||
<td>
|
||||
<input name="allow_updates" type="checkbox" value="u" checked="checked"/><?php print_lang('allow_update');?><br>
|
||||
<input name="allow_file_management" type="checkbox" value="f" checked="checked"/><?php print_lang('allow_file_management');?><br>
|
||||
<input name="allow_parameter_usage" type="checkbox" value="p" checked="checked"/><?php print_lang('allow_parameter_usage');?><br>
|
||||
<input name="allow_extra_params" type="checkbox" value="e" checked="checked"/><?php print_lang('allow_extra_parameters_usage');?><br>
|
||||
<input name="allow_ftp_usage" type="checkbox" value="t" checked="checked"/><?php print_lang('allow_ftp_usage');?><br>
|
||||
<input name="allow_custom_fields" type="checkbox" value="c" checked="checked"/><?php print_lang('allow_custom_fields');?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<!-- Part 1 - Select GAME -->
|
||||
<tr>
|
||||
<td><select name='home_cfg_id'>
|
||||
<?php
|
||||
global $db;
|
||||
$games = $db->getGameCfgs();
|
||||
foreach($games as $game)
|
||||
{
|
||||
echo "<option value='".$game['home_cfg_id']."'>".$game['game_name'];
|
||||
if ( preg_match("/linux/", $game['game_key']) )
|
||||
echo " (Linux) ";
|
||||
if ( preg_match("/win/", $game['game_key']) )
|
||||
echo " (Windows) ";
|
||||
if ( preg_match("/64/", $game['game_key']) )
|
||||
echo " (64bit) ";
|
||||
echo "</option>";
|
||||
|
||||
}
|
||||
?>
|
||||
</select></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td><input type="submit" value="<?php print_lang('add_service');?>"/></td>
|
||||
</tr>
|
||||
</form>
|
||||
|
||||
<!-- Show Services on DB -->
|
||||
</table>
|
||||
<br>
|
||||
<h2>Enable/Disable Server Locations</h2>
|
||||
<?php
|
||||
//ENABLE OR DISABLE REMOTE SERVERS FOR GAMES
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXremote_servers");
|
||||
echo "<form method='post' action=''>";
|
||||
echo "<input type='hidden' name='update_remote_servers' value='update' />";
|
||||
foreach($result as $rs)
|
||||
{
|
||||
$checked = 'checked';
|
||||
if(!$rs['enabled'])
|
||||
{
|
||||
$checked = '';
|
||||
}
|
||||
echo "<div style='float:left; width:25%;'>";
|
||||
echo $rs['remote_server_id'] ;
|
||||
echo " <input type='checkbox' id='" . $rs['remote_server_id'] . "' name='" . $rs['remote_server_id'] ."' value='" .$rs['enabled'] . "' " . $checked . ">";
|
||||
echo $rs['remote_server_name'];
|
||||
echo "</div>";
|
||||
}
|
||||
echo "<br><input type='submit' value='Update Enabled Servers'>
|
||||
</form>
|
||||
<br><br>";
|
||||
//end ENABLE REMOTE SERVERS
|
||||
|
||||
$services = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_services ORDER BY service_name");
|
||||
if ($services > 0)
|
||||
{
|
||||
?>
|
||||
<h2><?php print_lang('current_services');?></h2>
|
||||
<table class="center" style='text-align:center;'>
|
||||
<tr>
|
||||
<th><?php print_lang('id');?></th>
|
||||
<th><?php print_lang('service_name');?></th>
|
||||
<th><?php print_lang('remote_server');?></th>
|
||||
<th><?php print_lang('unavailable');?></th>
|
||||
<th><?php print_lang('price_monthly');?></th>
|
||||
<th><?php print_lang('service_image_url');?></th>
|
||||
<th>Enabled</th>
|
||||
</tr>
|
||||
<?php
|
||||
foreach($services as $row)
|
||||
{
|
||||
?>
|
||||
<tr class="tr<?php $i = 0; echo($i++%2);?>">
|
||||
<td><b class="success" ><?php echo $row['service_id'];?></b></td>
|
||||
<td><?php echo $row['service_name'];?></td>
|
||||
|
||||
<form method="post" action="">
|
||||
<input name="service" type="hidden" value="<?php echo $row['service_id'];?>"/>
|
||||
<td><input name="new_remote_server_id" type="text" value="<?php echo $row['remote_server_id'];?>"/></td>
|
||||
<td><input name="new_out_of_stock" type="text" value="<?php echo $row['out_of_stock'];?>"/></td>
|
||||
<td><input name="new_price_monthly" type="text" value="<?php echo $row['price_monthly'];?>" size="6"/></td>
|
||||
<td><input name="new_url" type="text" value="<?php echo $row['img_url'];?>"/></td>
|
||||
<td><input name="new_enabled" type="text" value="<?php echo $row['enabled'];?>"/></td>
|
||||
|
||||
<td><input type="submit" value="<?php print_lang('update_settings');?>"/></td>
|
||||
</form>
|
||||
</tr>
|
||||
<?php
|
||||
if(isset($_POST['new_enabled']))
|
||||
{
|
||||
$Enabled ='1';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Enabled ='0';
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="center">
|
||||
<tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form action="" method="post">
|
||||
<select name="service_id">
|
||||
<?php
|
||||
foreach($services as $service)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $service['service_id'];?>"><?php echo $service['service_name'];?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<input type="submit" value="<?php print_lang('remove_service');?>"/>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
<?php
|
||||
function curPageName()
|
||||
{
|
||||
return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
|
||||
}
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
require('includes/config.inc.php');
|
||||
require_once('modules/settings/functions.php');
|
||||
require_once('includes/form_table_class.php');
|
||||
global $db,$view,$settings;
|
||||
|
||||
$currencies = Array (
|
||||
'AUD' => 'Australian Dollar',
|
||||
'BRL' => 'Brazilian Real',
|
||||
'CAD' => 'Canadian Dollar',
|
||||
'CZK' => 'Czech Koruna',
|
||||
'DKK' => 'Danish Krone',
|
||||
'EUR' => 'Euro',
|
||||
'HKD' => 'Hong Kong Dollar',
|
||||
'HUF' => 'Hungarian Forint',
|
||||
'ILS' => 'Israeli New Sheqel',
|
||||
'JPY' => 'Japanese Yen',
|
||||
'MYR' => 'Malaysian Ringgit',
|
||||
'MXN' => 'Mexican Peso',
|
||||
'NOK' => 'Norwegian Krone',
|
||||
'NZD' => 'New Zealand Dollar',
|
||||
'PHP' => 'Philippine Peso',
|
||||
'PLN' => 'Polish Zloty',
|
||||
'GBP' => 'Pound Sterling',
|
||||
'RUB' => 'Russian Ruble',
|
||||
'SGD' => 'Singapore Dollar',
|
||||
'SEK' => 'Swedish Krona',
|
||||
'CHF' => 'Swiss Franc',
|
||||
'TWD' => 'Taiwan New Dollar',
|
||||
'THB' => 'Thai Baht',
|
||||
'TRY' => 'Turkish Lira',
|
||||
'USD' => 'U.S. Dollar'
|
||||
);
|
||||
|
||||
asort($currencies);
|
||||
|
||||
|
||||
$settings['paypal'] = isset($settings['paypal']) ? $settings['paypal'] : "1";
|
||||
$settings['debug'] = isset($settings['debug']) ? $settings['debug'] : "1";
|
||||
$settings['sandbox'] = isset($settings['sandbox']) ? $settings['sandbox'] : "1";
|
||||
$settings['currency'] = isset($settings['currency']) ? $settings['currency'] : "EUR";
|
||||
$settings['daily'] = isset($settings['daily']) ? $settings['daily'] : 1;
|
||||
$settings['monthly'] = isset($settings['monthly']) ? $settings['monthly'] : 1;
|
||||
$settings['annually'] = isset($settings['annually']) ? $settings['annually'] : 1;
|
||||
$settings['tax_amount'] = isset($settings['tax_amount']) ? $settings['tax_amount'] : 7;
|
||||
$settings['webhookurl'] = isset($settings['webhookurl']) ? $settings['webhookurl'] : "https://discordapp.com/api/webhooks";
|
||||
$settings['checkbox'] = isset($settings['checkbox']) ? $settings['checkbox'] : "Terms and conditions";
|
||||
$settings['TOSpopup'] = isset($settings['TOSpopup']) ? $settings['TOSpopup'] : "Accept the TOS";
|
||||
$settings['display_free'] = isset($settings['display_free']) ? $settings['display_free'] : "1";
|
||||
|
||||
|
||||
$settings['paypal_email'] = isset($settings['paypal_email']) ? $settings['paypal_email'] : "Business@E-mail";
|
||||
function checked($value){
|
||||
global $settings;
|
||||
if( $settings[$value] == 1 )
|
||||
return 'checked="checked"';
|
||||
}
|
||||
|
||||
|
||||
if(isset($_POST['currency']))
|
||||
{
|
||||
$currency = $_REQUEST['currency'];
|
||||
}
|
||||
|
||||
if ( isset($_REQUEST['update_settings']) )
|
||||
{
|
||||
$settings = array(
|
||||
"paypal" => $_REQUEST['paypal'],
|
||||
"debug" => $_REQUEST['debug'],
|
||||
"sandbox" => $_REQUEST['sandbox'],
|
||||
"currency" => $currency,
|
||||
"daily" => @$_REQUEST['daily'],
|
||||
"monthly" => @$_REQUEST['monthly'],
|
||||
"annually" => @$_REQUEST['annually'],
|
||||
"tax_amount" => $_REQUEST['tax_amount'],
|
||||
"webhookurl" => $_REQUEST['webhookurl'],
|
||||
"checkbox" => $_REQUEST['checkbox'],
|
||||
"TOSpopup" => $_REQUEST['TOSpopup'],
|
||||
"display_free" =>$_REQUEST['display_free'],
|
||||
"paypal_email" => $_REQUEST['paypal_email']);
|
||||
|
||||
$db->setSettings($settings);
|
||||
print_success(get_lang('settings_updated'));
|
||||
$view->refresh("?m=billing&p=shop_settings");
|
||||
return;
|
||||
}
|
||||
|
||||
$s = ( isset($_SERVER['HTTPS']) and get_true_boolean($_SERVER['HTTPS']) ) ? "s" : "";
|
||||
$p = isset($_SERVER['SERVER_PORT']) & $_SERVER['SERVER_PORT'] != "80" ? ":".$_SERVER['SERVER_PORT'] : NULL ;
|
||||
$this_script = 'http'.$s.'://'.$_SERVER['SERVER_NAME'].$p.$_SERVER['SCRIPT_NAME'];
|
||||
$current_folder_url = str_replace( curPageName(), "", $this_script);
|
||||
|
||||
echo "<h2>".get_lang('shop_settings')."</h2>";
|
||||
|
||||
$ft = new FormTable();
|
||||
?>
|
||||
<form>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
</form>
|
||||
<?php
|
||||
$ft->start_form("?m=billing&p=shop_settings");
|
||||
$ft->start_table();
|
||||
echo "<tr><td colspan='2' ><h3>".get_lang('payment_gateway')."</h4></td></tr>";
|
||||
$ft->add_custom_field('paypal','<input type="checkbox" name="paypal" value="1" '.checked('paypal').'/>');
|
||||
$ft->add_custom_field('debug','<input type="checkbox" name="debug" value="1" '.checked('debug').'/>');
|
||||
$ft->add_custom_field('sandbox','<input type="checkbox" name="sandbox" value="1" '.checked('sandbox').'/>');
|
||||
$ft->add_field('string','paypal_email',$settings['paypal_email'],35);
|
||||
$ft->add_custom_field('currency',
|
||||
create_drop_box_from_array($currencies,"currency",$settings['currency'],false));
|
||||
echo "<tr><td colspan='2' ><h3>".get_lang('available_invoice_types')."</h4></td></tr>";
|
||||
$ft->add_custom_field('daily','<input type="checkbox" name="daily" value="1" '.checked('daily').'/>');
|
||||
$ft->add_custom_field('monthly','<input type="checkbox" name="monthly" value="1" '.checked('monthly').'/>');
|
||||
$ft->add_custom_field('annually','<input type="checkbox" name="annually" value="1" '.checked('annually').'/>');
|
||||
echo "<tr><td colspan='2' ><h3>Tax Amount</h4></td></tr>";
|
||||
$ft->add_field('string','tax_amount',$settings['tax_amount'],2);
|
||||
echo "<tr><td colspan='2' ><h3>Other Settings</h4></td></tr>";
|
||||
$ft->add_field('string','webhookurl',$settings['webhookurl'],2);
|
||||
$ft->add_field('string','checkbox',$settings['checkbox'],2);
|
||||
$ft->add_field('string','TOSpopup',$settings['TOSpopup'],2);
|
||||
$ft->add_custom_field('display_free','<input type="checkbox" name="display_free" value="1" '.checked('display_free').'/>');
|
||||
$ft->end_table();
|
||||
$ft->add_button("submit","update_settings",get_lang('update_settings'));
|
||||
$ft->end_form();
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,325 +0,0 @@
|
|||
<?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.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db, $view;
|
||||
|
||||
$settings = $db->getSettings();
|
||||
|
||||
if (isset($_POST['save']))
|
||||
{
|
||||
$new_description = str_replace("\\r\\n", "<br>", $_POST['description']);
|
||||
$service = $_POST['service_id'];
|
||||
|
||||
$change_description = "UPDATE OGP_DB_PREFIXbilling_services
|
||||
SET description ='".$db->realEscapeSingle($new_description)."'
|
||||
WHERE service_id=".$db->realEscapeSingle($service);
|
||||
$save = $db->query($change_description);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<a href="?m=billing&p=cart"><img SRC="images/cart.png" BORDER="0" WIDTH=22 HEIGHT=20/><?php print_lang('your_cart');?></a><br>
|
||||
<?PHP echo date('d-M-Y H:i a'); ?>
|
||||
<!-- ------------------------------------------------------------------------------
|
||||
THIS IS WHAT WE DISPLAY ON THE SHOP PAGE AT THE TOP
|
||||
-->
|
||||
<center><h5>We treat YOUR server like it was OUR server</h5></center>
|
||||
<br>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// Shop Form
|
||||
if(intval($_REQUEST['service_id']) !==0) $where_service_id = " WHERE enabled = 1 and service_id=".intval($_REQUEST['service_id']); else $where_service_id = " where enabled = 1";
|
||||
$qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$services = $db->resultQuery($qry_services);
|
||||
|
||||
if (isset($_REQUEST['service_id']) && $services === false) {
|
||||
$view->refresh('home.php?m=billing&p=shop');
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($services as $key => $row) {
|
||||
$service_id[$key] = $row['service_id'];
|
||||
$home_cfg_id[$key] = $row['home_cfg_id'];
|
||||
$mod_cfg_id[$key] = $row['mod_cfg_id'];
|
||||
$service_name[$key] = $row['service_name'];
|
||||
$remote_server_id[$key] = $row['remote_server_id'];
|
||||
$out_of_stock[$key] = $row['_out_of_stock'];
|
||||
$slot_max_qty[$key] = $row['slot_max_qty'];
|
||||
$slot_min_qty[$key] = $row['slot_min_qty'];
|
||||
$price_daily[$key] = $row['price_daily'];
|
||||
$price_monthly[$key] = $row['price_monthly'];
|
||||
$price_year[$key] = $row['price_year'];
|
||||
$description[$key] = $row['description'];
|
||||
$img_url[$key] = $row['img_url'];
|
||||
$ftp[$key] = $row['ftp'];
|
||||
$install_method[$key] = $row['install_method'];
|
||||
$manual_url[$key] = $row['manual_url'];
|
||||
$access_rights[$key] = $row['access_rights'];
|
||||
}
|
||||
array_multisort($service_name,
|
||||
$service_id,
|
||||
$home_cfg_id,
|
||||
$mod_cfg_id,
|
||||
$remote_server_id,
|
||||
$out_of_stock,
|
||||
$slot_max_qty,
|
||||
$slot_min_qty,
|
||||
$price_daily,
|
||||
$price_monthly,
|
||||
$price_year,
|
||||
$description,
|
||||
$img_url,
|
||||
$ftp,
|
||||
$install_method,
|
||||
$manual_url,
|
||||
$access_rights, SORT_DESC, $services);
|
||||
|
||||
echo "<div>";
|
||||
foreach($services as $row)
|
||||
{
|
||||
if(!isset($_REQUEST['service_id']))
|
||||
{
|
||||
?>
|
||||
<div style="
|
||||
float:left;
|
||||
padding-top: 30px;
|
||||
padding-right: 20px;
|
||||
padding-bottom: 30px;
|
||||
padding-left: 20px;">
|
||||
<div style = "text-align: center;">
|
||||
<img src="<?php echo $row['img_url'] ;?>" width=256 height=96 border=0 alt="cheap <?php echo $row['service_name'];?> Game Server">
|
||||
<br>
|
||||
<?php echo $row['service_name'];?>
|
||||
<br>
|
||||
<?php
|
||||
if ($row['price_monthly'] == 0.0) {
|
||||
echo "<span style='color:green'><b>FREE!</b></span>";
|
||||
} else {
|
||||
echo "<span style='color:grey'>Starting at $" . number_format(floatval($row['price_monthly']*$row['slot_min_qty']),2) ." each month<br> "
|
||||
. number_format(floatval($row['price_monthly']),2) ." per player slot<br>".$row['slot_min_qty'] ." to " . $row['slot_max_qty'] . " players</span><br>
|
||||
<a href='".$row['description']."' target='_blank'>More Info</a>";
|
||||
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
<form action="" method="POST">
|
||||
<input name="service_id" type="hidden" value="<?php echo $row['service_id'];?>" />
|
||||
|
||||
<input name="order_server" type="submit" value="ORDER HERE">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</>
|
||||
|
||||
|
||||
<div style="border-left:10px solid transparent;">
|
||||
|
||||
<?php
|
||||
} else
|
||||
{
|
||||
?>
|
||||
<div style="float:left; border: 4px solid transparent;border-bottom: 25px solid transparent;">
|
||||
<img src="<?php echo $row['img_url'] ;?>" width=256 height=96 border=0 alt="cheap <?php echo $row['service_name'];?> server">
|
||||
<center><b><?php echo $row['service_name']."</b>
|
||||
<br>
|
||||
</center>";
|
||||
$isAdmin = $db->isAdmin($_SESSION['user_id'] );
|
||||
|
||||
if($isAdmin)
|
||||
{
|
||||
if(!isset($_POST['edit']))
|
||||
{
|
||||
echo "<p style='color:gray;width:280px;' >$row[description]<p>";
|
||||
echo "<form action='' method='post'>".
|
||||
"<input type='hidden' name='service_id' value='$row[service_id]' />".
|
||||
"<input type='submit' name='edit' value='" . get_lang('edit') . "' />".
|
||||
"</form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<form action='' method='post'>".
|
||||
"<textarea style='resize:none;width:280px;height:132px;' name='description' >".str_replace("<br>", "\r\n", $row['description'])."</textarea><br>".
|
||||
"<input type='hidden' name='service_id' value='$row[service_id]' />".
|
||||
"<input type='submit' name='save' value='" . get_lang('save') . "' />".
|
||||
"</form>";
|
||||
}
|
||||
}
|
||||
else
|
||||
echo "<center><a href='". $row[description]."' target='_blank'>More Info</a><br></center>";
|
||||
?>
|
||||
</div>
|
||||
<table style="width:420px;float:left;">
|
||||
<form method="post" action="?m=billing&p=add_to_cart<?php if(isset($_POST['service_id'])) echo "&service_id=".$_POST['service_id'];?>">
|
||||
<input type="hidden" name="remote_control_password" size="15" value="<?php echo genRandomString(10);?>">
|
||||
<input type="hidden" name="ftp_password" size="15" value="<?php echo genRandomString(10);?>">
|
||||
<tr>
|
||||
<td align="right"><?php print_lang('service_name');?> </td>
|
||||
<td align="left">
|
||||
<input type="text" name="home_name" size="40" value="<?php echo $row['service_name'];?>">
|
||||
</td>
|
||||
<tr>
|
||||
<td align="right">Location </td>
|
||||
<td align="left">
|
||||
<?php
|
||||
//loop through multiple remote server ID stored in services 'remote_server_ip' as text
|
||||
//change WHERE clause to IS IN clause
|
||||
$rsiArray = explode(" ", $row['remote_server_id']);
|
||||
$rsi = implode(",",$rsiArray);
|
||||
//get the out of stock into an array and see if the rsID is in that array
|
||||
$unavailable_Array = explode(" ", $row['out_of_stock']);
|
||||
$available_server = false;
|
||||
//loop through each of the assigned servers and see if its disabled
|
||||
foreach($rsiArray as $rsi)
|
||||
{
|
||||
$query = "SELECT * FROM OGP_DB_PREFIXremote_servers WHERE remote_server_id = ".$rsi;
|
||||
$result = $db->resultQuery($query);
|
||||
foreach($result as $rs)
|
||||
{
|
||||
|
||||
$rsID =$rs['remote_server_id'];
|
||||
$rsNAME = $rs['remote_server_name'];
|
||||
//echo "<option value='$rsID'>$rsNAME</option>";
|
||||
// add disabled to lable and input if $rsID is in out_of_stock
|
||||
$is_unavailable = "";
|
||||
$service_text_color = "";
|
||||
if (in_array($rsID,$unavailable_Array))
|
||||
{
|
||||
$is_unavailable = "disabled";
|
||||
$service_text_color = "red";
|
||||
|
||||
}
|
||||
|
||||
if($rs['enabled']==0)
|
||||
{
|
||||
$is_unavailable = "disabled";
|
||||
$service_text_color = "red";
|
||||
}
|
||||
if($is_unavailable == "")
|
||||
{
|
||||
$available_server = true;
|
||||
}
|
||||
|
||||
|
||||
//default radio button
|
||||
// //<input type='radio' $is_unavailable name='ip_id' id='$rsID' value='$rsID' >
|
||||
echo "<div>
|
||||
<input type='radio' $is_unavailable name='ip_id' id='$rsID' value='$rsID' required>
|
||||
<label for '$rsID' $is_unavailable ><span style='color:$service_text_color'>$rsNAME </span></label>
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><?php print_lang('max_players');?> </td>
|
||||
<td align="left">
|
||||
<select name="max_players">
|
||||
<?php
|
||||
$players=$row['slot_min_qty'];
|
||||
while($players<=$row['slot_max_qty'])
|
||||
{
|
||||
//echo "<option value='$players'>$players slots</option>";
|
||||
//displays the price
|
||||
echo "<option value='$players'>$players slots = $" . number_format(floatval($row['price_monthly'] * $players),2 ) . " per month</option>";
|
||||
$players++;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><?php print_lang('invoice_duration');?> </td>
|
||||
<td align="left">
|
||||
<select name="qty">
|
||||
<?php
|
||||
$qty=1;
|
||||
while($qty<=12)
|
||||
{
|
||||
echo "<option value='$qty'>$qty months</option>";
|
||||
$qty++;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="hidden" name="invoice_duration" value="month" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" colspan="2">
|
||||
<input name="service_id" type="hidden" value="<?php echo $row['service_id'];?>"/>
|
||||
<?php
|
||||
if ($available_server)
|
||||
{
|
||||
?>
|
||||
<input type="submit" name="add_to_cart" value="<?php print_lang('add_to_cart');?>"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" colspan="2">
|
||||
<form action ="?m=billing&p=shop" method="POST">
|
||||
<button><< <?php print_lang('back_to_list');?></button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div style="clear: both; text-align:center" id="read_more" >
|
||||
<p style="color:yellow; text-align:center;">100% refund if you are not satisfied
|
||||
</p>
|
||||
Read our <a href="tos.php" target="_blank">Terms of Service</a> Here
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
<?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
|
||||
$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) -----------------------------------------------------------
|
||||
$settings = $db->getSettings();
|
||||
$subject = "Test Email";
|
||||
$emailto = "iaretechnician@gmail.com";
|
||||
$message = "WooHoo<br><br><br>Email Works<br>Thanks!<br>";
|
||||
$mail = mymail($emailto, $subject, $message, $settings);
|
||||
|
||||
|
||||
// END EMAIL
|
||||
|
||||
|
||||
|
|
@ -1,177 +0,0 @@
|
|||
<?php
|
||||
function exec_ogp_module()
|
||||
{
|
||||
//Include database connection details
|
||||
require('includes/config.inc.php');
|
||||
|
||||
global $db,$view,$settings;
|
||||
if(isset($_GET['type']) && $_GET['type'] == 'cleared')
|
||||
{
|
||||
echo '<body onload="window.print()" >';
|
||||
$view->setCharset(get_lang('lang_charset'));
|
||||
}
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$cart_id = $_POST['cart_id'];
|
||||
$cart_id = $db->realEscapeSingle($cart_id);
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin )
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
else
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
|
||||
$cart = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$tempdate = date_create( $cart[0]['date']);
|
||||
$paid_date = date_format($tempdate,"d M Y H:m");
|
||||
|
||||
|
||||
|
||||
if( !empty($orders) )
|
||||
{
|
||||
?>
|
||||
<br><br>
|
||||
<table width="772" height="438" border="0" style="color:#000000" bgcolor="#FFFFFF">
|
||||
<tr bgcolor="#000000">
|
||||
<td colspan="7" align="center" style="color:white">
|
||||
<p style="font-size:18pt"><b><?php print_lang("invoice");?></b></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" >Paid: <?php echo $paid_date; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150" height="21" align="left"><b><?php echo "<b>Xp Game Host</b><br/>
|
||||
3400 Laurel Rd<br/>
|
||||
Brunswick, OH 44212 "; ?></td>
|
||||
<td colspan="4" rowspan="3"> </td>
|
||||
<td align="center" colspan="2" rowspan="3" ><img src="images/xplogo.png"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150" height="21" align="left">Email: <?php echo "<b>".$settings['panel_email_address']."</b>"; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="23" colspan="7"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("order");?></strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong>Server ID</strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("item");?></strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("invoice_duration");?></strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("slot_cost");?></strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("slot_quantity");?></strong></div></td>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="center"><strong><?php print_lang("order_price");?></strong></div></td>
|
||||
<hr/></tr>
|
||||
<?php
|
||||
$subtotal = 0;
|
||||
foreach($orders as $order)
|
||||
{
|
||||
$order_id = $order['order_id'];
|
||||
$user_id = $order['user_id'];
|
||||
$service_id = $order['service_id'];
|
||||
$home_name = $order['home_name']." - ".$order_id;
|
||||
$ip = $order['ip'];
|
||||
$max_players = $order['max_players'];
|
||||
$qty = $order['qty'];
|
||||
$invoice_duration = $order['invoice_duration'];
|
||||
$price = $order['price'];
|
||||
$subtotal= $price * $max_players * $qty;
|
||||
$subtotal2 += $order['price'] * $max_players * $qty;
|
||||
$qry_service = "SELECT DISTINCT price_daily, price_monthly, price_year FROM ".$table_prefix."billing_services WHERE service_id=".$db->realEscapeSingle($service_id);
|
||||
$result_service = $db->resultQuery($qry_service);
|
||||
$row_service = $result_service[0];
|
||||
|
||||
//Calculating Costs
|
||||
|
||||
if ($invoice_duration == "day")
|
||||
{
|
||||
$price_slot=$row_service['price_daily'];
|
||||
}
|
||||
elseif ($invoice_duration == "month")
|
||||
{
|
||||
$price_slot=$row_service['price_monthly'];
|
||||
}
|
||||
elseif ($invoice_duration == "year")
|
||||
{
|
||||
$price_slot=$row_service['price_year']*12;
|
||||
}
|
||||
$duration = $invoice_duration > 1 ? $invoice_duration."s":$invoice_duration;
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td align="center" height="23"><?php echo $order_id; ?></td>
|
||||
<td align="center" height="23"><?php echo $order['home_id']; ?></td>
|
||||
<td align="center" height="23"><?php echo $order['home_name']; ?></td>
|
||||
<td align="center"><?php echo $qty." ".get_lang($duration); ?></td>
|
||||
<td align="center"><?php echo "$" . number_format(floatval(round(($price_slot),2 )),2)." ".$settings['currency']."/".get_lang($invoice_duration); ?></td>
|
||||
<td align="center"><?php echo $max_players; ?></td>
|
||||
<td align="center"><?php echo "$" . number_format(floatval(round(($subtotal),2 )),2)." ".$settings['currency']; ?></td>
|
||||
</tr><?php
|
||||
}
|
||||
|
||||
$coupon_savings = 0;
|
||||
if($cart[0]['coupon_id']>0) {
|
||||
$result = $db->resultquery("SELECT discount from OGP_DB_PREFIXbilling_coupons WHERE id = '". $cart[0]['coupon_id'] . "'");
|
||||
foreach($result as $coupon){
|
||||
$coupon_savings = $subtotal2 * ($coupon['discount'] / 100);
|
||||
}
|
||||
}
|
||||
|
||||
//$subtotal2 += $order['price'] * $max_players * $qty;
|
||||
//$total = $subtotal2+($cart[0]['tax_amount']/100*$subtotal2);
|
||||
$total = ($subtotal2 - $coupon_savings) * ($cart[0]['tax_amount'] / 100 + 1);
|
||||
?>
|
||||
<tr>
|
||||
<td height="24" colspan="5"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" rowspan="5"> </td>
|
||||
<td height="23" style="border: 2px solid #000000"><div align="right"><strong><?php print_lang("subtotal");?> : </strong></div></td>
|
||||
<td style="border: 2px solid #000000"><?php echo "$" . number_format(floatval(round(($subtotal2),2 )),2) . " ".$settings['currency']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($cart[0]['coupon_id']>0) {
|
||||
echo '
|
||||
<tr>
|
||||
<td height="23" style="border: 2px solid #000000"><div align="right"><strong>Discount : </strong></div></td>
|
||||
<td style="border: 2px solid #000000">'. "$" . number_format(floatval(round((($subtotal2-$coupon_savings)-$subtotal2),2 )),2) . " ".$settings['currency'] .'</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td height="23" style="border: 2px solid #000000"><div align="right"><strong><?php print_lang("tax");?> : </strong></div></td>
|
||||
<td style="border: 2px solid #000000"><?php echo $cart[0]['tax_amount']."%"; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="23" style="border: 2px solid #000000" bgcolor="#222222"><div align="right"><strong><?php print_lang("total");?> : </strong></div></td>
|
||||
<td style="border: 2px solid #000000" bgcolor="#222222"><?php echo "$" . number_format(floatval(round(($total),2 )),2) ." ".$settings['currency']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="23" style="border: 2px solid #000000"><div align="right"><strong></strong></div></td>
|
||||
<td style="border: 2px solid #000000"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br><br>
|
||||
<form method='post' action='?m=billing&p=bill&type=cleared' >
|
||||
<input type="hidden" name="cart_id" value="<?php echo $_POST['cart_id'];?>">
|
||||
<input type="submit" value="<?php print_lang('print_invoice') ?>" />
|
||||
</form>
|
||||
<form method='post' action='?m=billing&p=<?php
|
||||
$isAdmin = $db->isAdmin($_SESSION['user_id']);
|
||||
if ($isAdmin)
|
||||
{
|
||||
echo 'orders';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'cart';
|
||||
}
|
||||
echo "'><input type='submit' value='";
|
||||
print_lang('back');
|
||||
?>'/>
|
||||
</form>
|
||||
<br><br><?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
$url = "https://";
|
||||
// Append the host(domain name, ip) to the URL.
|
||||
$url.= $_SERVER['HTTP_HOST'];
|
||||
// foreach($_POST as $key => $val) {
|
||||
// echo 'Field name : ' . $key . ' Value :' .$val .'<br>';
|
||||
// }
|
||||
|
||||
if (($_POST['payment_status']=="Completed")){
|
||||
echo "<title>Success</title><h4>Thank you for your order. <br> ... </h4><br>";
|
||||
echo "Processing your payment Information ..";
|
||||
$bounce_to = $url."/home.php?m=billing&p=paid";
|
||||
} else {
|
||||
echo "<title>Uh OH</title><h4>There was a problem, Please contact Support<br> ... </h4><br>";
|
||||
$bounce_to = $url."/home.php?m=billing&p=paid";
|
||||
//we can setup a "failed page" to redirect to. My sandbox payments are not marked completed for some reason
|
||||
|
||||
}
|
||||
?>
|
||||
<form name='paid' action='<?php echo $bounce_to?>' method='post'>
|
||||
<input type='hidden' name='cart_id' value='<?php echo $_POST["item_number"]?>'>
|
||||
<input type='hidden' name='payment_status' value='<?php echo $_POST["payment_status"] ?>'>
|
||||
</form>
|
||||
<script>
|
||||
var auto_refresh = setInterval(
|
||||
function()
|
||||
{
|
||||
submitform();
|
||||
}, 2000);
|
||||
function submitform()
|
||||
{
|
||||
document.paid.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,428 +1,504 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Shopping Cart - GameServers.World</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
function saveOrderToDb($user_id,$service_id,$home_name,$ip,$max_players,$qty,$invoice_duration,$price,$remote_control_password,$ftp_password,$cart_id,$home_id = "0",$status,$finish_date,$extended = "0"){
|
||||
global $db;
|
||||
if(isset($_SESSION['coupon_id'])){
|
||||
$coupon_id = $_SESSION['coupon_id'];
|
||||
} else {
|
||||
$coupon_id = 0;
|
||||
}
|
||||
$fields['user_id'] = $user_id;
|
||||
$fields['service_id'] = $service_id;
|
||||
$fields['home_name'] = $home_name;
|
||||
$fields['ip'] = $ip;
|
||||
$fields['max_players'] = $max_players;
|
||||
$fields['qty'] = $qty;
|
||||
$fields['invoice_duration'] = $invoice_duration;
|
||||
$fields['price'] = $price;
|
||||
$fields['remote_control_password'] = $remote_control_password;
|
||||
$fields['ftp_password'] = $ftp_password;
|
||||
$fields['cart_id'] = $cart_id;
|
||||
$fields['home_id'] = $home_id;
|
||||
$fields['status'] = $status;
|
||||
$fields['finish_date'] = $finish_date;
|
||||
$fields['extended'] = $extended;
|
||||
$fields['coupon_id'] = $coupon_id;
|
||||
return $db->resultInsertId( 'billing_orders', $fields );
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
// Require login
|
||||
require_once(__DIR__ . '/includes/login_required.php');
|
||||
|
||||
// Include database configuration
|
||||
require_once(__DIR__ . '/includes/config.inc.php');
|
||||
require_once(__DIR__ . '/includes/log.php');
|
||||
|
||||
// Create database connection
|
||||
$db = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
|
||||
if (!$db) {
|
||||
die("Connection failed: " . mysqli_connect_error());
|
||||
}
|
||||
|
||||
// Handler: allow admin quick-create OR user claim for free items
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['create_free_for'])) {
|
||||
if (session_status() === PHP_SESSION_NONE) session_start();
|
||||
$actor_id = intval($_SESSION['website_user_id'] ?? $_SESSION['user_id'] ?? 0);
|
||||
$actor_role = strtolower($_SESSION['website_user_role'] ?? '');
|
||||
$is_admin = ($actor_role === 'admin');
|
||||
|
||||
// Fallback: if session role not present, try to resolve from DB using actor_id or website_username
|
||||
if (!$is_admin) {
|
||||
if ($actor_id > 0) {
|
||||
$ar = mysqli_query($db, "SELECT users_role FROM ogp_users WHERE user_id = " . intval($actor_id) . " LIMIT 1");
|
||||
if ($ar && mysqli_num_rows($ar) === 1) {
|
||||
$arr = mysqli_fetch_assoc($ar);
|
||||
if (strtolower((string)($arr['users_role'] ?? '')) === 'admin') {
|
||||
$is_admin = true;
|
||||
$_SESSION['website_user_role'] = 'admin';
|
||||
}
|
||||
}
|
||||
} elseif (isset($_SESSION['website_username']) && !empty($_SESSION['website_username'])) {
|
||||
$safe_un = mysqli_real_escape_string($db, $_SESSION['website_username']);
|
||||
$ar = mysqli_query($db, "SELECT user_id, users_role FROM ogp_users WHERE users_login = '$safe_un' LIMIT 1");
|
||||
if ($ar && mysqli_num_rows($ar) === 1) {
|
||||
$arr = mysqli_fetch_assoc($ar);
|
||||
if (strtolower((string)($arr['users_role'] ?? '')) === 'admin') {
|
||||
$is_admin = true;
|
||||
$_SESSION['website_user_role'] = 'admin';
|
||||
$_SESSION['website_user_id'] = intval($arr['user_id'] ?? 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$orderId = (int)$_POST['create_free_for'];
|
||||
if ($orderId > 0) {
|
||||
// load order to verify ownership/price
|
||||
$stmt = $db->prepare("SELECT user_id, price, status, qty, invoice_duration FROM ogp_billing_orders WHERE order_id = ? LIMIT 1");
|
||||
if ($stmt) {
|
||||
$stmt->bind_param('i', $orderId);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($owner_id, $order_price, $prev_status, $order_qty, $order_invoice_duration);
|
||||
$found = $stmt->fetch();
|
||||
$stmt->close();
|
||||
} else {
|
||||
$found = false;
|
||||
}
|
||||
|
||||
$audit_file = __DIR__ . '/logs/free_create_audit.log';
|
||||
|
||||
if ($found) {
|
||||
$allowed = false;
|
||||
$reason = '';
|
||||
// Admin may force-create paid records for testing
|
||||
if ($is_admin) {
|
||||
$allowed = true;
|
||||
$reason = 'admin_create';
|
||||
}
|
||||
// Owner may claim a free order if the price is zero
|
||||
elseif ($actor_id > 0 && $actor_id === intval($owner_id) && floatval($order_price) == 0.0) {
|
||||
$allowed = true;
|
||||
$reason = 'user_claim_free';
|
||||
}
|
||||
|
||||
if ($allowed) {
|
||||
// Compute finish_date: months based on invoice_duration and qty
|
||||
$months = 0;
|
||||
$q = intval($order_qty ?? 0);
|
||||
$invdur = strtolower(trim($order_invoice_duration ?? ''));
|
||||
if (strpos($invdur, 'year') !== false) {
|
||||
$months = $q * 12;
|
||||
} else {
|
||||
// default to months for anything else (month, monthly, etc.)
|
||||
$months = $q;
|
||||
}
|
||||
$finish_date = null;
|
||||
if ($months > 0) {
|
||||
$dt = new DateTime('now');
|
||||
$dt->modify('+' . intval($months) . ' months');
|
||||
$finish_date = $dt->format('Y-m-d H:i:s');
|
||||
} else {
|
||||
// if no months specified, set to now
|
||||
$finish_date = date('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
// Check if finish_date column exists
|
||||
$finish_col_exists = false;
|
||||
$col_check = mysqli_query($db, "SHOW COLUMNS FROM ogp_billing_orders LIKE 'finish_date'");
|
||||
if ($col_check && mysqli_num_rows($col_check) > 0) $finish_col_exists = true;
|
||||
|
||||
// Perform update and log results. Use prepared statements when available and fallback to direct query on error.
|
||||
$updated_rows = 0;
|
||||
if ($finish_col_exists) {
|
||||
$upd = $db->prepare("UPDATE ogp_billing_orders SET status = 'paid', finish_date = ? WHERE order_id = ? LIMIT 1");
|
||||
if ($upd) {
|
||||
$upd->bind_param('si', $finish_date, $orderId);
|
||||
$ok = $upd->execute();
|
||||
if (!$ok) site_log_warn('free_create_update_failed_prepare', ['error'=>$db->error, 'sql'=>'UPDATE with finish_date', 'order'=>$orderId]);
|
||||
$updated_rows = $upd->affected_rows;
|
||||
$upd->close();
|
||||
} else {
|
||||
// fallback
|
||||
$safe_fd = mysqli_real_escape_string($db, $finish_date);
|
||||
$q = "UPDATE ogp_billing_orders SET status = 'paid', finish_date = '$safe_fd' WHERE order_id = " . intval($orderId) . " LIMIT 1";
|
||||
$resq = mysqli_query($db, $q);
|
||||
if (!$resq) site_log_warn('free_create_update_failed_query', ['error'=>mysqli_error($db), 'sql'=>$q]);
|
||||
else $updated_rows = mysqli_affected_rows($db);
|
||||
}
|
||||
} else {
|
||||
$upd = $db->prepare("UPDATE ogp_billing_orders SET status = 'paid' WHERE order_id = ? LIMIT 1");
|
||||
if ($upd) {
|
||||
$upd->bind_param('i', $orderId);
|
||||
$ok = $upd->execute();
|
||||
if (!$ok) site_log_warn('free_create_update_failed_prepare', ['error'=>$db->error, 'sql'=>'UPDATE status only', 'order'=>$orderId]);
|
||||
$updated_rows = $upd->affected_rows;
|
||||
$upd->close();
|
||||
} else {
|
||||
$q = "UPDATE ogp_billing_orders SET status = 'paid' WHERE order_id = " . intval($orderId) . " LIMIT 1";
|
||||
$resq = mysqli_query($db, $q);
|
||||
if (!$resq) site_log_warn('free_create_update_failed_query', ['error'=>mysqli_error($db), 'sql'=>$q]);
|
||||
else $updated_rows = mysqli_affected_rows($db);
|
||||
}
|
||||
}
|
||||
|
||||
// write audit log (include finish_date if set)
|
||||
site_log_info('free_create', ['actor'=>$actor_id, 'role'=>$actor_role, 'action'=>$reason, 'order'=>$orderId, 'owner'=>$owner_id, 'price'=>$order_price, 'prev_status'=>$prev_status, 'finish_date'=>$finish_date ?? '', 'updated_rows'=>$updated_rows]);
|
||||
|
||||
// write a simulated webhook file (same behavior as previous admin flow)
|
||||
$dataDir = (isset($SITE_DATA_DIR) && $SITE_DATA_DIR) ? $SITE_DATA_DIR : realpath(__DIR__ . '/') . DIRECTORY_SEPARATOR . 'data';
|
||||
@mkdir($dataDir, 0775, true);
|
||||
$rec = [
|
||||
'event_type' => 'PAYMENT.CAPTURE.COMPLETED',
|
||||
'status' => 'PAID',
|
||||
'amount' => floatval($order_price),
|
||||
'currency' => 'USD',
|
||||
'payer' => $_SESSION['website_user_email'] ?? ($_SESSION['website_username'] ?? ''),
|
||||
'invoice' => 'FREE-' . $orderId . '-' . time(),
|
||||
// process_payment_record matches numeric custom values to order_id; use numeric order id here to ensure matching
|
||||
'custom' => (string)$orderId,
|
||||
'resource_id' => 'FREE-' . bin2hex(random_bytes(6)),
|
||||
'items' => [],
|
||||
'ts' => date('c'),
|
||||
];
|
||||
$fname = $dataDir . DIRECTORY_SEPARATOR . $rec['invoice'] . '.json';
|
||||
file_put_contents($fname, json_encode($rec, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));
|
||||
|
||||
// If available, process the payment record immediately so webhooks logic runs during creation
|
||||
$ps = __DIR__ . '/payment_success.php';
|
||||
if (is_file($ps)) {
|
||||
try {
|
||||
require_once($ps);
|
||||
if (function_exists('process_payment_record')) {
|
||||
process_payment_record($rec);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
error_log('[cart create_free] process_payment_record failed: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
header('Location: return.php?invoice=' . urlencode($rec['invoice']));
|
||||
exit;
|
||||
} else {
|
||||
// unauthorized attempt - log and continue
|
||||
site_log_warn('unauthorized_free_create', ['actor'=>$actor_id, 'role'=>$actor_role, 'order'=>$orderId, 'owner'=>$owner_id, 'price'=>$order_price]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Include top bar and menu
|
||||
include(__DIR__ . '/includes/top.php');
|
||||
include(__DIR__ . '/includes/menu.php');
|
||||
|
||||
// Use session user_id where available
|
||||
// Use session user_id where available; if not present but website_username exists, try to resolve it from DB
|
||||
$user_id = intval($_SESSION['website_user_id'] ?? $_SESSION['user_id'] ?? 0);
|
||||
if ($user_id <= 0 && isset($_SESSION['website_username']) && !empty($_SESSION['website_username'])) {
|
||||
// try to resolve username to user_id in DB and persist into session
|
||||
$safe_uname = mysqli_real_escape_string($db, $_SESSION['website_username']);
|
||||
$qr = mysqli_query($db, "SELECT user_id FROM ogp_users WHERE users_login = '$safe_uname' LIMIT 1");
|
||||
if ($qr && mysqli_num_rows($qr) === 1) {
|
||||
$rr = mysqli_fetch_assoc($qr);
|
||||
$user_id = intval($rr['user_id'] ?? 0);
|
||||
if ($user_id > 0) {
|
||||
$_SESSION['website_user_id'] = $user_id;
|
||||
site_log_info('cart_resolved_user_id', ['username'=>$_SESSION['website_username'],'user_id'=>$user_id]);
|
||||
// Resolve and persist the user's role to avoid extra DB lookups later
|
||||
$role_q = mysqli_query($db, "SELECT users_role FROM ogp_users WHERE user_id = " . intval($user_id) . " LIMIT 1");
|
||||
if ($role_q && mysqli_num_rows($role_q) === 1) {
|
||||
$role_r = mysqli_fetch_assoc($role_q);
|
||||
$_SESSION['website_user_role'] = $role_r['users_role'] ?? '';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
site_log_warn('cart_resolve_user_failed', ['username'=>$_SESSION['website_username']]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($user_id <= 0) {
|
||||
echo "<center><h4>Please login to view your cart</h4></center>";
|
||||
mysqli_close($db);
|
||||
echo "</body></html>";
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine admin status for UI: prefer session role, otherwise check DB
|
||||
$is_admin = false;
|
||||
if (isset($_SESSION['website_user_role']) && !empty($_SESSION['website_user_role'])) {
|
||||
$is_admin = (strtolower($_SESSION['website_user_role']) === 'admin');
|
||||
} elseif ($user_id > 0) {
|
||||
$rr = mysqli_query($db, "SELECT users_role FROM ogp_users WHERE user_id = " . intval($user_id) . " LIMIT 1");
|
||||
if ($rr && mysqli_num_rows($rr) === 1) {
|
||||
$rrow = mysqli_fetch_assoc($rr);
|
||||
$is_admin = (strtolower((string)($rrow['users_role'] ?? '')) === 'admin');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function assignOrdersToCart($user_id,$tax_amount,$currency,$coupon_id){
|
||||
global $db;
|
||||
$fields['user_id'] = $user_id;
|
||||
$fields['paid'] = '0';
|
||||
$fields['tax_amount'] = $tax_amount;
|
||||
$fields['currency'] = $currency;
|
||||
//discount coupon
|
||||
if (!isset($coupon_id)) $coupon_id = "0";
|
||||
$fields['coupon_id'] = $coupon_id;
|
||||
$check_expired = $db->resultquery("SELECT id from OGP_DB_PREFIXbilling_coupons WHERE id = $fields[coupon_id] AND count > 0 AND expires >= NOW()");
|
||||
if ($check_expired <= 0) $fields['coupon_id'] = 0;
|
||||
return $db->resultInsertId( 'billing_carts', $fields );
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_single'])) {
|
||||
$order_id = intval($_POST['delete_single']);
|
||||
if ($order_id > 0) {
|
||||
// First, check if the status is 'renew'
|
||||
$stmt = $db->prepare("SELECT status FROM ogp_billing_orders WHERE order_id = ? AND user_id = ?");
|
||||
$stmt->bind_param("ii", $order_id, $user_id);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($status);
|
||||
if ($stmt->fetch() && strtolower($status) === 'renew') {
|
||||
$stmt->close();
|
||||
// Set status to 'expired' if currently 'renew'
|
||||
$update = $db->prepare("UPDATE ogp_billing_orders SET status = 'expired' WHERE order_id = ? AND user_id = ?");
|
||||
$update->bind_param("ii", $order_id, $user_id);
|
||||
$update->execute();
|
||||
$update->close();
|
||||
} else {
|
||||
$stmt->close();
|
||||
// Otherwise, delete the order
|
||||
$delete = $db->prepare("DELETE FROM ogp_billing_orders WHERE order_id = ? AND user_id = ?");
|
||||
$delete->bind_param("ii", $order_id, $user_id);
|
||||
$delete->execute();
|
||||
$delete->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
error_reporting(E_ALL);
|
||||
|
||||
global $db,$view,$settings;
|
||||
$discounted_price = 0;
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
if( isset( $_POST["buy"] ) or isset( $_POST["pay_paypal"] ) )
|
||||
{
|
||||
|
||||
$cart_id = $_POST['cart_id'];
|
||||
echo '<meta http-equiv="refresh" content="0;url=home.php?m=billing&p=create_servers&cart_id='.$cart_id.'" >';
|
||||
|
||||
|
||||
}
|
||||
|
||||
if( isset( $_POST["extend"] ) or isset( $_POST["extend_and_pay_paypal"] ))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['remove']))
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<style>
|
||||
h4 {
|
||||
width:250px;
|
||||
height:25px;
|
||||
background:#f5f5f5;
|
||||
border-top-style:solid;
|
||||
border-top-color:#afafaf;
|
||||
border-top-width:1px;
|
||||
border-style: solid;
|
||||
border-color: #CFCFCF;
|
||||
border-width: 1px;
|
||||
padding-top:8px;
|
||||
text-align: center;
|
||||
font-family:"Trebuchet MS";
|
||||
}
|
||||
</style>
|
||||
<h2>Cart</h2>
|
||||
<!--
|
||||
SHOW ALL THE INVOICES FOR USER
|
||||
|
||||
<form method="post" action="?m=billing&p=orders">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input type="submit" value="All Orders">
|
||||
</form>
|
||||
-->
|
||||
<?php
|
||||
if( isset($_SESSION['CART']) and !empty($_SESSION['CART']) )
|
||||
{
|
||||
$carts[0] = $_SESSION['CART'];
|
||||
}
|
||||
|
||||
$user_carts = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE user_id=".$db->realEscapeSingle($user_id) ." order by cart_id desc" );
|
||||
if ($db){
|
||||
$carts = $db->query("SELECT * FROM ogp_billing_orders AS cart
|
||||
WHERE (status = 'in-cart' OR status = 'renew') AND user_id = " . $user_id . " ORDER BY order_id ASC");
|
||||
|
||||
|
||||
if( $user_carts >=1 )
|
||||
{
|
||||
|
||||
// SELECT WHAT KIND OF OLD INVOICES TO DISPLAY. WE NEED A BUTTON?
|
||||
foreach ( $user_carts as $user_cart )
|
||||
{
|
||||
$cart_id = $user_cart['cart_id'];
|
||||
}
|
||||
|
||||
$carts[$cart_id] = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts AS cart JOIN
|
||||
OGP_DB_PREFIXbilling_orders AS orders
|
||||
ON orders.cart_id=cart.cart_id
|
||||
WHERE orders.status IN (0, -1 , -2) AND (cart.cart_id=".$db->realEscapeSingle($cart_id). ") order by order_id asc");
|
||||
}
|
||||
}
|
||||
|
||||
if( empty( $carts ) )
|
||||
{
|
||||
print_failure( get_lang('there_are_no_orders_in_cart') );
|
||||
?>
|
||||
<a href="?m=billing&p=shop"><?php print_lang('back'); ?></a>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
foreach ( $carts as $orders )
|
||||
{
|
||||
if( !empty( $orders ) )
|
||||
{
|
||||
?>
|
||||
<center>
|
||||
<table style="width:95%;text-align:left;" class="center">
|
||||
<tr>
|
||||
<hr />
|
||||
?>
|
||||
|
||||
<div class="site-panel">
|
||||
<h2 class="site-panel-title">Your Cart</h2>
|
||||
|
||||
<!--
|
||||
This is our cart form just for display and deletion. There is a different form below that has the paypal button and fills in all the hidden fields
|
||||
-->
|
||||
|
||||
<table class="cart-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="table-compact text-center"></th>
|
||||
<th>Server ID</th>
|
||||
<th>Game Name</th>
|
||||
<th>Location</th>
|
||||
<th>Max Players</th>
|
||||
<th>Price per Player</th>
|
||||
<th>Months</th>
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$grandTotal = 0; // Initialize grand total variable
|
||||
|
||||
if (isset($carts) && $carts instanceof mysqli_result && $carts->num_rows > 0) {
|
||||
while ($row = $carts->fetch_assoc()) {
|
||||
?>
|
||||
<tr data-cart-id="<?php echo htmlspecialchars($row['order_id']); ?>">
|
||||
<td>
|
||||
<form method="post" action="" class="inline-form">
|
||||
<button type="submit" name="delete_single" value="<?php echo htmlspecialchars($row['order_id']); ?>" class="btn-square text-danger">
|
||||
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
<td><?php echo htmlspecialchars($row['home_id']); ?></td>
|
||||
<td><?php echo htmlspecialchars($row['home_name']); ?></td>
|
||||
<td><?php echo htmlspecialchars($row['ip']); ?></td>
|
||||
<td><?php echo htmlspecialchars($row['max_players']); ?></td>
|
||||
<td>$<?php echo number_format($row['price'], 2); ?></td>
|
||||
<td><?php echo htmlspecialchars($row['qty']); ?></td>
|
||||
<?php $rowtotal = $row['price'] * $row['qty'] * $row['max_players'];?>
|
||||
<?php
|
||||
// Use the previously resolved $is_admin (computed once above)
|
||||
$is_free = ((float)$row['price'] == 0.0);
|
||||
?>
|
||||
<?php if ($is_admin || $is_free): ?>
|
||||
<td>
|
||||
<form method="post" action="" class="inline-form">
|
||||
<input type="hidden" name="create_free_for" value="<?php echo (int)$row['order_id']; ?>">
|
||||
<button type="submit" class="btn-primary"><?php echo $is_admin ? 'Create (Free)' : 'Claim (Free)'; ?></button>
|
||||
</form>
|
||||
<?php if ($is_admin): ?>
|
||||
<div style="font-size:11px;color:#666;margin-top:4px;">Admin: force-create a paid record for testing.</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td> </td>
|
||||
<?php endif; ?>
|
||||
<?php $grandTotal += $rowtotal; // Add to grand total ?>
|
||||
<td>$<?php echo number_format($rowtotal, 2); ?></td>
|
||||
|
||||
|
||||
<th>
|
||||
<?php print_lang("order_desc");?></th>
|
||||
<th>
|
||||
<?php print_lang("price");?>
|
||||
</th>
|
||||
<?php
|
||||
if(isset($orders[0]['paid']) and $orders[0]['paid'] == 3)
|
||||
{
|
||||
?>
|
||||
<th>
|
||||
<?php print_lang('expiration_date');?>
|
||||
</th>
|
||||
|
||||
<th>Status
|
||||
</th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<th>
|
||||
</th>
|
||||
</tr>
|
||||
<?php
|
||||
$subtotal = 0;
|
||||
$total_orders = count($orders);
|
||||
$order_counter = 0;
|
||||
foreach($orders as $order)
|
||||
{
|
||||
$order_counter++;
|
||||
if ( $order['qty'] > 1 )
|
||||
$order['invoice_duration'] = $order['invoice_duration']."s";
|
||||
|
||||
$subtotal += ($order['price']* $order['max_players'] * $order['qty']);
|
||||
|
||||
?>
|
||||
<tr class="tr">
|
||||
|
||||
<td>
|
||||
<?php
|
||||
$rserver = $db->getRemoteServer($order['ip']);
|
||||
if($order['home_id'] == 0)
|
||||
{
|
||||
echo "Order# ".$order['order_id'] . " <b>".$order['home_name']."</b>";
|
||||
//**************************************************
|
||||
?>
|
||||
<form method="post" action="home.php?m=billing&p=create_servers" >
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input name="buy" type="submit" value="Create Server" ><br>
|
||||
</form>
|
||||
<?php
|
||||
|
||||
|
||||
//*************************************************
|
||||
}
|
||||
else{
|
||||
|
||||
echo "Order# ".$order['order_id'] . " <b>".$order['home_name']."</b> Server ID ".$order['home_id'] ;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo "$" . number_format( $order['price'], 2 ). " " .$order['currency'] . " per slot<br>"
|
||||
|
||||
. $order['max_players'] . " Slots<br>"
|
||||
. $order['qty'] . " " . $order['invoice_duration'] ;
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
if($order['paid'] == 0 and ($order['extended'] == 0))
|
||||
{
|
||||
?>
|
||||
<td align="center">
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input type="hidden" name="order_id" value="<?php echo @$order['order_id'];?>">
|
||||
|
||||
</form>
|
||||
<?php if ($total_orders == $order_counter) {
|
||||
?>
|
||||
<!--checkbox -->
|
||||
<form method="post" action="" >
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<?php
|
||||
//check number of orders they have had or if user is an admin (to be able to create server)
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
$server_price = number_format( $order['price'], 2 );
|
||||
if(isset($settings['display_free'])) {
|
||||
$display_free = $settings['display_free'];
|
||||
}else {
|
||||
$display_free = false;
|
||||
}
|
||||
if($isAdmin)
|
||||
//if($display_free)
|
||||
{
|
||||
if($isAdmin)
|
||||
{
|
||||
//echo '<input name="buy" type="submit" value="Create Server" ><br>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<?php } ?>
|
||||
</td><?php
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
if($order['paid'] == 3)
|
||||
{
|
||||
$today=time();
|
||||
$formated_finish_date = date('d/M/Y H:i A',$order['finish_date']);
|
||||
|
||||
//status has a date for invoice
|
||||
if($order['status'] > 0)
|
||||
{
|
||||
$status = "<b style='color:green;'>Active</b>" ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//status is -1, invoice has been created
|
||||
elseif($order['status'] == -1)
|
||||
{
|
||||
$status = "<b style='color:yellow;'>Invoice Due</b>";
|
||||
}
|
||||
//invoice was not paid, server is expired and suspended
|
||||
elseif($order['status'] == -2)
|
||||
{
|
||||
$status = "<b style='color:red;'>Suspended</b>";
|
||||
}
|
||||
|
||||
//display the expiration date and invoice button.
|
||||
if($order['status'] > 0){$warning_status = "<b style='color:green;'>". $formated_finish_date ."</b>";}
|
||||
if($order['status'] == -1){$warning_status ="<b style='color:yellow;'>". $formated_finish_date ."</b>";}
|
||||
if($order['status'] == -2){$warning_status ="<b style='color:red;'>". $formated_finish_date ."</b>" ;}
|
||||
|
||||
?>
|
||||
<td>
|
||||
<?php echo "$warning_status";?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo "$status";
|
||||
|
||||
// Add total row
|
||||
?>
|
||||
<tr class="cart-total-row">
|
||||
<td colspan="7" class="cart-total-label">
|
||||
Cart Total:
|
||||
</td>
|
||||
<td class="cart-total-value">
|
||||
$<?php echo number_format($grandTotal, 2); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
} else {
|
||||
// Display a message if no cart items are found
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="7" class="text-center muted">No items in your cart.</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
|
||||
if( isset( $order['status'] ) and $order['status'] == "0" or $order['status'] == "-1" or $order['status'] == "-2")
|
||||
{
|
||||
?>
|
||||
<td></td></tr><tr><td>
|
||||
<?php
|
||||
// These must already exist earlier in your cart page:
|
||||
// $grandTotal (number) e.g., 24.49
|
||||
// $invoice (array) e.g., [['serverID'=>'srv123','amount'=>9.99], ['serverID'=>'srv999','amount'=>14.50]]
|
||||
|
||||
|
||||
</td><?php
|
||||
}
|
||||
?>
|
||||
</tr><?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<table style="width:95%;text-align:left;" class="center">
|
||||
<tr>
|
||||
<td>Amount</td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
echo "$" . number_format( $subtotal , 2 ). " " .$order['currency'];?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b><?php echo $coupon_name;?></b></td>
|
||||
<td>
|
||||
<?php
|
||||
//APPLY COUPON CODE HERE
|
||||
$coupon_discount_amt = $subtotal * ($coupon_discount / 100);
|
||||
echo "-$" . number_format($coupon_discount_amt,2);
|
||||
?></td><td>
|
||||
<table><tr>
|
||||
<form method="post" action="">
|
||||
<td class="child">
|
||||
<input type="text" name="coupon_code"size="5" value="<?php echo $coupon_code ?>"></input>
|
||||
</td>
|
||||
<td>
|
||||
<!--<input type="submit" name="Apply Code" value="Apply Code"></input>-->
|
||||
</td>
|
||||
</tr></table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Discounted Subtotal</td>
|
||||
<td><?php $subtotal = $subtotal-$coupon_discount_amt;echo "$" . number_format( $subtotal , 2 ). " " .$order['currency'];?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Tax Amount</td>
|
||||
<td>
|
||||
<?php echo "$" . number_format($order['tax_amount']/100 * $subtotal,2);?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php print_lang("total");?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$total = $subtotal+($order['tax_amount']/100*$subtotal);
|
||||
echo "$" . number_format( $total , 2 ). " " .$order['currency'];
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if($order['paid'] == 1)
|
||||
{
|
||||
?>
|
||||
<form method="post" action="home.php?m=billing&p=create_servers">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<?php
|
||||
if($order['extended'] == "1")
|
||||
{
|
||||
?>
|
||||
<input name="enable_server" type="submit" value="<?php print_lang("enable_server");?>">
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<!-- <input name="create_server" type="submit" value="<?php print_lang("create_server");?>">-->
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
elseif($order['paid'] == 2)
|
||||
{
|
||||
echo get_lang_f("payment_is_pending_of_approval");
|
||||
}
|
||||
elseif($order['paid'] == 3)
|
||||
{
|
||||
?>
|
||||
<form method="post" action="?m=billing&p=bill">
|
||||
<input type="hidden" name="cart_id" value="<?php echo $order['cart_id'];?>">
|
||||
<input name="paid" type="submit" value="<?php print_lang("see_invoice");?>">
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<a href="?m=billing&p=shop"><?php print_lang('back'); ?></a>
|
||||
<?php
|
||||
// --- Sanity + normalization ---
|
||||
if (!isset($grandTotal) || !is_numeric($grandTotal)) {
|
||||
$grandTotal = 0.00;
|
||||
}
|
||||
if (!isset($invoice) || !is_array($invoice)) {
|
||||
$invoice = [];
|
||||
}
|
||||
$currency = 'USD';
|
||||
$amount = number_format((float)$grandTotal, 2, '.', '');
|
||||
$lineItems = [];
|
||||
|
||||
// Build PayPal-friendly items array (name, unit_amount, quantity, sku)
|
||||
foreach ($invoice as $i) {
|
||||
$sid = isset($i['serverID']) ? (string)$i['serverID'] : 'unknown';
|
||||
$amt = isset($i['amount']) && is_numeric($i['amount']) ? number_format((float)$i['amount'], 2, '.', '') : '0.00';
|
||||
$lineItems[] = [
|
||||
'name' => "Server $sid",
|
||||
'quantity' => '1',
|
||||
'unit_amount' => ['currency_code' => $currency, 'value' => $amt],
|
||||
'sku' => $sid
|
||||
];
|
||||
}
|
||||
|
||||
// Single overall invoice id for the order
|
||||
$invoiceId = 'INV-' . date('Ymd-His') . '-' . bin2hex(random_bytes(3));
|
||||
|
||||
// A short custom reference derived from your line items (<= 127 chars for PayPal)
|
||||
$customHash = substr(strtoupper(sha1(json_encode($invoice))), 0, 16);
|
||||
$customId = "INVREF-$customHash";
|
||||
|
||||
// Text on the PayPal side
|
||||
$description = 'Game server order (' . count($lineItems) . ' item' . (count($lineItems)===1?'': 's') . ')';
|
||||
|
||||
// URLs
|
||||
$siteBase = 'https://panel.iaregamer.com';
|
||||
$returnUrl = $siteBase . '/_website/return.php?invoice=' . urlencode($invoiceId);
|
||||
$cancelUrl = $siteBase . '/_website/return.php?invoice=' . urlencode($invoiceId) . '&cancel=1';
|
||||
|
||||
// API base (relative)
|
||||
$apiBase = '/_website/api';
|
||||
?>
|
||||
<!-- PayPal JS SDK (Sandbox). Use LIVE client-id when going live. -->
|
||||
<script src="https://www.paypal.com/sdk/js?client-id=AfvY_C2zA_hTHxHq7TIhtOeub4xBdySYrt_Hjj3d_WYQwjWI9NfOAVOTeResx2rgZ_nP5tOoxQSAHw8c¤cy=USD&intent=capture"></script>
|
||||
|
||||
<div id="paypal-button-container"></div>
|
||||
<div id="pp-status" class="mt-12" style="font:14px system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;"></div>
|
||||
|
||||
<script>
|
||||
(function(){
|
||||
const statusEl = document.getElementById('pp-status');
|
||||
|
||||
// Values from PHP
|
||||
const amount = "<?= $amount ?>";
|
||||
const currency = "<?= $currency ?>";
|
||||
const invoice_id = "<?= $invoiceId ?>";
|
||||
const custom_id = "<?= $customId ?>";
|
||||
const description = "<?= htmlspecialchars($description, ENT_QUOTES) ?>";
|
||||
const return_url = "<?= $returnUrl ?>";
|
||||
const cancel_url = "<?= $cancelUrl ?>";
|
||||
|
||||
// Line items (serverID + per-item amount) for your records and webhook correlation
|
||||
const line_invoices = <?php echo json_encode($invoice, JSON_UNESCAPED_SLASHES); ?>;
|
||||
|
||||
// PayPal "items" for purchase_units (shows on PayPal + returns in webhook under purchase_units)
|
||||
const items = <?php echo json_encode($lineItems, JSON_UNESCAPED_SLASHES); ?>;
|
||||
|
||||
function setStatus(msg){ if(statusEl) statusEl.textContent = msg; }
|
||||
|
||||
paypal.Buttons({
|
||||
createOrder: function() {
|
||||
setStatus('Creating order…');
|
||||
return fetch("<?= $apiBase ?>/create_order.php", {
|
||||
method: "POST",
|
||||
headers: {"Content-Type":"application/json"},
|
||||
body: JSON.stringify({
|
||||
amount, currency, invoice_id, custom_id, description,
|
||||
return_url, cancel_url,
|
||||
// The next two are for your server to include:
|
||||
items, // PayPal purchase_units[0].items
|
||||
line_invoices // your raw cart detail, persisted in your DB if you choose
|
||||
})
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
if (!data.id) { throw new Error(data.error || 'No order id'); }
|
||||
setStatus('Order created.');
|
||||
return data.id;
|
||||
});
|
||||
},
|
||||
|
||||
onApprove: function(data) {
|
||||
setStatus('Capturing payment…');
|
||||
return fetch("<?= $apiBase ?>/capture_order.php", {
|
||||
method: "POST",
|
||||
headers: {"Content-Type":"application/json"},
|
||||
body: JSON.stringify({ order_id: data.orderID })
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(capture => {
|
||||
if (capture.status === 'COMPLETED') {
|
||||
// go to your return page; webhook will fill data/<invoice_id>.json
|
||||
window.location.href = return_url;
|
||||
} else {
|
||||
setStatus('Capture status: ' + capture.status);
|
||||
}
|
||||
})
|
||||
.catch(err => setStatus('Error: ' + err.message));
|
||||
},
|
||||
|
||||
onCancel: function() {
|
||||
window.location.href = cancel_url;
|
||||
},
|
||||
|
||||
onError: function(err){
|
||||
setStatus('PayPal error: ' + (err && err.message ? err.message : err));
|
||||
}
|
||||
}).render('#paypal-button-container');
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
// Close database connection
|
||||
mysqli_close($db);
|
||||
?>
|
||||
<?php include(__DIR__ . '/includes/footer.php'); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,375 +0,0 @@
|
|||
<?php
|
||||
require_once("includes/lib_remote.php");
|
||||
require_once("modules/config_games/server_config_parser.php");
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db,$view,$settings;
|
||||
$user_id = $_SESSION['user_id'];
|
||||
if (isset($_POST['cart_id'])) {
|
||||
$cart_id = $_POST['cart_id'];
|
||||
}
|
||||
if(isset($_GET['cart_id'])){
|
||||
$cart_id = $_GET['cart_id'];
|
||||
}
|
||||
$cart_paid = $db->resultQuery( "SELECT paid FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin ){
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
} else {
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
}
|
||||
if( !empty($orders) and !empty($cart_paid) )
|
||||
{
|
||||
|
||||
foreach($orders as $order)
|
||||
{
|
||||
$order_id = $order['order_id'];
|
||||
$service_id = $order['service_id'];
|
||||
$home_name = $order['home_name'];
|
||||
$remote_control_password = $order['remote_control_password'];
|
||||
$ftp_password = $order['ftp_password'];
|
||||
$ip = $order['ip'];
|
||||
$max_players = $order['max_players'];
|
||||
$user_id = $order['user_id'];
|
||||
$extended = $order['extended'] == "1" ? TRUE : FALSE;
|
||||
//Query service info
|
||||
$service = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($service_id) );
|
||||
|
||||
if( !empty( $service[0] ) )
|
||||
{
|
||||
$home_cfg_id = $service[0]['home_cfg_id'];
|
||||
$mod_cfg_id = $service[0]['mod_cfg_id'];
|
||||
//remote_server_id has been stored in IP_ID
|
||||
//$remote_server_id = $service[0]['remote_server_id'];
|
||||
$remote_server_id = $order['ip'];
|
||||
|
||||
$ftp = $service[0]['ftp'];
|
||||
$install_method = $service[0]['install_method'];
|
||||
$manual_url = $service[0]['manual_url'];
|
||||
$access_rights = $service[0]['access_rights'];
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
if($extended)
|
||||
{
|
||||
$home_id = $order['home_id'];
|
||||
|
||||
//Get The home info without mods in 1 array (Necesary for remote connection).
|
||||
$home_info = $db->getGameHomeWithoutMods($home_id);
|
||||
|
||||
//Create the remote connection
|
||||
$remote = new OGPRemoteLibrary($home_info['agent_ip'],$home_info['agent_port'],$home_info['encryption_key'],$home_info['timeout']);
|
||||
|
||||
//Reassign the server
|
||||
$db->assignHomeTo( "user", $user_id, $home_id, $access_rights );
|
||||
|
||||
//Reenable the FTP account
|
||||
if ($ftp == "enabled")
|
||||
{
|
||||
$remote->ftp_mgr("useradd", $home_info['home_id'], $home_info['ftp_password'], $home_info['home_path']);
|
||||
$db->changeFtpStatus('enabled',$home_info['home_id']);
|
||||
}
|
||||
echo "<h4>Server Installed, Check your Email for Details</h4><br>";
|
||||
|
||||
//Panel Log
|
||||
$db->logger( "RENEWED SERVER " . $home_id);
|
||||
// SEND EMAIL
|
||||
$settings = $db->getSettings();
|
||||
$subject = "Gameserver Renewel at " . $settings['panel_name'];
|
||||
$email = $db->resultQuery(" SELECT DISTINCT users_email
|
||||
FROM ogp_users, ogp_billing_orders
|
||||
WHERE ogp_users.user_id = $user_id")[0]["users_email"];
|
||||
|
||||
$message = "Your server, " . $home_name ." ID #". $home_id . " at " . $settings['panel_name'] . " has just been renewed.<br>
|
||||
Thank You for your continued support.<br>
|
||||
If you have any questions or requests, visit our website or contact us directly in our Discord Server.";
|
||||
|
||||
$mail = mymail($email, $subject, $message, $settings);
|
||||
$rundate = date('d/M/y G:i',$now);
|
||||
|
||||
if (!$mail)
|
||||
$db->logger( "Email FAILED - Server Renewed " . $home_id);
|
||||
// END EMAIL
|
||||
|
||||
//WEBHOOK Discord=======================================================================================
|
||||
|
||||
|
||||
$webhookurl = $settings['webhookurl'];
|
||||
|
||||
$msg = "The ". $home_name ." server ID #". $home_id . " has just been renewed.";
|
||||
$json_data = array ('content'=>"$msg");
|
||||
$make_json = json_encode($json_data);
|
||||
$ch = curl_init( $webhookurl );
|
||||
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
|
||||
curl_setopt( $ch, CURLOPT_POST, 1);
|
||||
curl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json);
|
||||
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt( $ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response = curl_exec( $ch );
|
||||
//If you need to debug, or find out why you can't send message uncomment line below, and execute script.
|
||||
//echo $response;
|
||||
//end WEBHOOK Discord
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//OPTIONS, change it at your choice;
|
||||
$extra_params = "";//no extra params defined by default
|
||||
$cpu_affinity = "NA";//Affinity to one core/thread of the cpu by number, use NA to disable it
|
||||
$nice = "0";//Min priority=19 Max Priority=-19
|
||||
|
||||
//Add Game home to database
|
||||
//HARD CODE TO /home/gameserver/
|
||||
$rserver = $db->getRemoteServer($remote_server_id);
|
||||
$game_path = "/home/gameserver/";
|
||||
$home_id = $db->addGameHome( $remote_server_id, $user_id, $home_cfg_id, $game_path, $home_name, $remote_control_password, $ftp_password);
|
||||
|
||||
//Add IP:Port Pair to the Game Home
|
||||
//need to get the IP_ID for this remote server.
|
||||
$result = $db->resultQuery("SELECT ip_id FROM OGP_DB_PREFIXremote_server_ips WHERE remote_server_id=".$ip);
|
||||
foreach ($result as $rs)
|
||||
{
|
||||
$ip_id = $rs['ip_id'];
|
||||
}
|
||||
$add_port = $db->addGameIpPort( $home_id, $ip_id, $db->getNextAvailablePort($ip_id,$home_cfg_id) );
|
||||
|
||||
//Assign the Game Mod to the Game Home
|
||||
$mod_id = $db->addModToGameHome( $home_id, $mod_cfg_id );
|
||||
$db->updateGameModParams( $max_players, $extra_params, $cpu_affinity, $nice, $home_id, $mod_cfg_id );
|
||||
$db->assignHomeTo( "user", $user_id, $home_id, $access_rights );
|
||||
|
||||
//Get The home info without mods in 1 array (Necesary for remote connection).
|
||||
$home_info = $db->getGameHomeWithoutMods($home_id);
|
||||
|
||||
//Create the remote connection
|
||||
$remote = new OGPRemoteLibrary($home_info['agent_ip'],$home_info['agent_port'],$home_info['encryption_key'],$home_info['timeout']);
|
||||
|
||||
//Get Full home info in 1 array
|
||||
$home_info = $db->getGameHome($home_id);
|
||||
|
||||
//Read the Game Config from the XML file
|
||||
$server_xml = read_server_config(SERVER_CONFIG_LOCATION."/".$home_info['home_cfg_file']);
|
||||
|
||||
//Get Values from XML
|
||||
$modkey = $home_info['mods'][$mod_id]['mod_key'];
|
||||
$mod_xml = xml_get_mod($server_xml, $modkey);
|
||||
$installer_name = $mod_xml->installer_name;
|
||||
$mod_cfg_id = $home_info['mods'][$mod_id]['mod_cfg_id'];
|
||||
|
||||
//Get Preinstall commands from xml
|
||||
$precmd = $server_xml->pre_install;
|
||||
|
||||
|
||||
//Get Postinstall commands from xml
|
||||
$postcmd = $server_xml->post_install;
|
||||
|
||||
|
||||
//Enable FTP account in remote server
|
||||
if ($ftp == "enabled")
|
||||
{
|
||||
$remote->ftp_mgr("useradd", $home_info['home_id'], $home_info['ftp_password'], $home_info['home_path']);
|
||||
$db->changeFtpStatus('enabled',$home_info['home_id']);
|
||||
}
|
||||
|
||||
//Install files for this service in the remote server
|
||||
// -Steam
|
||||
$exec_folder_path = clean_path($home_info['home_path'] . "/" . $server_xml->exe_location );
|
||||
$exec_path = clean_path($exec_folder_path . "/" . $server_xml->server_exec_name );
|
||||
|
||||
if ($install_method == "steam")
|
||||
{
|
||||
if ( $server_xml->installer == "steamcmd" )
|
||||
{
|
||||
if( preg_match("/win32/", $server_xml->game_key) OR preg_match("/win64/", $server_xml->game_key) )
|
||||
$cfg_os = "windows";
|
||||
elseif( preg_match("/linux/", $server_xml->game_key) )
|
||||
$cfg_os = "linux";
|
||||
|
||||
// Some games like L4D2 require anonymous login
|
||||
if($mod_xml->installer_login){
|
||||
$login = $mod_xml->installer_login;
|
||||
$pass = '';
|
||||
}else{
|
||||
$login = $settings['steam_user'];
|
||||
$pass = $settings['steam_pass'];
|
||||
}
|
||||
|
||||
$modname = ( $installer_name == '90' and !preg_match("/(cstrike|valve)/", $modkey) ) ? $modkey : '';
|
||||
$betaname = isset($mod_xml->betaname) ? $mod_xml->betaname : '';
|
||||
$betapwd = isset($mod_xml->betapwd) ? $mod_xml->betapwd : '';
|
||||
$arch = isset($mod_xml->steam_bitness) ? $mod_xml->steam_bitness : '';
|
||||
|
||||
$remote->steam_cmd( $home_id,$home_info['home_path'],$installer_name,$modname,
|
||||
$betaname,$betapwd,$login,$pass,$settings['steam_guard'],
|
||||
$exec_folder_path,$exec_path,$precmd,$postcmd,$cfg_os,'',$arch);
|
||||
}
|
||||
}
|
||||
// -Rsync
|
||||
elseif ($install_method == "rsync")
|
||||
{
|
||||
|
||||
//Rsync Server
|
||||
$url = "files.iaregamer.com";
|
||||
//OS
|
||||
if( preg_match("/win32/", $server_xml->game_key) OR preg_match("/win64/", $server_xml->game_key) )
|
||||
$os = "windows";
|
||||
elseif( preg_match("/linux/", $server_xml->game_key) )
|
||||
$os = "linux";
|
||||
//Rsync Game Name
|
||||
//JUST SET RS_GNAME TO GAME xml NAME
|
||||
$rs_gname = $server_xml->game_key;
|
||||
|
||||
//Starting Sync
|
||||
$full_url = "$url/rsync_installer/$rs_gname/$os/";
|
||||
|
||||
|
||||
|
||||
$remote->start_rsync_install($home_id,$home_info['home_path'],"$full_url",$exec_folder_path,$exec_path,$precmd,$postcmd);
|
||||
}
|
||||
// -Manual
|
||||
elseif ($install_method == "manual")
|
||||
{
|
||||
// Start File Download and uncompress
|
||||
$filename = !empty($manual_url) ? substr($manual_url, -9) : "";
|
||||
$remote->start_file_download($manual_url,$home_info['home_path'],$filename,"uncompress");
|
||||
}
|
||||
echo "<h4><br><p>".get_lang('starting_installations')."</p></h4><br>";
|
||||
//PANEL LOG
|
||||
$db->logger( "CREATED NEW SERVER " . $home_id);
|
||||
// SEND EMAIL to new server only
|
||||
if($order['finish_date'] == 0){
|
||||
$settings = $db->getSettings();
|
||||
$subject = "New Gameserver installed at " . $settings['panel_name'];
|
||||
$email = $db->resultQuery(" SELECT DISTINCT users_email
|
||||
FROM ogp_users, ogp_billing_orders
|
||||
WHERE ogp_users.user_id = $user_id")[0]["users_email"];
|
||||
|
||||
$message = "Your server, " . $home_name ." ID #". $home_id . " at " . $settings['panel_name'] . " has just been created.<br>
|
||||
Thank You for your continued support.<br>
|
||||
If you have any questions or requests, visit our website or contact us directly in our Discord Server.
|
||||
You can login to the Game Panel and click on Game Monitor to see your server. <br><br>
|
||||
Thank you!<br> ";
|
||||
$mail = mymail($email, $subject, $message, $settings);
|
||||
$rundate = date('d/M/y G:i',$now);
|
||||
|
||||
if (!$mail)
|
||||
$db->logger( "Email FAILED - Server Created " . $home_id);
|
||||
|
||||
|
||||
//WEBHOOK Discord=======================================================================================
|
||||
|
||||
$webhookurl = $settings['webhookurl'];
|
||||
|
||||
|
||||
$msg = "A new server, ". $home_name ." ID #". $home_id . ", has just been created.";
|
||||
$json_data = array ('content'=>"$msg");
|
||||
$make_json = json_encode($json_data);
|
||||
$ch = curl_init( $webhookurl );
|
||||
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
|
||||
curl_setopt( $ch, CURLOPT_POST, 1);
|
||||
curl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json);
|
||||
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt( $ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response = curl_exec( $ch );
|
||||
//If you need to debug, or find out why you can't send message uncomment line below, and execute script.
|
||||
//echo $response;
|
||||
//end WEBHOOK Discord
|
||||
}
|
||||
// END EMAIL
|
||||
|
||||
|
||||
}
|
||||
// Set expiration date in ogp database
|
||||
//End_date is when the invoice is printed.
|
||||
//finish_date the server will be suspended
|
||||
//in cron_shop the finish_date is used to delete the server
|
||||
//several days after being suspended
|
||||
if ($order['invoice_duration'] == "day")
|
||||
{
|
||||
|
||||
if($order['finish_date'] == 0){
|
||||
$finish_date = strtotime('+'.$order['qty'].' day');
|
||||
$end_date = strtotime('- 2 day',$finish_date);
|
||||
}
|
||||
else{
|
||||
//this is a renewel, start from end of previous order
|
||||
$finish_date = strtotime('+'.$order['qty'].' day',$order['finish_date']);
|
||||
$end_date = strtotime('- 6 hour', $finish_date);
|
||||
}
|
||||
|
||||
}
|
||||
elseif ($order['invoice_duration'] == "month")
|
||||
{
|
||||
// this is a new order
|
||||
if($order['finish_date'] == 0){
|
||||
$finish_date = strtotime('+'.$order['qty'].' month');
|
||||
$end_date = strtotime('- 7 day',$finish_date);
|
||||
|
||||
}
|
||||
else{
|
||||
//this is a renewel, start from end of previous order
|
||||
$finish_date = strtotime('+'.$order['qty'].' month',$order['finish_date']);
|
||||
$end_date = strtotime('- 7 day',$finish_date);
|
||||
}
|
||||
}
|
||||
elseif ($order['invoice_duration'] == "year")
|
||||
{
|
||||
// this is a new order
|
||||
if($order['finish_date'] == 0){
|
||||
$finish_date = strtotime('+'.$order['qty'].' year');
|
||||
$end_date = strtotime('- 2 week',$finish_date);
|
||||
}
|
||||
else{
|
||||
//this is a renewel, start from end of previous order
|
||||
$finish_date = strtotime('+'.$order['qty'].' year',$order['finish_date']);
|
||||
$end_date = strtotime('- 2 week',$finish_date);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// set order expire date
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
SET end_date='" . $db->realEscapeSingle($end_date) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
SET finish_date='" . $db->realEscapeSingle($finish_date) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
// Save home id created by this order
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
SET home_id='" . $db->realEscapeSingle($home_id) . "' WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
}
|
||||
|
||||
//Update Cart Payment Status as 3(paid and installed)
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
SET paid=3
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
// Set payment/creation date
|
||||
$date = date('d M Y');
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
SET date='" . $db->realEscapeSingle($date) . "'
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
$db->query( "UPDATE OGP_DB_PREFIXgame_mods SET max_players= ".$order['max_players']." WHERE home_id=".$db->realEscapeSingle($home_id));
|
||||
|
||||
|
||||
//Refresh to Game Monitor.
|
||||
$view->refresh("home.php?m=gamemanager&p=game_monitor");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,217 +0,0 @@
|
|||
<?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
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
117
modules/billing/css/header.css
Normal file
117
modules/billing/css/header.css
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
.gsw-top{display:flex;align-items:center;gap:12px;padding:12px 24px;background:#fff;border-bottom:1px solid rgba(0,0,0,0.05);}
|
||||
.gsw-top img{height:40px;width:auto;display:block}
|
||||
.gsw-top .gsw-site-name{font-weight:700;font-size:1.1rem;color:#333}
|
||||
@media(max-width:480px){.gsw-top{padding:10px}.gsw-top img{height:32px}.gsw-top .gsw-site-name{font-size:1rem}}
|
||||
|
||||
.gsw-header{display:flex;justify-content:space-between;align-items:center;padding:12px 20px;background:#0b3b6f;backdrop-filter:blur(6px);margin-bottom:18px;box-shadow:0 2px 6px rgba(0,0,0,0.18);}
|
||||
.gsw-header-left{display:flex;align-items:center;font-weight:700;font-size:1.1rem;color:#fff;}
|
||||
.gsw-logo{height:36px;width:auto;margin-right:10px;display:block}
|
||||
.gsw-logo-link{display:flex;align-items:center;gap:8px;color:#fff;text-decoration:none}
|
||||
.gsw-header-left a{color:#fff;text-decoration:none;}
|
||||
.gsw-header-nav{display:flex;gap:18px;align-items:center;}
|
||||
.gsw-nav-link{color:#fff;text-decoration:none;font-size:0.95rem;transition:opacity 0.2s;}
|
||||
.gsw-nav-link:hover{opacity:0.85;text-decoration:underline;}
|
||||
.gsw-header-right{display:flex;gap:12px;align-items:center;}
|
||||
.gsw-user-info{color:#fff;font-size:0.95rem;}
|
||||
.gsw-header-btn{padding:8px 16px;background:#fff;color:#0b3b6f;border-radius:6px;text-decoration:none;font-weight:600;transition:transform 0.2s;}
|
||||
.gsw-header-btn:hover{transform:translateY(-2px);}
|
||||
@media(max-width:768px){
|
||||
.gsw-header{flex-direction:column;gap:12px;}
|
||||
.gsw-header-nav{flex-wrap:wrap;justify-content:center;}
|
||||
}
|
||||
|
||||
/* Banner styling (index only) */
|
||||
.gsw-banner{width:100%;text-align:center;margin-bottom:18px}
|
||||
.gsw-banner img{max-width:100%;height:auto;display:inline-block}
|
||||
|
||||
/* Footer styles */
|
||||
footer.gsw-footer{background:#000;color:#fff;padding:18px 12px;text-align:center;margin-top:28px}
|
||||
footer.gsw-footer a{color:#4aa3ff;text-decoration:none}
|
||||
footer.gsw-footer a:hover{text-decoration:underline}
|
||||
|
||||
/* Page color scheme: prefer dark text on light backgrounds by default */
|
||||
/* Dark site theme: dark background with light text */
|
||||
body { color: #fff; background: #0b1020; }
|
||||
|
||||
/* Make links readable on dark background */
|
||||
a { color: #7fb3ff; }
|
||||
|
||||
/* Form inputs: light text on darker inputs by default */
|
||||
input, textarea, select, button { color: #fff; background: #11141f; border: 1px solid rgba(255,255,255,0.06); }
|
||||
|
||||
.cart-badge{display:inline-block;background:#ff3b30;color:#fff;font-size:0.8rem;padding:2px 6px;border-radius:12px;margin-left:6px;vertical-align:middle}
|
||||
.site-panel{width:100%; max-width:1000px; margin:auto; padding:1rem; background:rgba(0,0,0,0.25); border-radius:0.75rem;}
|
||||
.site-panel-title{font-size:1.5rem; font-weight:bold; color:#fff; margin-bottom:1.5rem; text-align:center}
|
||||
.cart-table{border-collapse:separate; border-spacing:0; width:100%; color:#fff}
|
||||
.cart-table thead{background:rgba(255,255,255,0.03)}
|
||||
.cart-table th, .cart-table td{padding:1rem 1.5rem; text-align:left; border-bottom:1px solid rgba(255,255,255,0.03)}
|
||||
.cart-total-row{background:transparent; font-weight:bold}
|
||||
.cart-total-label{padding:1rem 1.5rem; text-align:right; border-top:2px solid rgba(255,255,255,0.06); font-weight:600; color:#fff}
|
||||
.cart-total-value{padding:1rem 1.5rem; text-align:left; border-top:2px solid rgba(255,255,255,0.06); font-weight:600; color:#fff; font-size:1.1rem}
|
||||
|
||||
/* Utility classes */
|
||||
.container-wide{width:100%; max-width:1000px; margin:28px auto;}
|
||||
.panel{background:rgba(0,0,0,0.25); padding:16px; border-radius:8px}
|
||||
.muted{color:rgba(255,255,255,0.6)}
|
||||
.center{text-align:center}
|
||||
.pad-40{padding:40px}
|
||||
.btn-danger{background:#ef4444;color:#fff;border:none;padding:6px 10px;border-radius:6px}
|
||||
.btn-primary{background:#06b6d4;color:#fff;border:none;padding:6px 10px;border-radius:6px}
|
||||
.float-left{float:left}
|
||||
.clearfix::after{content:"";display:table;clear:both}
|
||||
.table-compact th,.table-compact td{padding:0.5rem}
|
||||
|
||||
/* Small spacing utilities used by a few pages */
|
||||
.mb-18{margin-bottom:18px}
|
||||
.mt-6{margin-top:6px}
|
||||
.mt-12{margin-top:12px}
|
||||
|
||||
/* Padding helper used where a wider card/panel is desired */
|
||||
.p-30-20{padding:30px 20px}
|
||||
|
||||
/* Decorative container used in a few places */
|
||||
.decorative-bottom{border:4px solid transparent;border-bottom:25px solid transparent}
|
||||
|
||||
/* Inline form helper (used for small inline forms inside table cells) */
|
||||
.inline-form{margin:0;display:inline}
|
||||
|
||||
/* Small square button (used for delete icons) */
|
||||
.btn-square{width:2rem;height:2rem;display:inline-flex;align-items:center;justify-content:center;font-weight:bold;border-radius:0.25rem;border:none}
|
||||
|
||||
.text-right{text-align:right}
|
||||
.text-danger{color:#ef4444}
|
||||
.text-center{text-align:center}
|
||||
|
||||
/* small helpers for admin server list inputs */
|
||||
.min-w-260{min-width:260px}
|
||||
.min-w-240{min-width:240px}
|
||||
.w-90{width:90px}
|
||||
.img-preview{max-height:48px; max-width:120px; border:1px solid #eee; display:block}
|
||||
.loc-label{border:1px solid #eee;border-radius:6px;padding:6px 8px; display:inline-flex; align-items:center}
|
||||
.small-muted{color:#777;font-size:12px;margin-top:2px}
|
||||
|
||||
/* PayPal status */
|
||||
.pp-status{margin-top:12px;font:14px system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif}
|
||||
|
||||
/* AI UI helpers */
|
||||
.ai-container{max-width:760px; margin:20px auto; font-family:Arial, sans-serif}
|
||||
.ai-panel{margin:10px 0; padding:8px; border-radius:6px}
|
||||
.ai-alert{margin:10px 0; padding:8px; border-radius:6px; border:1px solid #c00}
|
||||
.ai-textarea{width:100%; padding:6px}
|
||||
.ai-message{margin-top:16px; padding:10px; border:1px solid #ccc; border-radius:8px}
|
||||
.ai-msg-title{font-weight:bold}
|
||||
.ai-msg-meta{margin-top:6px; font-size:12px}
|
||||
.flex-gap-wrap{display:flex;flex-wrap:wrap;gap:10px}
|
||||
.table-center{text-align:center;width:100%;border-collapse:collapse}
|
||||
.tb-row-bottom{border-bottom:1px solid #f0f0f0;padding:8px 6px;text-align:left}
|
||||
.locs-box{display:flex;flex-wrap:wrap;gap:8px}
|
||||
.mb-12{margin-bottom:12px}
|
||||
.mt-10{margin-top:10px}
|
||||
.mt-14{margin-top:14px}
|
||||
.mt-20{margin-top:20px}
|
||||
.mt-8{margin-top:8px}
|
||||
.btn-small{padding:3px 8px;font-size:12px}
|
||||
.mr-6{margin-right:6px}
|
||||
.ml-8{margin-left:8px}
|
||||
.flex-row-gap{display:flex;gap:8px;align-items:center}
|
||||
|
||||
12
modules/billing/data/FREE-548-1761171178.json
Normal file
12
modules/billing/data/FREE-548-1761171178.json
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"event_type": "PAYMENT.CAPTURE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": 0,
|
||||
"currency": "USD",
|
||||
"payer": "iaretechnician@gmail.com",
|
||||
"invoice": "FREE-548-1761171178",
|
||||
"custom": "admin_free_create_order_548",
|
||||
"resource_id": "FREE-439c594e1e65",
|
||||
"items": [],
|
||||
"ts": "2025-10-23T00:12:58+02:00"
|
||||
}
|
||||
12
modules/billing/data/FREE-549-1761246925.json
Normal file
12
modules/billing/data/FREE-549-1761246925.json
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"event_type": "PAYMENT.CAPTURE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": 0.1,
|
||||
"currency": "USD",
|
||||
"payer": "iaretechnician@gmail.com",
|
||||
"invoice": "FREE-549-1761246925",
|
||||
"custom": "admin_free_create_order_549",
|
||||
"resource_id": "FREE-8cc6dfaaba1b",
|
||||
"items": [],
|
||||
"ts": "2025-10-23T21:15:25+02:00"
|
||||
}
|
||||
11
modules/billing/data/INV-20250825-170438-e37518.json
Normal file
11
modules/billing/data/INV-20250825-170438-e37518.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"event_type": "PAYMENT.CAPTURE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": "19.99",
|
||||
"currency": "USD",
|
||||
"payer": null,
|
||||
"invoice": "INV-20250825-170438-e37518",
|
||||
"custom": "user_1234_order_5678",
|
||||
"resource_id": "2V315801FX904340P",
|
||||
"ts": "2025-08-25T17:05:27-04:00"
|
||||
}
|
||||
11
modules/billing/data/INV-20250825-174311-0a7993.json
Normal file
11
modules/billing/data/INV-20250825-174311-0a7993.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"event_type": "PAYMENT.CAPTURE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": "19.99",
|
||||
"currency": "USD",
|
||||
"payer": null,
|
||||
"invoice": "INV-20250825-174311-0a7993",
|
||||
"custom": "user_1234_order_5678",
|
||||
"resource_id": "9E566091YD182143A",
|
||||
"ts": "2025-08-25T17:43:56-04:00"
|
||||
}
|
||||
10
modules/billing/data/NO-INVOICE.json
Normal file
10
modules/billing/data/NO-INVOICE.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"event_type": "PAYMENT.SALE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": "0.48",
|
||||
"currency": "USD",
|
||||
"payer": null,
|
||||
"invoice": null,
|
||||
"custom": null,
|
||||
"ts": "2025-08-25T16:46:11-04:00"
|
||||
}
|
||||
10
modules/billing/data/SIMULATED-WEBHOOK-20251022-101500.json
Normal file
10
modules/billing/data/SIMULATED-WEBHOOK-20251022-101500.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"event_type": "PAYMENT.CAPTURE.COMPLETED",
|
||||
"status": "PAID",
|
||||
"amount": "9.99",
|
||||
"currency": "USD",
|
||||
"invoice": "INV-20251022-101500-TEST",
|
||||
"resource_id": "SIMULATED12345",
|
||||
"ts": "2025-10-22T10:15:00-04:00",
|
||||
"note": "Simulated webhook write for testing"
|
||||
}
|
||||
2
modules/billing/data/webhook.log
Normal file
2
modules/billing/data/webhook.log
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[2025-10-22T15:15:01+02:00] HIT ip=::1 bytes=281
|
||||
[2025-10-22T15:15:02+02:00] VERIFY_FAIL http=200 status=FAILURE
|
||||
72
modules/billing/diag_remote.php
Normal file
72
modules/billing/diag_remote.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
// Remote diagnostic helper for GameServers.World (_website)
|
||||
// Upload this file to the remote server and open it in the browser to collect environment info.
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
echo "GSP _website remote diagnostic\n";
|
||||
echo "Date: " . date('c') . "\n\n";
|
||||
|
||||
// PHP info summary
|
||||
echo "PHP Version: " . PHP_VERSION . "\n";
|
||||
echo "Loaded extensions: " . implode(', ', get_loaded_extensions()) . "\n\n";
|
||||
|
||||
// Session settings
|
||||
echo "Session save path: " . (ini_get('session.save_path') ?: '(not set)') . "\n";
|
||||
echo "Session cookie params: " . json_encode(session_get_cookie_params()) . "\n";
|
||||
echo "Session status (before start): " . session_status() . "\n";
|
||||
|
||||
// Try to start a named session used by _website
|
||||
session_name('gameservers_website');
|
||||
@session_start();
|
||||
echo "Session status (after start): " . session_status() . "\n";
|
||||
echo "Session id: " . session_id() . "\n";
|
||||
echo "Session variables: \n" . print_r($_SESSION, true) . "\n";
|
||||
|
||||
// Check config file readability
|
||||
$cfg = __DIR__ . '/includes/config.inc.php';
|
||||
echo "Config file: " . $cfg . " exists=" . (file_exists($cfg) ? 'yes' : 'no') . " readable=" . (is_readable($cfg) ? 'yes' : 'no') . "\n";
|
||||
if (file_exists($cfg)) {
|
||||
echo "Config contents (first 200 chars):\n" . substr(file_get_contents($cfg),0,200) . "\n";
|
||||
}
|
||||
|
||||
// Attempt DB connection using site config (if readable)
|
||||
if (file_exists($cfg)) require_once($cfg);
|
||||
echo "Trying DB connection...\n";
|
||||
$ok = false;
|
||||
if (isset($db_host)) {
|
||||
$db = @mysqli_connect($db_host, $db_user, $db_pass, $db_name);
|
||||
if ($db) {
|
||||
echo "DB connect: OK (host=$db_host db=$db_name)\n";
|
||||
$ok = true;
|
||||
// run a small query
|
||||
$q = @mysqli_query($db, "SELECT COUNT(*) AS cnt FROM information_schema.tables WHERE table_schema = '".mysqli_real_escape_string($db,$db_name)."'");
|
||||
if ($q) {
|
||||
$r = mysqli_fetch_assoc($q);
|
||||
echo "Tables in DB: " . ($r['cnt'] ?? 'unknown') . "\n";
|
||||
}
|
||||
mysqli_close($db);
|
||||
} else {
|
||||
echo "DB connect: FAILED (mysqli_connect_error: " . mysqli_connect_error() . ")\n";
|
||||
}
|
||||
} else {
|
||||
echo "DB config not available to attempt connection.\n";
|
||||
}
|
||||
|
||||
// Check data and logs directories
|
||||
$data = realpath(__DIR__ . '/..') . DIRECTORY_SEPARATOR . 'data';
|
||||
$logs = __DIR__ . DIRECTORY_SEPARATOR . 'logs';
|
||||
echo "Site data dir: $data exists=" . (is_dir($data)?'yes':'no') . " writable=" . (is_writable($data)?'yes':'no') . "\n";
|
||||
echo "Site logs dir: $logs exists=" . (is_dir($logs)?'yes':'no') . " writable=" . (is_writable($logs)?'yes':'no') . "\n";
|
||||
|
||||
// Try creating test files
|
||||
if (is_dir($logs) && is_writable($logs)) {
|
||||
$fn = $logs . DIRECTORY_SEPARATOR . date('Y-m-d') . '.diag.txt';
|
||||
$w = @file_put_contents($fn, "diag " . date('c') . "\n", FILE_APPEND);
|
||||
echo "Wrote diag file to $fn result=" . ($w ? 'ok' : 'fail') . "\n";
|
||||
}
|
||||
|
||||
echo "\nSuggested next checks:\n";
|
||||
echo " - Confirm PHP can write session files to session.save_path and that cookies are sent to browser (use browser devtools).\n";
|
||||
echo " - Ensure the site path is served under the expected /_website/ path and that session cookie domain/path match the served path.\n";
|
||||
echo " - If sessions aren't persistent across requests, check webserver user permissions and session.save_path.\n";
|
||||
|
||||
?>
|
||||
107
modules/billing/docs/docs.php
Normal file
107
modules/billing/docs/docs.php
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<?php
|
||||
// docs.php — simple gallery to view or download your PDFs
|
||||
|
||||
$docs = [
|
||||
[
|
||||
'key' => 'sales',
|
||||
'title' => 'Sales & Onboarding Playbook',
|
||||
'desc' => 'Messaging, ICPs, demo flow, onboarding runbook, SLAs.',
|
||||
],
|
||||
[
|
||||
'key' => 'security',
|
||||
'title' => 'Security & Compliance Playbook',
|
||||
'desc' => 'Hygiene checklist, patching cadence, backups, incident response.',
|
||||
],
|
||||
[
|
||||
'key' => 'investor',
|
||||
'title' => 'Investor One-Pager',
|
||||
'desc' => 'Market, product, traction, roadmap, team, basic financials.',
|
||||
],
|
||||
];
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Playbooks</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<style>
|
||||
:root { --bg:#0f172a; --card:#111827; --ink:#e5e7eb; --ink-dim:#9ca3af; --accent:#22d3ee; }
|
||||
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial}
|
||||
.wrap{max-width:1100px;margin:40px auto;padding:0 16px}
|
||||
h1{font-size:28px;margin:0 0 18px}
|
||||
p.lead{color:var(--ink-dim);margin:0 0 26px}
|
||||
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px}
|
||||
.card{background:var(--card);border:1px solid #1f2937;border-radius:14px;padding:16px}
|
||||
.card h3{margin:0 0 6px;font-size:18px}
|
||||
.card p{margin:0 0 12px;color:var(--ink-dim)}
|
||||
.btns{display:flex;gap:8px;flex-wrap:wrap}
|
||||
.btn{appearance:none;border:1px solid #334155;border-radius:10px;padding:9px 12px;cursor:pointer;background:#0b1220;color:var(--ink);}
|
||||
.btn:hover{border-color:var(--accent)}
|
||||
.viewer{margin-top:12px;display:none}
|
||||
.viewer iframe{width:100%;height:680px;border:1px solid #1f2937;border-radius:12px;background:#0b1220}
|
||||
.footer{margin:36px 0 12px;color:var(--ink-dim);font-size:14px}
|
||||
a{color:var(--accent);text-decoration:none} a:hover{text-decoration:underline}
|
||||
.embed-snippet{margin-top:32px;background:#0b1220;border:1px solid #1f2937;border-radius:12px;padding:14px;color:#cbd5e1;overflow:auto}
|
||||
code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<h1>Playbooks</h1>
|
||||
<p class="lead">View inline or download. You can also copy an embed snippet for any page on your site.</p>
|
||||
|
||||
<div class="grid">
|
||||
<?php foreach ($docs as $doc):
|
||||
$key = htmlspecialchars($doc['key'], ENT_QUOTES, 'UTF-8');
|
||||
$title = htmlspecialchars($doc['title'], ENT_QUOTES, 'UTF-8');
|
||||
$desc = htmlspecialchars($doc['desc'], ENT_QUOTES, 'UTF-8');
|
||||
$viewerId = "viewer-" . $key;
|
||||
$src = "serve.php?doc=" . rawurlencode($key); // inline by default
|
||||
$dl = "serve.php?doc=" . rawurlencode($key) . "&download=1";
|
||||
?>
|
||||
<div class="card" id="card-<?= $key ?>">
|
||||
<h3><?= $title ?></h3>
|
||||
<p><?= $desc ?></p>
|
||||
<div class="btns">
|
||||
<button class="btn" onclick="toggleViewer('<?= $viewerId ?>','<?= $src ?>')">View inline</button>
|
||||
<a class="btn" href="<?= $dl ?>">Download</a>
|
||||
<button class="btn" onclick="copyEmbed('<?= htmlspecialchars('<iframe src=\"' . $src . '\" width=\"100%\" height=\"720\" style=\"border:1px solid #ddd;border-radius:12px\"></iframe>') ?>')">Copy embed</button>
|
||||
</div>
|
||||
<div class="viewer" id="<?= $viewerId ?>">
|
||||
<iframe loading="lazy" title="<?= $title ?>"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div class="embed-snippet">
|
||||
<strong>Generic embed snippet (replace <code>doc=</code> value):</strong>
|
||||
<pre><code><iframe src="/serve.php?doc=sales" width="100%" height="720" class="doc-iframe"></iframe></code></pre>
|
||||
</div>
|
||||
|
||||
<p class="footer">Tip: You can place <code>serve.php</code> and <code>docs.php</code> anywhere; just keep the whitelist in <code>serve.php</code> updated to match your files.</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleViewer(id, src){
|
||||
const el = document.getElementById(id);
|
||||
const frame = el.querySelector('iframe');
|
||||
if (el.style.display === 'block') { el.style.display = 'none'; return; }
|
||||
if (!frame.getAttribute('src')) frame.setAttribute('src', src);
|
||||
el.style.display = 'block';
|
||||
el.scrollIntoView({behavior:'smooth', block:'start'});
|
||||
}
|
||||
|
||||
async function copyEmbed(html){
|
||||
try {
|
||||
await navigator.clipboard.writeText(html.replace(/"/g,'"'));
|
||||
alert('Embed code copied to clipboard!');
|
||||
} catch(e) {
|
||||
prompt('Copy embed HTML:', html.replace(/"/g,'"'));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
107
modules/billing/docs/games/7-days-to-die.md
Normal file
107
modules/billing/docs/games/7-days-to-die.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# 7 Days to Die — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
7DaysToDieServer.exe -configfile=serverconfig.xml -quit -batchmode -nographics -dedicated
|
||||
```
|
||||
|
||||
**Parameters (exhaustive, server-relevant only)**
|
||||
- `-configfile=<file>` — Server configuration XML file.
|
||||
- `-quit` — Quit after completing operations.
|
||||
- `-batchmode` — Run in batch mode without GUI.
|
||||
- `-nographics` — Disable graphics rendering.
|
||||
- `-dedicated` — Run as dedicated server.
|
||||
- `-logfile <path>` — Log file location.
|
||||
- `-UserDataFolder=<path>` — User data directory.
|
||||
- `-SaveGameFolder=<path>` — Save game directory.
|
||||
- `-configfile=<path>` — Configuration file path.
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **26900** (primary)
|
||||
- Steam Query: UDP **26901** (game port + 1)
|
||||
- Web Control Panel: TCP **8080** (if enabled)
|
||||
- Telnet: TCP **8081** (if enabled)
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `Data/` — Game data directory
|
||||
- `Logs/` — Log files directory
|
||||
- `ServerConfig/` — Configuration files (varies by game)
|
||||
|
||||
**Linux:**
|
||||
- `~/7-days-to-die/Data/` — Game data directory
|
||||
- `~/7-days-to-die/Logs/` — Log files directory
|
||||
- `~/7-days-to-die/ServerConfig/` — Configuration files
|
||||
|
||||
**Key Files:**
|
||||
- Configuration file names and locations vary significantly between Unity games
|
||||
- Common patterns: server.cfg, config.json, settings.xml
|
||||
- Check game-specific documentation for exact file locations
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for 7 Days to Die
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
1994
modules/billing/docs/games/Parsedown.php
Normal file
1994
modules/billing/docs/games/Parsedown.php
Normal file
File diff suppressed because it is too large
Load diff
50
modules/billing/docs/games/_TEMPLATE.MD
Normal file
50
modules/billing/docs/games/_TEMPLATE.MD
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# <Game Name> — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
<Path/Executable> <all required flags here> # exact for this game, not generic
|
||||
|
||||
**Parameters (exhaustive, server-relevant only)**
|
||||
- `-flagA=<value>` — What it does. Default: `<default>`. Notes / constraints.
|
||||
- `-flagB` — …
|
||||
- (List every valid server flag, 10–40+ as applicable. Include networking, logging, perf, mod-loading, VAC/BE/EAC, RCON, headless clients, etc.)
|
||||
|
||||
**Ports**
|
||||
- Game UDP: **P** (assigned)
|
||||
- Query/Steam sockets/etc: **P+1**, **P+2**, …
|
||||
- RCON / BE / SourceTV / etc: exact numbers or relative math
|
||||
(Spell out all auxiliary ports, protocols, fixed vs relative.)
|
||||
|
||||
## Config Files & Locations
|
||||
- `<path>/server.cfg` — description
|
||||
- `<path>/basic.cfg` — …
|
||||
- `<path>/logs/*.log` — …
|
||||
- **Mods**: where mod files go, keys/signatures, load order files.
|
||||
- **Workshop cache** (if relevant).
|
||||
- Include common paths for Windows & Linux.
|
||||
|
||||
## Steam Workshop (if supported)
|
||||
- How to mount collections / API keys / start map IDs.
|
||||
- Where files cache on disk.
|
||||
- Any special caveats.
|
||||
|
||||
## Common Mods (curated)
|
||||
- **Mod A (e.g., AMX Mod X / ACE3 / Exile / RocketMod / Oxide / uMod / BepInEx / DarkRP / EssentialsX)**
|
||||
- What it’s for.
|
||||
- **Install**: exact folder paths, files to edit, any keys/signatures, load order.
|
||||
- **Configure**: main config files + common options.
|
||||
- (Repeat for each widely used mod for this game.)
|
||||
|
||||
## Database (if used)
|
||||
- Engine (e.g., **MySQL**, SQLite, PostgreSQL).
|
||||
- Connection file & keys to edit (e.g., `HiveExt.ini`, `database.json`, `config.yml`).
|
||||
- Schema notes, migrations, indexes, backup/restore steps.
|
||||
|
||||
## Administration & Scripting (if applicable)
|
||||
- RCON tools / admin plugins.
|
||||
- Backups, rotation, auto-update strategy.
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
- Symptom → likely cause → resolution, with file/flag names.
|
||||
- Include all common errors seen in forums/issue trackers for this game.
|
||||
- Networking, signature/anticheat, mod version mismatches, perf, crashes, persistence, etc.
|
||||
107
modules/billing/docs/games/abiotic-factor.md
Normal file
107
modules/billing/docs/games/abiotic-factor.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Abiotic Factor — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./abiotic-factor_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `abiotic-factor_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/abiotic-factor/server.cfg` — Main server configuration
|
||||
- `~/abiotic-factor/config/` — Configuration directory
|
||||
- `~/abiotic-factor/logs/` — Log files directory
|
||||
- `~/abiotic-factor/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Abiotic Factor
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/action-half-life.md
Normal file
107
modules/billing/docs/games/action-half-life.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Action Half-Life — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./action-half-life_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `action-half-life_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/action-half-life/server.cfg` — Main server configuration
|
||||
- `~/action-half-life/config/` — Configuration directory
|
||||
- `~/action-half-life/logs/` — Log files directory
|
||||
- `~/action-half-life/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Action Half-Life
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/action-source.md
Normal file
107
modules/billing/docs/games/action-source.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Action: Source — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./action-source_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `action-source_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/action-source/server.cfg` — Main server configuration
|
||||
- `~/action-source/config/` — Configuration directory
|
||||
- `~/action-source/logs/` — Log files directory
|
||||
- `~/action-source/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Action: Source
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/aliens-vs-predator.md
Normal file
107
modules/billing/docs/games/aliens-vs-predator.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Aliens vs Predator — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./aliens-vs-predator_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `aliens-vs-predator_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/aliens-vs-predator/server.cfg` — Main server configuration
|
||||
- `~/aliens-vs-predator/config/` — Configuration directory
|
||||
- `~/aliens-vs-predator/logs/` — Log files directory
|
||||
- `~/aliens-vs-predator/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Aliens vs Predator
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
210
modules/billing/docs/games/all_hostable_games_union.csv
Normal file
210
modules/billing/docs/games/all_hostable_games_union.csv
Normal file
|
|
@ -0,0 +1,210 @@
|
|||
Game,Sources
|
||||
7 Days to Die,"G-Portal, GameServers.com, LinuxGSM"
|
||||
ARK: Survival Ascended,Nitrado
|
||||
ARK: Survival Evolved,"G-Portal, LinuxGSM"
|
||||
ARMA 3,LinuxGSM
|
||||
Abiotic Factor,Nitrado
|
||||
Action Half-Life,LinuxGSM
|
||||
Action: Source,LinuxGSM
|
||||
Aliens vs Predator,OGP
|
||||
Aloft,"G-Portal, Nitrado"
|
||||
American Truck Simulator,"LinuxGSM, Nitrado"
|
||||
Arma 2,OGP
|
||||
Arma 2 Combined Operations,OGP
|
||||
Arma 2 Operation Arrowhead,OGP
|
||||
Arma 3,G-Portal
|
||||
Arma Reforger,"G-Portal, LinuxGSM"
|
||||
Assetto Corsa,LinuxGSM
|
||||
Assetto Corsa Competizione,G-Portal
|
||||
Astroneer,G-Portal
|
||||
Atlas,G-Portal
|
||||
Avorion,"G-Portal, LinuxGSM"
|
||||
BATTALION: Legacy,LinuxGSM
|
||||
Ballistic Overkill,LinuxGSM
|
||||
Barotrauma,"G-Portal, LinuxGSM"
|
||||
Base Defense,LinuxGSM
|
||||
Battlefield 1942,LinuxGSM
|
||||
Battlefield 3,G-Portal
|
||||
Battlefield 4,"G-Portal, GameServers.com"
|
||||
Battlefield: Vietnam,LinuxGSM
|
||||
Black Mesa: Deathmatch,LinuxGSM
|
||||
Blade Symphony,LinuxGSM
|
||||
BrainBread 2,LinuxGSM
|
||||
Brainbread,LinuxGSM
|
||||
Call of Duty,LinuxGSM
|
||||
Call of Duty 2,LinuxGSM
|
||||
Call of Duty 4,LinuxGSM
|
||||
Call of Duty: United Offensive,LinuxGSM
|
||||
Call of Duty: World at War,LinuxGSM
|
||||
Chivalry: Medieval Warfare,LinuxGSM
|
||||
Citadel - Forged with fire,G-Portal
|
||||
Codename CURE,LinuxGSM
|
||||
Colony Survival,LinuxGSM
|
||||
Conan Exiles,G-Portal
|
||||
Core Keeper,"G-Portal, LinuxGSM"
|
||||
Counter-Strike,"G-Portal, LinuxGSM"
|
||||
Counter-Strike 2,"G-Portal, GameServers.com, LinuxGSM"
|
||||
Counter-Strike: Condition Zero,LinuxGSM
|
||||
Counter-Strike: Global Offensive,LinuxGSM
|
||||
Counter-Strike: Source,"GameServers.com, LinuxGSM"
|
||||
Craftopia,"G-Portal, LinuxGSM"
|
||||
CryoFall,G-Portal
|
||||
Day of Defeat,LinuxGSM
|
||||
Day of Defeat: Source,LinuxGSM
|
||||
Day of Dragons,"G-Portal, LinuxGSM"
|
||||
Day of Infamy,LinuxGSM
|
||||
DayZ,LinuxGSM
|
||||
DayZ Mod for Arma2CO ,OGP
|
||||
Dead Matter,G-Portal
|
||||
Deadside,G-Portal
|
||||
Deadside (Console),G-Portal
|
||||
Deathmatch Classic,LinuxGSM
|
||||
Don't Starve Together,"G-Portal, LinuxGSM"
|
||||
Double Action: Boogaloo,LinuxGSM
|
||||
Dune: Awakening,G-Portal
|
||||
Dystopia,LinuxGSM
|
||||
ET: Legacy,LinuxGSM
|
||||
Eco,"G-Portal, LinuxGSM"
|
||||
Empires Mod,LinuxGSM
|
||||
Empyrion: Galactic Survival,G-Portal
|
||||
Enshrouded,G-Portal
|
||||
Euro Truck Simulator 2,LinuxGSM
|
||||
Euro Truck Simulator 2 / American Truck Simulator,G-Portal
|
||||
Factorio,"G-Portal, LinuxGSM"
|
||||
Farming Simulator,G-Portal
|
||||
Farming Simulator 2019,GameServers.com
|
||||
Farming Simulator 2022,GameServers.com
|
||||
Farming Simulator 2025,GameServers.com
|
||||
Farming Simulator 25,G-Portal
|
||||
Fistful of Frags,LinuxGSM
|
||||
FiveM,G-Portal
|
||||
Garry's Mod,G-Portal
|
||||
Garry’s Mod,LinuxGSM
|
||||
Ground Branch,G-Portal
|
||||
HEAT,G-Portal
|
||||
HYPERCHARGE: Unboxed,LinuxGSM
|
||||
Half-Life 2: Deathmatch,LinuxGSM
|
||||
Half-Life Deathmatch: Source,LinuxGSM
|
||||
Half-Life: Deathmatch,LinuxGSM
|
||||
Hell Let Loose,G-Portal
|
||||
Humanitz,LinuxGSM
|
||||
Hurtworld,"G-Portal, LinuxGSM"
|
||||
IOSoccer,LinuxGSM
|
||||
Icarus,G-Portal
|
||||
Insurgency,LinuxGSM
|
||||
Insurgency Sandstorm,G-Portal
|
||||
Insurgency: Sandstorm,LinuxGSM
|
||||
Jedi Knight II: Jedi Outcast,LinuxGSM
|
||||
Just Cause 2,LinuxGSM
|
||||
Just Cause 3,LinuxGSM
|
||||
Killing Floor,LinuxGSM
|
||||
Killing Floor 2,"G-Portal, LinuxGSM"
|
||||
LEAP,G-Portal
|
||||
Last Oasis,G-Portal
|
||||
Left 4 Dead,LinuxGSM
|
||||
Left 4 Dead 2,LinuxGSM
|
||||
Life is Feudal,G-Portal
|
||||
Longvinter,G-Portal
|
||||
Medal of Honor: Allied Assault,LinuxGSM
|
||||
Memories of Mars,LinuxGSM
|
||||
Minecraft,"G-Portal, GameServers.com"
|
||||
Minecraft: Bedrock Edition,LinuxGSM
|
||||
Minecraft: Java Edition,LinuxGSM
|
||||
Mordhau,"G-Portal, LinuxGSM"
|
||||
Multi Theft Auto,LinuxGSM
|
||||
Mumble,LinuxGSM
|
||||
Myth of Empires,Nitrado
|
||||
NS2: Combat,LinuxGSM
|
||||
Natural Selection,LinuxGSM
|
||||
Natural Selection 2,LinuxGSM
|
||||
Necesse,LinuxGSM
|
||||
No More Room in Hell,LinuxGSM
|
||||
Nuclear Dawn,LinuxGSM
|
||||
Onset,LinuxGSM
|
||||
Operation: Harsh Doorstop,LinuxGSM
|
||||
Opposing Force,LinuxGSM
|
||||
Outlaws of the Old West,G-Portal
|
||||
Outpost Zero,Nitrado
|
||||
Palworld,"G-Portal, LinuxGSM"
|
||||
Palworld Xbox,Nitrado
|
||||
PaperMC,LinuxGSM
|
||||
Path of Titans,"G-Portal, Nitrado"
|
||||
Pavlov VR,"G-Portal, LinuxGSM"
|
||||
"Pirates, Vikings, & Knights II",LinuxGSM
|
||||
PixARK,Nitrado
|
||||
Project CARS 2,LinuxGSM
|
||||
Project Cars,LinuxGSM
|
||||
Project Zomboid,"G-Portal, GameServers.com, LinuxGSM"
|
||||
Quake 2,LinuxGSM
|
||||
Quake 3: Arena,LinuxGSM
|
||||
Quake 4,LinuxGSM
|
||||
Quake Live,LinuxGSM
|
||||
Quake World,LinuxGSM
|
||||
Red Orchestra: Ostfront 41-45,LinuxGSM
|
||||
RedM,G-Portal
|
||||
Reign of Kings,G-Portal
|
||||
Rem Survival,G-Portal
|
||||
Return to Castle Wolfenstein,LinuxGSM
|
||||
Ricochet,LinuxGSM
|
||||
Rising World,LinuxGSM
|
||||
Risk of Rain 2,Nitrado
|
||||
Rust,"G-Portal, GameServers.com, LinuxGSM"
|
||||
SCP: Secret Laboratory,"LinuxGSM, Nitrado"
|
||||
SCP: Secret Laboratory ServerMod,LinuxGSM
|
||||
SCUM,Nitrado
|
||||
San Andreas Multiplayer,LinuxGSM
|
||||
Satisfactory,"G-Portal, LinuxGSM"
|
||||
Scum,G-Portal
|
||||
Skyrim Together Reborn Mod,G-Portal
|
||||
Soldat,LinuxGSM
|
||||
Soldier of Fortune 2: Double Helix Gold,LinuxGSM
|
||||
Sons Of The Forest,Nitrado
|
||||
Sons of the Forest,G-Portal
|
||||
Soulmask,"G-Portal, LinuxGSM"
|
||||
Source Forts Classic,LinuxGSM
|
||||
Space Engineers,"G-Portal, Nitrado"
|
||||
Squad,"G-Portal, LinuxGSM"
|
||||
Squad 44,LinuxGSM
|
||||
Starbound,"G-Portal, LinuxGSM"
|
||||
Stationeers,LinuxGSM
|
||||
Staxel,G-Portal
|
||||
StickyBots,LinuxGSM
|
||||
Subsistence,"G-Portal, Nitrado"
|
||||
Survive the Nights,LinuxGSM
|
||||
Sven Co-op,LinuxGSM
|
||||
Team Fortress 2,"LinuxGSM, Nitrado"
|
||||
Team Fortress Classic,LinuxGSM
|
||||
Teamspeak 3,"G-Portal, LinuxGSM"
|
||||
Tebex,G-Portal
|
||||
Teeworlds,LinuxGSM
|
||||
TerraTech Worlds,G-Portal
|
||||
Terraria,"G-Portal, LinuxGSM, Nitrado"
|
||||
The Forest,"G-Portal, Nitrado"
|
||||
The Front,LinuxGSM
|
||||
The Isle,"G-Portal, LinuxGSM, Nitrado"
|
||||
The Lord of the Rings: Return to Moria,"G-Portal, Nitrado"
|
||||
The Specialists,LinuxGSM
|
||||
Tinkertown,G-Portal
|
||||
Tower Unite,LinuxGSM
|
||||
Unreal Tournament,LinuxGSM
|
||||
Unreal Tournament 2004,LinuxGSM
|
||||
Unreal Tournament 3,LinuxGSM
|
||||
Unreal Tournament 99,LinuxGSM
|
||||
Unturned,"G-Portal, LinuxGSM, Nitrado"
|
||||
Urban Terror 4,OGP
|
||||
V Rising,G-Portal
|
||||
Valheim,"G-Portal, GameServers.com, LinuxGSM"
|
||||
Vampire Slayer,LinuxGSM
|
||||
Velocity Proxy,LinuxGSM
|
||||
Vintage Story,"G-Portal, LinuxGSM"
|
||||
Warfork,LinuxGSM
|
||||
Warsow,OGP
|
||||
WaterfallMC,LinuxGSM
|
||||
Wolfenstein: Enemy Territory,LinuxGSM
|
||||
World Titans War,G-Portal
|
||||
Wreckfest,G-Portal
|
||||
Wreckfest 2,G-Portal
|
||||
Wurm Unlimited,LinuxGSM
|
||||
Xonotic,LinuxGSM
|
||||
Zombie Master: Reborn,LinuxGSM
|
||||
Zombie Panic! Source,LinuxGSM
|
||||
|
107
modules/billing/docs/games/aloft.md
Normal file
107
modules/billing/docs/games/aloft.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Aloft — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./aloft_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `aloft_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/aloft/server.cfg` — Main server configuration
|
||||
- `~/aloft/config/` — Configuration directory
|
||||
- `~/aloft/logs/` — Log files directory
|
||||
- `~/aloft/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Aloft
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/american-truck-simulator.md
Normal file
107
modules/billing/docs/games/american-truck-simulator.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# American Truck Simulator — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./american-truck-simulator_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `american-truck-simulator_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/american-truck-simulator/server.cfg` — Main server configuration
|
||||
- `~/american-truck-simulator/config/` — Configuration directory
|
||||
- `~/american-truck-simulator/logs/` — Log files directory
|
||||
- `~/american-truck-simulator/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for American Truck Simulator
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
150
modules/billing/docs/games/ark-survival-ascended.md
Normal file
150
modules/billing/docs/games/ark-survival-ascended.md
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
# ARK: Survival Ascended — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
ArkAscendedServer.exe TheIsland?listen?SessionName="My ARK Server"?ServerPassword=""?ServerAdminPassword="adminpass"?Port=7777?QueryPort=27015?MaxPlayers=70
|
||||
```
|
||||
|
||||
**Parameters (exhaustive, server-relevant only)**
|
||||
- Map name (TheIsland, Ragnarok, Extinction, etc.) — Starting map.
|
||||
- `?listen` — Enable server listening.
|
||||
- `?SessionName="<name>"` — Server name in browser.
|
||||
- `?ServerPassword="<pass>"` — Server password.
|
||||
- `?ServerAdminPassword="<pass>"` — Admin password.
|
||||
- `?Port=<port>` — Game port. Default: 7777.
|
||||
- `?QueryPort=<port>` — Query port. Default: 27015.
|
||||
- `?MaxPlayers=<num>` — Maximum players (1-200).
|
||||
- `?PVE=<true|false>` — PvE mode.
|
||||
- `?RCONEnabled=<true|false>` — Enable RCON.
|
||||
- `?RCONPort=<port>` — RCON port.
|
||||
- `?DifficultyOffset=<0.0-1.0>` — Difficulty level.
|
||||
- `?OverrideOfficialDifficulty=<1.0-10.0>` — Override difficulty.
|
||||
- `?TamingSpeedMultiplier=<1.0+>` — Taming speed.
|
||||
- `?XPMultiplier=<1.0+>` — Experience multiplier.
|
||||
- `?HarvestAmountMultiplier=<1.0+>` — Harvest amount.
|
||||
- `?AllowFlyerCarryPvE=<true|false>` — Allow flyer carry in PvE.
|
||||
- `?AlwaysAllowStructurePickup=<true|false>` — Allow structure pickup.
|
||||
- `?BattlEye=<true|false>` — Enable BattlEye anti-cheat.
|
||||
- `-log` — Enable logging.
|
||||
- `-NoHangDetection` — Disable hang detection.
|
||||
- `-UseDynamicConfig` — Use dynamic configuration.
|
||||
- `-ConfigSubDir=<dir>` — Config subdirectory.
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **7777** (primary)
|
||||
- Query: UDP **27015** (Steam query)
|
||||
- RCON: TCP **27020** (if enabled)
|
||||
- Raw UDP: UDP **7778** (game port + 1)
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `WindowsServer/ARK: Survival Ascended/Saved/Config/WindowsServer/` — Configuration directory
|
||||
- `WindowsServer/ARK: Survival Ascended/Saved/Logs/` — Log files
|
||||
- `WindowsServer/ARK: Survival Ascended/Saved/SaveGames/` — Save files
|
||||
|
||||
**Linux:**
|
||||
- `/home/ark-survival-ascended/Saved/Config/LinuxServer/` — Configuration directory
|
||||
- `/home/ark-survival-ascended/Saved/Logs/` — Log files
|
||||
- `/home/ark-survival-ascended/Saved/SaveGames/` — Save files
|
||||
|
||||
**Key Files:**
|
||||
- **GameUserSettings.ini**: Main server configuration
|
||||
- **Game.ini**: Advanced game settings
|
||||
- **Engine.ini**: Engine-specific settings
|
||||
|
||||
## Steam Workshop
|
||||
**Mod Installation:**
|
||||
1. Subscribe to mods via Steam Workshop or ARK server manager
|
||||
2. Add mod IDs to server startup parameters or GameUserSettings.ini
|
||||
3. Server downloads mods automatically on startup
|
||||
|
||||
**Configuration:**
|
||||
- Windows: `ShooterGame/Saved/Config/WindowsServer/GameUserSettings.ini`
|
||||
- Linux: `ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini`
|
||||
- Add line: `ActiveMods=mod_id_1,mod_id_2,mod_id_3`
|
||||
|
||||
**Mod Loading:**
|
||||
- Mods load in the order specified in ActiveMods
|
||||
- Some mods have dependencies that must load first
|
||||
- Server must restart after mod changes
|
||||
|
||||
**Cache Location:**
|
||||
- Windows: `steamapps/workshop/content/346110/`
|
||||
- Linux: `~/.steam/steamapps/workshop/content/346110/`
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for ARK: Survival Ascended
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
**Engine**: SQLite
|
||||
|
||||
**Configuration**:
|
||||
- Database settings typically in main server configuration file
|
||||
- Connection parameters: host, port, database name, credentials
|
||||
- Enable persistence features in server configuration
|
||||
|
||||
**Setup**:
|
||||
1. Install database engine if required
|
||||
2. Create database and user with appropriate permissions
|
||||
3. Configure connection settings in server config
|
||||
4. Test connection before starting server
|
||||
5. Set up automated backups
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
150
modules/billing/docs/games/ark-survival-evolved.md
Normal file
150
modules/billing/docs/games/ark-survival-evolved.md
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
# ARK: Survival Evolved — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
ShooterGameServer.exe TheIsland?listen?SessionName="My ARK Server"?ServerPassword=""?ServerAdminPassword="adminpass"?Port=7777?QueryPort=27015?MaxPlayers=70
|
||||
```
|
||||
|
||||
**Parameters (exhaustive, server-relevant only)**
|
||||
- Map name (TheIsland, Ragnarok, Extinction, etc.) — Starting map.
|
||||
- `?listen` — Enable server listening.
|
||||
- `?SessionName="<name>"` — Server name in browser.
|
||||
- `?ServerPassword="<pass>"` — Server password.
|
||||
- `?ServerAdminPassword="<pass>"` — Admin password.
|
||||
- `?Port=<port>` — Game port. Default: 7777.
|
||||
- `?QueryPort=<port>` — Query port. Default: 27015.
|
||||
- `?MaxPlayers=<num>` — Maximum players (1-200).
|
||||
- `?PVE=<true|false>` — PvE mode.
|
||||
- `?RCONEnabled=<true|false>` — Enable RCON.
|
||||
- `?RCONPort=<port>` — RCON port.
|
||||
- `?DifficultyOffset=<0.0-1.0>` — Difficulty level.
|
||||
- `?OverrideOfficialDifficulty=<1.0-10.0>` — Override difficulty.
|
||||
- `?TamingSpeedMultiplier=<1.0+>` — Taming speed.
|
||||
- `?XPMultiplier=<1.0+>` — Experience multiplier.
|
||||
- `?HarvestAmountMultiplier=<1.0+>` — Harvest amount.
|
||||
- `?AllowFlyerCarryPvE=<true|false>` — Allow flyer carry in PvE.
|
||||
- `?AlwaysAllowStructurePickup=<true|false>` — Allow structure pickup.
|
||||
- `?BattlEye=<true|false>` — Enable BattlEye anti-cheat.
|
||||
- `-log` — Enable logging.
|
||||
- `-NoHangDetection` — Disable hang detection.
|
||||
- `-UseDynamicConfig` — Use dynamic configuration.
|
||||
- `-ConfigSubDir=<dir>` — Config subdirectory.
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **7777** (primary)
|
||||
- Query: UDP **27015** (Steam query)
|
||||
- RCON: TCP **27020** (if enabled)
|
||||
- Raw UDP: UDP **7778** (game port + 1)
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `WindowsServer/ARK: Survival Evolved/Saved/Config/WindowsServer/` — Configuration directory
|
||||
- `WindowsServer/ARK: Survival Evolved/Saved/Logs/` — Log files
|
||||
- `WindowsServer/ARK: Survival Evolved/Saved/SaveGames/` — Save files
|
||||
|
||||
**Linux:**
|
||||
- `/home/ark-survival-evolved/Saved/Config/LinuxServer/` — Configuration directory
|
||||
- `/home/ark-survival-evolved/Saved/Logs/` — Log files
|
||||
- `/home/ark-survival-evolved/Saved/SaveGames/` — Save files
|
||||
|
||||
**Key Files:**
|
||||
- **GameUserSettings.ini**: Main server configuration
|
||||
- **Game.ini**: Advanced game settings
|
||||
- **Engine.ini**: Engine-specific settings
|
||||
|
||||
## Steam Workshop
|
||||
**Mod Installation:**
|
||||
1. Subscribe to mods via Steam Workshop or ARK server manager
|
||||
2. Add mod IDs to server startup parameters or GameUserSettings.ini
|
||||
3. Server downloads mods automatically on startup
|
||||
|
||||
**Configuration:**
|
||||
- Windows: `ShooterGame/Saved/Config/WindowsServer/GameUserSettings.ini`
|
||||
- Linux: `ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini`
|
||||
- Add line: `ActiveMods=mod_id_1,mod_id_2,mod_id_3`
|
||||
|
||||
**Mod Loading:**
|
||||
- Mods load in the order specified in ActiveMods
|
||||
- Some mods have dependencies that must load first
|
||||
- Server must restart after mod changes
|
||||
|
||||
**Cache Location:**
|
||||
- Windows: `steamapps/workshop/content/346110/`
|
||||
- Linux: `~/.steam/steamapps/workshop/content/346110/`
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for ARK: Survival Evolved
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
**Engine**: SQLite
|
||||
|
||||
**Configuration**:
|
||||
- Database settings typically in main server configuration file
|
||||
- Connection parameters: host, port, database name, credentials
|
||||
- Enable persistence features in server configuration
|
||||
|
||||
**Setup**:
|
||||
1. Install database engine if required
|
||||
2. Create database and user with appropriate permissions
|
||||
3. Configure connection settings in server config
|
||||
4. Test connection before starting server
|
||||
5. Set up automated backups
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
111
modules/billing/docs/games/arma-2-combined-operations.md
Normal file
111
modules/billing/docs/games/arma-2-combined-operations.md
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
# Arma 2 Combined Operations — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./arma-2-combined-operations_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `arma-2-combined-operations_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/arma-2-combined-operations/server.cfg` — Main server configuration
|
||||
- `~/arma-2-combined-operations/config/` — Configuration directory
|
||||
- `~/arma-2-combined-operations/logs/` — Log files directory
|
||||
- `~/arma-2-combined-operations/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Arma 2 Combined Operations
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**"Bad module info" / Addon errors**
|
||||
- **Cause**: Corrupted mod files or version mismatches
|
||||
- **Fix**: Verify mod integrity, ensure client-server version matching, check signature verification
|
||||
|
||||
**"Session lost" during gameplay**
|
||||
- **Cause**: Network issues or memory problems
|
||||
- **Fix**: Optimize basic.cfg network settings, increase server memory allocation, check mod conflicts
|
||||
|
||||
**High memory usage / Server crashes**
|
||||
- **Cause**: Memory leaks from scripts or excessive mod usage
|
||||
- **Fix**: Restart server regularly, optimize mission scripts, reduce active mod count
|
||||
|
||||
**BattlEye script restriction kicks**
|
||||
- **Cause**: Scripts triggering BE filters
|
||||
- **Fix**: Update BattlEye filters for installed mods, configure proper exceptions
|
||||
|
||||
**Signature verification failed**
|
||||
- **Cause**: Missing or mismatched .bikey files
|
||||
- **Fix**: Ensure all mod .bikey files present in keys/ directory, verify verifySignatures setting
|
||||
|
||||
**Performance issues / Low FPS**
|
||||
- **Cause**: Complex missions, AI overload, or insufficient server resources
|
||||
- **Fix**: Optimize mission complexity, reduce AI count, upgrade server hardware, tune basic.cfg
|
||||
118
modules/billing/docs/games/arma-2-operation-arrowhead.md
Normal file
118
modules/billing/docs/games/arma-2-operation-arrowhead.md
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
# Arma 2 Operation Arrowhead — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
arma2oaserver.exe -port=2302 -config=server.cfg -cfg=basic.cfg -profiles=ServerProfile -mod=@mod1;@mod2
|
||||
```
|
||||
|
||||
**Parameters (exhaustive, server-relevant only)**
|
||||
- `-port=<port>` — Server port. Default: 2302.
|
||||
- `-config=<file>` — Server config file (server.cfg).
|
||||
- `-cfg=<file>` — Basic config file (basic.cfg).
|
||||
- `-profiles=<dir>` — Profile directory.
|
||||
- `-mod=<mods>` — Mod folders (semicolon separated).
|
||||
- `-serverMod=<mods>` — Server-side only mods.
|
||||
- `-name=<profilename>` — Server profile name.
|
||||
- `-world=<worldname>` — Empty world name.
|
||||
- `-noSound` — Disable sound processing.
|
||||
- `-nosplash` — Skip intro videos.
|
||||
- `-noPause` — Don't pause when not focused.
|
||||
- `-cpuCount=<num>` — CPU core count override.
|
||||
- `-maxMem=<mb>` — Maximum memory usage.
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **2302** (primary)
|
||||
- Query: UDP **2303** (game port + 1)
|
||||
- BattlEye: UDP **2344** (if enabled)
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `server.cfg` — Main server configuration
|
||||
- `basic.cfg` — Basic networking and performance settings
|
||||
- `ServerProfile/` — Profile directory with logs and user data
|
||||
- `MPMissions/` — Mission files directory
|
||||
- `keys/` — Signature keys for mod verification
|
||||
|
||||
**Linux:**
|
||||
- `~/arma/server.cfg` — Main server configuration
|
||||
- `~/arma/basic.cfg` — Basic networking settings
|
||||
- `~/arma/ServerProfile/` — Profile directory
|
||||
- `~/arma/MPMissions/` — Mission files
|
||||
- `~/arma/keys/` — Signature keys
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Server name, password, mission rotation, admin settings
|
||||
- **basic.cfg**: Network bandwidth and performance tuning
|
||||
- **Profile logs**: Server performance and error logs
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Arma 2 Operation Arrowhead
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**"Bad module info" / Addon errors**
|
||||
- **Cause**: Corrupted mod files or version mismatches
|
||||
- **Fix**: Verify mod integrity, ensure client-server version matching, check signature verification
|
||||
|
||||
**"Session lost" during gameplay**
|
||||
- **Cause**: Network issues or memory problems
|
||||
- **Fix**: Optimize basic.cfg network settings, increase server memory allocation, check mod conflicts
|
||||
|
||||
**High memory usage / Server crashes**
|
||||
- **Cause**: Memory leaks from scripts or excessive mod usage
|
||||
- **Fix**: Restart server regularly, optimize mission scripts, reduce active mod count
|
||||
|
||||
**BattlEye script restriction kicks**
|
||||
- **Cause**: Scripts triggering BE filters
|
||||
- **Fix**: Update BattlEye filters for installed mods, configure proper exceptions
|
||||
|
||||
**Signature verification failed**
|
||||
- **Cause**: Missing or mismatched .bikey files
|
||||
- **Fix**: Ensure all mod .bikey files present in keys/ directory, verify verifySignatures setting
|
||||
|
||||
**Performance issues / Low FPS**
|
||||
- **Cause**: Complex missions, AI overload, or insufficient server resources
|
||||
- **Fix**: Optimize mission complexity, reduce AI count, upgrade server hardware, tune basic.cfg
|
||||
118
modules/billing/docs/games/arma-2.md
Normal file
118
modules/billing/docs/games/arma-2.md
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
# Arma 2 — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
arma2oaserver.exe -port=2302 -config=server.cfg -cfg=basic.cfg -profiles=ServerProfile -mod=@mod1;@mod2
|
||||
```
|
||||
|
||||
**Parameters (exhaustive, server-relevant only)**
|
||||
- `-port=<port>` — Server port. Default: 2302.
|
||||
- `-config=<file>` — Server config file (server.cfg).
|
||||
- `-cfg=<file>` — Basic config file (basic.cfg).
|
||||
- `-profiles=<dir>` — Profile directory.
|
||||
- `-mod=<mods>` — Mod folders (semicolon separated).
|
||||
- `-serverMod=<mods>` — Server-side only mods.
|
||||
- `-name=<profilename>` — Server profile name.
|
||||
- `-world=<worldname>` — Empty world name.
|
||||
- `-noSound` — Disable sound processing.
|
||||
- `-nosplash` — Skip intro videos.
|
||||
- `-noPause` — Don't pause when not focused.
|
||||
- `-cpuCount=<num>` — CPU core count override.
|
||||
- `-maxMem=<mb>` — Maximum memory usage.
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **2302** (primary)
|
||||
- Query: UDP **2303** (game port + 1)
|
||||
- BattlEye: UDP **2344** (if enabled)
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `server.cfg` — Main server configuration
|
||||
- `basic.cfg` — Basic networking and performance settings
|
||||
- `ServerProfile/` — Profile directory with logs and user data
|
||||
- `MPMissions/` — Mission files directory
|
||||
- `keys/` — Signature keys for mod verification
|
||||
|
||||
**Linux:**
|
||||
- `~/arma/server.cfg` — Main server configuration
|
||||
- `~/arma/basic.cfg` — Basic networking settings
|
||||
- `~/arma/ServerProfile/` — Profile directory
|
||||
- `~/arma/MPMissions/` — Mission files
|
||||
- `~/arma/keys/` — Signature keys
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Server name, password, mission rotation, admin settings
|
||||
- **basic.cfg**: Network bandwidth and performance tuning
|
||||
- **Profile logs**: Server performance and error logs
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Arma 2
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**"Bad module info" / Addon errors**
|
||||
- **Cause**: Corrupted mod files or version mismatches
|
||||
- **Fix**: Verify mod integrity, ensure client-server version matching, check signature verification
|
||||
|
||||
**"Session lost" during gameplay**
|
||||
- **Cause**: Network issues or memory problems
|
||||
- **Fix**: Optimize basic.cfg network settings, increase server memory allocation, check mod conflicts
|
||||
|
||||
**High memory usage / Server crashes**
|
||||
- **Cause**: Memory leaks from scripts or excessive mod usage
|
||||
- **Fix**: Restart server regularly, optimize mission scripts, reduce active mod count
|
||||
|
||||
**BattlEye script restriction kicks**
|
||||
- **Cause**: Scripts triggering BE filters
|
||||
- **Fix**: Update BattlEye filters for installed mods, configure proper exceptions
|
||||
|
||||
**Signature verification failed**
|
||||
- **Cause**: Missing or mismatched .bikey files
|
||||
- **Fix**: Ensure all mod .bikey files present in keys/ directory, verify verifySignatures setting
|
||||
|
||||
**Performance issues / Low FPS**
|
||||
- **Cause**: Complex missions, AI overload, or insufficient server resources
|
||||
- **Fix**: Optimize mission complexity, reduce AI count, upgrade server hardware, tune basic.cfg
|
||||
145
modules/billing/docs/games/arma-3.md
Normal file
145
modules/billing/docs/games/arma-3.md
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
# Arma 3 — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
arma3server_x64.exe -port=2302 -config=server.cfg -cfg=basic.cfg -profiles=ServerProfile -name=server -serverMod=""
|
||||
```
|
||||
|
||||
**Parameters (exhaustive, server-relevant only)**
|
||||
- `-port=<port>` — Server port. Default: 2302.
|
||||
- `-config=<file>` — Server config file (server.cfg).
|
||||
- `-cfg=<file>` — Basic config file (basic.cfg).
|
||||
- `-profiles=<dir>` — Profile directory.
|
||||
- `-name=<profilename>` — Server profile name.
|
||||
- `-serverMod="<mods>"` — Server-side only mods (semicolon separated).
|
||||
- `-mod="<mods>"` — Client and server mods (semicolon separated).
|
||||
- `-world=<worldname>` — Empty world for headless client.
|
||||
- `-autoInit` — Auto-initialize mission.
|
||||
- `-loadMissionToMemory` — Load mission into memory.
|
||||
- `-noSound` — Disable sound.
|
||||
- `-enableHT` — Enable hyperthreading.
|
||||
- `-hugepages` — Enable huge pages (Linux).
|
||||
- `-malloc=<allocator>` — Memory allocator.
|
||||
- `-maxMem=<mb>` — Maximum memory.
|
||||
- `-cpuCount=<num>` — CPU core count.
|
||||
- `-exThreads=<num>` — Extra threads.
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **2302** (primary)
|
||||
- Steam Query: UDP **2303** (game port + 1)
|
||||
- BattlEye: UDP **2344** (game port + 42)
|
||||
- VON: UDP **2304** (game port + 2)
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `server.cfg` — Main server configuration
|
||||
- `basic.cfg` — Basic networking and performance settings
|
||||
- `ServerProfile/` — Profile directory with logs and user data
|
||||
- `MPMissions/` — Mission files directory
|
||||
- `keys/` — Signature keys for mod verification
|
||||
|
||||
**Linux:**
|
||||
- `~/arma/server.cfg` — Main server configuration
|
||||
- `~/arma/basic.cfg` — Basic networking settings
|
||||
- `~/arma/ServerProfile/` — Profile directory
|
||||
- `~/arma/MPMissions/` — Mission files
|
||||
- `~/arma/keys/` — Signature keys
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Server name, password, mission rotation, admin settings
|
||||
- **basic.cfg**: Network bandwidth and performance tuning
|
||||
- **Profile logs**: Server performance and error logs
|
||||
|
||||
## Steam Workshop
|
||||
**Mod Installation:**
|
||||
1. Subscribe to mods via Steam Workshop
|
||||
2. Add mod IDs to server startup: `-mod="@workshop_id_1;@workshop_id_2"`
|
||||
3. For server-only mods use: `-serverMod="@mod_folder"`
|
||||
|
||||
**Workshop Collection:**
|
||||
- Create Steam collection with all server mods
|
||||
- Use Arma 3 Server tools or community launchers for bulk downloading
|
||||
- Verify all clients have same mod versions
|
||||
|
||||
**Mod Loading:**
|
||||
- Order matters for some mods (CBA_A3 should load first)
|
||||
- Use proper folder structure: `@mod_name/addons/*.pbo`
|
||||
- Include signature files (.bisign) for key verification
|
||||
|
||||
**Cache Location:**
|
||||
- Windows: `steamapps/workshop/content/107410/`
|
||||
- Linux: `~/.steam/steamapps/workshop/content/107410/`
|
||||
|
||||
## Common Mods (curated)
|
||||
- **ACE3**
|
||||
- **Purpose**: Advanced Combat Environment - realistic medical, ballistics, and logistics.
|
||||
- **Install**: Subscribe via Workshop, add `@ace` to startup mods.
|
||||
- **Configure**: ACE settings via in-game addon options or mission parameters.
|
||||
|
||||
- **CBA_A3**
|
||||
- **Purpose**: Community Base Addons - framework required by most Arma 3 mods.
|
||||
- **Install**: Subscribe via Workshop, ensure loads before other mods.
|
||||
- **Configure**: No direct configuration - provides API for other mods.
|
||||
|
||||
- **TFAR (Task Force Radio)**
|
||||
- **Purpose**: Realistic radio communication system.
|
||||
- **Install**: Workshop subscription, requires TeamSpeak 3 plugin for clients.
|
||||
- **Configure**: Radio frequencies and settings in mission files.
|
||||
|
||||
- **RHS: Armed Forces**
|
||||
- **Purpose**: High-quality modern military units and equipment.
|
||||
- **Install**: Subscribe to RHS collections via Workshop.
|
||||
- **Configure**: Unit availability configured in mission editor.
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**"Bad module info" / Addon errors**
|
||||
- **Cause**: Corrupted mod files or version mismatches
|
||||
- **Fix**: Verify mod integrity, ensure client-server version matching, check signature verification
|
||||
|
||||
**"Session lost" during gameplay**
|
||||
- **Cause**: Network issues or memory problems
|
||||
- **Fix**: Optimize basic.cfg network settings, increase server memory allocation, check mod conflicts
|
||||
|
||||
**High memory usage / Server crashes**
|
||||
- **Cause**: Memory leaks from scripts or excessive mod usage
|
||||
- **Fix**: Restart server regularly, optimize mission scripts, reduce active mod count
|
||||
|
||||
**BattlEye script restriction kicks**
|
||||
- **Cause**: Scripts triggering BE filters
|
||||
- **Fix**: Update BattlEye filters for installed mods, configure proper exceptions
|
||||
|
||||
**Signature verification failed**
|
||||
- **Cause**: Missing or mismatched .bikey files
|
||||
- **Fix**: Ensure all mod .bikey files present in keys/ directory, verify verifySignatures setting
|
||||
|
||||
**Performance issues / Low FPS**
|
||||
- **Cause**: Complex missions, AI overload, or insufficient server resources
|
||||
- **Fix**: Optimize mission complexity, reduce AI count, upgrade server hardware, tune basic.cfg
|
||||
118
modules/billing/docs/games/arma-reforger.md
Normal file
118
modules/billing/docs/games/arma-reforger.md
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
# Arma Reforger — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
arma2oaserver.exe -port=2302 -config=server.cfg -cfg=basic.cfg -profiles=ServerProfile -mod=@mod1;@mod2
|
||||
```
|
||||
|
||||
**Parameters (exhaustive, server-relevant only)**
|
||||
- `-port=<port>` — Server port. Default: 2302.
|
||||
- `-config=<file>` — Server config file (server.cfg).
|
||||
- `-cfg=<file>` — Basic config file (basic.cfg).
|
||||
- `-profiles=<dir>` — Profile directory.
|
||||
- `-mod=<mods>` — Mod folders (semicolon separated).
|
||||
- `-serverMod=<mods>` — Server-side only mods.
|
||||
- `-name=<profilename>` — Server profile name.
|
||||
- `-world=<worldname>` — Empty world name.
|
||||
- `-noSound` — Disable sound processing.
|
||||
- `-nosplash` — Skip intro videos.
|
||||
- `-noPause` — Don't pause when not focused.
|
||||
- `-cpuCount=<num>` — CPU core count override.
|
||||
- `-maxMem=<mb>` — Maximum memory usage.
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **2302** (primary)
|
||||
- Query: UDP **2303** (game port + 1)
|
||||
- BattlEye: UDP **2344** (if enabled)
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `server.cfg` — Main server configuration
|
||||
- `basic.cfg` — Basic networking and performance settings
|
||||
- `ServerProfile/` — Profile directory with logs and user data
|
||||
- `MPMissions/` — Mission files directory
|
||||
- `keys/` — Signature keys for mod verification
|
||||
|
||||
**Linux:**
|
||||
- `~/arma/server.cfg` — Main server configuration
|
||||
- `~/arma/basic.cfg` — Basic networking settings
|
||||
- `~/arma/ServerProfile/` — Profile directory
|
||||
- `~/arma/MPMissions/` — Mission files
|
||||
- `~/arma/keys/` — Signature keys
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Server name, password, mission rotation, admin settings
|
||||
- **basic.cfg**: Network bandwidth and performance tuning
|
||||
- **Profile logs**: Server performance and error logs
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Arma Reforger
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**"Bad module info" / Addon errors**
|
||||
- **Cause**: Corrupted mod files or version mismatches
|
||||
- **Fix**: Verify mod integrity, ensure client-server version matching, check signature verification
|
||||
|
||||
**"Session lost" during gameplay**
|
||||
- **Cause**: Network issues or memory problems
|
||||
- **Fix**: Optimize basic.cfg network settings, increase server memory allocation, check mod conflicts
|
||||
|
||||
**High memory usage / Server crashes**
|
||||
- **Cause**: Memory leaks from scripts or excessive mod usage
|
||||
- **Fix**: Restart server regularly, optimize mission scripts, reduce active mod count
|
||||
|
||||
**BattlEye script restriction kicks**
|
||||
- **Cause**: Scripts triggering BE filters
|
||||
- **Fix**: Update BattlEye filters for installed mods, configure proper exceptions
|
||||
|
||||
**Signature verification failed**
|
||||
- **Cause**: Missing or mismatched .bikey files
|
||||
- **Fix**: Ensure all mod .bikey files present in keys/ directory, verify verifySignatures setting
|
||||
|
||||
**Performance issues / Low FPS**
|
||||
- **Cause**: Complex missions, AI overload, or insufficient server resources
|
||||
- **Fix**: Optimize mission complexity, reduce AI count, upgrade server hardware, tune basic.cfg
|
||||
107
modules/billing/docs/games/assetto-corsa-competizione.md
Normal file
107
modules/billing/docs/games/assetto-corsa-competizione.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Assetto Corsa Competizione — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./assetto-corsa-competizione_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `assetto-corsa-competizione_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/assetto-corsa-competizione/server.cfg` — Main server configuration
|
||||
- `~/assetto-corsa-competizione/config/` — Configuration directory
|
||||
- `~/assetto-corsa-competizione/logs/` — Log files directory
|
||||
- `~/assetto-corsa-competizione/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Assetto Corsa Competizione
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/assetto-corsa.md
Normal file
107
modules/billing/docs/games/assetto-corsa.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Assetto Corsa — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./assetto-corsa_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `assetto-corsa_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/assetto-corsa/server.cfg` — Main server configuration
|
||||
- `~/assetto-corsa/config/` — Configuration directory
|
||||
- `~/assetto-corsa/logs/` — Log files directory
|
||||
- `~/assetto-corsa/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Assetto Corsa
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/astroneer.md
Normal file
107
modules/billing/docs/games/astroneer.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Astroneer — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./astroneer_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `astroneer_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/astroneer/server.cfg` — Main server configuration
|
||||
- `~/astroneer/config/` — Configuration directory
|
||||
- `~/astroneer/logs/` — Log files directory
|
||||
- `~/astroneer/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Astroneer
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/atlas.md
Normal file
107
modules/billing/docs/games/atlas.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Atlas — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./atlas_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `atlas_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/atlas/server.cfg` — Main server configuration
|
||||
- `~/atlas/config/` — Configuration directory
|
||||
- `~/atlas/logs/` — Log files directory
|
||||
- `~/atlas/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Atlas
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/avorion.md
Normal file
107
modules/billing/docs/games/avorion.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Avorion — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./avorion_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `avorion_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/avorion/server.cfg` — Main server configuration
|
||||
- `~/avorion/config/` — Configuration directory
|
||||
- `~/avorion/logs/` — Log files directory
|
||||
- `~/avorion/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Avorion
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/ballistic-overkill.md
Normal file
107
modules/billing/docs/games/ballistic-overkill.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Ballistic Overkill — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./ballistic-overkill_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `ballistic-overkill_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/ballistic-overkill/server.cfg` — Main server configuration
|
||||
- `~/ballistic-overkill/config/` — Configuration directory
|
||||
- `~/ballistic-overkill/logs/` — Log files directory
|
||||
- `~/ballistic-overkill/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Ballistic Overkill
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/barotrauma.md
Normal file
107
modules/billing/docs/games/barotrauma.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Barotrauma — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./barotrauma_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `barotrauma_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/barotrauma/server.cfg` — Main server configuration
|
||||
- `~/barotrauma/config/` — Configuration directory
|
||||
- `~/barotrauma/logs/` — Log files directory
|
||||
- `~/barotrauma/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Barotrauma
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/base-defense.md
Normal file
107
modules/billing/docs/games/base-defense.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Base Defense — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./base-defense_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `base-defense_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/base-defense/server.cfg` — Main server configuration
|
||||
- `~/base-defense/config/` — Configuration directory
|
||||
- `~/base-defense/logs/` — Log files directory
|
||||
- `~/base-defense/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Base Defense
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/battalion-legacy.md
Normal file
107
modules/billing/docs/games/battalion-legacy.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# BATTALION: Legacy — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./battalion-legacy_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `battalion-legacy_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/battalion-legacy/server.cfg` — Main server configuration
|
||||
- `~/battalion-legacy/config/` — Configuration directory
|
||||
- `~/battalion-legacy/logs/` — Log files directory
|
||||
- `~/battalion-legacy/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for BATTALION: Legacy
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/battlefield-1942.md
Normal file
107
modules/billing/docs/games/battlefield-1942.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Battlefield 1942 — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./battlefield-1942_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `battlefield-1942_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/battlefield-1942/server.cfg` — Main server configuration
|
||||
- `~/battlefield-1942/config/` — Configuration directory
|
||||
- `~/battlefield-1942/logs/` — Log files directory
|
||||
- `~/battlefield-1942/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Battlefield 1942
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/battlefield-3.md
Normal file
107
modules/billing/docs/games/battlefield-3.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Battlefield 3 — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./battlefield-3_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `battlefield-3_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/battlefield-3/server.cfg` — Main server configuration
|
||||
- `~/battlefield-3/config/` — Configuration directory
|
||||
- `~/battlefield-3/logs/` — Log files directory
|
||||
- `~/battlefield-3/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Battlefield 3
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/battlefield-4.md
Normal file
107
modules/billing/docs/games/battlefield-4.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Battlefield 4 — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./battlefield-4_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `battlefield-4_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/battlefield-4/server.cfg` — Main server configuration
|
||||
- `~/battlefield-4/config/` — Configuration directory
|
||||
- `~/battlefield-4/logs/` — Log files directory
|
||||
- `~/battlefield-4/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Battlefield 4
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/battlefield-vietnam.md
Normal file
107
modules/billing/docs/games/battlefield-vietnam.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Battlefield: Vietnam — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./battlefield-vietnam_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `battlefield-vietnam_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/battlefield-vietnam/server.cfg` — Main server configuration
|
||||
- `~/battlefield-vietnam/config/` — Configuration directory
|
||||
- `~/battlefield-vietnam/logs/` — Log files directory
|
||||
- `~/battlefield-vietnam/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Battlefield: Vietnam
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/black-mesa-deathmatch.md
Normal file
107
modules/billing/docs/games/black-mesa-deathmatch.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Black Mesa: Deathmatch — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./black-mesa-deathmatch_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `black-mesa-deathmatch_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/black-mesa-deathmatch/server.cfg` — Main server configuration
|
||||
- `~/black-mesa-deathmatch/config/` — Configuration directory
|
||||
- `~/black-mesa-deathmatch/logs/` — Log files directory
|
||||
- `~/black-mesa-deathmatch/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Black Mesa: Deathmatch
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/blade-symphony.md
Normal file
107
modules/billing/docs/games/blade-symphony.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Blade Symphony — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./blade-symphony_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `blade-symphony_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/blade-symphony/server.cfg` — Main server configuration
|
||||
- `~/blade-symphony/config/` — Configuration directory
|
||||
- `~/blade-symphony/logs/` — Log files directory
|
||||
- `~/blade-symphony/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Blade Symphony
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/brainbread-2.md
Normal file
107
modules/billing/docs/games/brainbread-2.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# BrainBread 2 — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./brainbread-2_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `brainbread-2_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/brainbread-2/server.cfg` — Main server configuration
|
||||
- `~/brainbread-2/config/` — Configuration directory
|
||||
- `~/brainbread-2/logs/` — Log files directory
|
||||
- `~/brainbread-2/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for BrainBread 2
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/brainbread.md
Normal file
107
modules/billing/docs/games/brainbread.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Brainbread — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./brainbread_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `brainbread_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/brainbread/server.cfg` — Main server configuration
|
||||
- `~/brainbread/config/` — Configuration directory
|
||||
- `~/brainbread/logs/` — Log files directory
|
||||
- `~/brainbread/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Brainbread
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/call-of-duty-2.md
Normal file
107
modules/billing/docs/games/call-of-duty-2.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Call of Duty 2 — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./call-of-duty-2_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `call-of-duty-2_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/call-of-duty-2/server.cfg` — Main server configuration
|
||||
- `~/call-of-duty-2/config/` — Configuration directory
|
||||
- `~/call-of-duty-2/logs/` — Log files directory
|
||||
- `~/call-of-duty-2/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Call of Duty 2
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/call-of-duty-4.md
Normal file
107
modules/billing/docs/games/call-of-duty-4.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Call of Duty 4 — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./call-of-duty-4_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `call-of-duty-4_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/call-of-duty-4/server.cfg` — Main server configuration
|
||||
- `~/call-of-duty-4/config/` — Configuration directory
|
||||
- `~/call-of-duty-4/logs/` — Log files directory
|
||||
- `~/call-of-duty-4/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Call of Duty 4
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/call-of-duty-united-offensive.md
Normal file
107
modules/billing/docs/games/call-of-duty-united-offensive.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Call of Duty: United Offensive — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./call-of-duty-united-offensive_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `call-of-duty-united-offensive_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/call-of-duty-united-offensive/server.cfg` — Main server configuration
|
||||
- `~/call-of-duty-united-offensive/config/` — Configuration directory
|
||||
- `~/call-of-duty-united-offensive/logs/` — Log files directory
|
||||
- `~/call-of-duty-united-offensive/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Call of Duty: United Offensive
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/call-of-duty-world-at-war.md
Normal file
107
modules/billing/docs/games/call-of-duty-world-at-war.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Call of Duty: World at War — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./call-of-duty-world-at-war_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `call-of-duty-world-at-war_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/call-of-duty-world-at-war/server.cfg` — Main server configuration
|
||||
- `~/call-of-duty-world-at-war/config/` — Configuration directory
|
||||
- `~/call-of-duty-world-at-war/logs/` — Log files directory
|
||||
- `~/call-of-duty-world-at-war/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Call of Duty: World at War
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/call-of-duty.md
Normal file
107
modules/billing/docs/games/call-of-duty.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Call of Duty — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./call-of-duty_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `call-of-duty_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/call-of-duty/server.cfg` — Main server configuration
|
||||
- `~/call-of-duty/config/` — Configuration directory
|
||||
- `~/call-of-duty/logs/` — Log files directory
|
||||
- `~/call-of-duty/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Call of Duty
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/chivalry-medieval-warfare.md
Normal file
107
modules/billing/docs/games/chivalry-medieval-warfare.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Chivalry: Medieval Warfare — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./chivalry-medieval-warfare_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `chivalry-medieval-warfare_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/chivalry-medieval-warfare/server.cfg` — Main server configuration
|
||||
- `~/chivalry-medieval-warfare/config/` — Configuration directory
|
||||
- `~/chivalry-medieval-warfare/logs/` — Log files directory
|
||||
- `~/chivalry-medieval-warfare/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Chivalry: Medieval Warfare
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/citadel-forged-with-fire.md
Normal file
107
modules/billing/docs/games/citadel-forged-with-fire.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Citadel - Forged with fire — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./citadel-forged-with-fire_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `citadel-forged-with-fire_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/citadel-forged-with-fire/server.cfg` — Main server configuration
|
||||
- `~/citadel-forged-with-fire/config/` — Configuration directory
|
||||
- `~/citadel-forged-with-fire/logs/` — Log files directory
|
||||
- `~/citadel-forged-with-fire/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Citadel - Forged with fire
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
107
modules/billing/docs/games/codename-cure.md
Normal file
107
modules/billing/docs/games/codename-cure.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# Codename CURE — Complete Dedicated Server Guide
|
||||
|
||||
## Startup Parameters
|
||||
**Default command line**
|
||||
```bash
|
||||
./codename-cure_server -port 27015 -maxplayers 16 -config server.cfg
|
||||
```
|
||||
|
||||
**Parameters (common server flags)**
|
||||
- `-port <port>` — Server port (default varies by game)
|
||||
- `-maxplayers <num>` — Maximum player count
|
||||
- `-config <file>` — Configuration file to load
|
||||
- `-log` — Enable logging
|
||||
- `-console` — Enable console output
|
||||
- `-dedicated` — Run as dedicated server
|
||||
- `-name "<name>"` — Server name
|
||||
- `-password "<pass>"` — Server password
|
||||
|
||||
**Ports**
|
||||
- Game: UDP **27015** (typical default)
|
||||
- Query: UDP **27016** (game port + 1)
|
||||
- Admin/RCON: TCP **varies by game**
|
||||
|
||||
## Config Files & Locations
|
||||
**Windows:**
|
||||
- `codename-cure_server.cfg` — Main server configuration
|
||||
- `config/` — Configuration directory
|
||||
- `logs/` — Log files directory
|
||||
- `data/` — Server data and saves
|
||||
|
||||
**Linux:**
|
||||
- `~/codename-cure/server.cfg` — Main server configuration
|
||||
- `~/codename-cure/config/` — Configuration directory
|
||||
- `~/codename-cure/logs/` — Log files directory
|
||||
- `~/codename-cure/data/` — Server data and saves
|
||||
|
||||
**Key Files:**
|
||||
- **server.cfg**: Core server settings and game rules
|
||||
- **admins.cfg**: Administrator configuration (if applicable)
|
||||
- **banned.cfg**: Banned players list (if applicable)
|
||||
|
||||
## Steam Workshop
|
||||
Not supported by this game.
|
||||
|
||||
## Common Mods (curated)
|
||||
**Admin/Management Mods**
|
||||
- Check official mod repositories or community sites for Codename CURE
|
||||
- Look for server administration, anti-cheat, and quality-of-life mods
|
||||
- Install according to game's modding framework (if available)
|
||||
|
||||
**Popular Community Mods**
|
||||
- Search Steam Workshop (if supported) for highly-rated server mods
|
||||
- Check game's official forums and community sites for recommended mods
|
||||
- Verify mod compatibility with current server version
|
||||
|
||||
**Installation Notes**
|
||||
- Follow each mod's specific installation instructions
|
||||
- Some games require mod loading frameworks or special startup parameters
|
||||
- Test mods individually before combining multiple mods
|
||||
|
||||
## Database
|
||||
Not applicable - this game does not use a database for core functionality.
|
||||
|
||||
## Administration & Scripting
|
||||
**Remote Administration:**
|
||||
- RCON (Remote Console) access for server management
|
||||
- Web-based admin panels (game-specific or third-party)
|
||||
- In-game admin commands and permissions
|
||||
|
||||
**Backup Strategy:**
|
||||
- Automated daily backups of save files and configuration
|
||||
- Rotate backups (keep 7 daily, 4 weekly, 12 monthly)
|
||||
- Test backup restoration procedures regularly
|
||||
- Store backups in separate location/drive
|
||||
|
||||
**Auto-Update:**
|
||||
- Use SteamCMD for automatic server updates (Steam games)
|
||||
- Schedule updates during low-traffic periods
|
||||
- Backup before applying updates
|
||||
- Monitor for update announcements and patch notes
|
||||
|
||||
**Monitoring:**
|
||||
- Server performance monitoring (CPU, memory, network)
|
||||
- Player connection logs and statistics
|
||||
- Error log monitoring and alerting
|
||||
- Uptime tracking and availability reporting
|
||||
|
||||
## Troubleshooting (game-specific)
|
||||
**Server not starting**
|
||||
- **Cause**: Missing dependencies, incorrect configuration, or port conflicts
|
||||
- **Fix**: Check server logs, verify all required files are present, ensure ports are available
|
||||
|
||||
**Players cannot connect**
|
||||
- **Cause**: Firewall blocking server port or incorrect network configuration
|
||||
- **Fix**: Open required ports in firewall, verify server is binding to correct IP address
|
||||
|
||||
**Performance issues/lag**
|
||||
- **Cause**: Insufficient server resources or suboptimal configuration
|
||||
- **Fix**: Monitor CPU/memory usage, optimize server settings, reduce player/entity limits
|
||||
|
||||
**Configuration not loading**
|
||||
- **Cause**: Syntax errors in config files or incorrect file paths
|
||||
- **Fix**: Validate configuration file syntax, check file permissions, review server logs
|
||||
|
||||
**Mod/plugin conflicts**
|
||||
- **Cause**: Incompatible mods or plugin version mismatches
|
||||
- **Fix**: Test mods individually, update to compatible versions, check for known conflicts
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue