Version 1.0.1 of SPC Integration marks the most significant evolution of the plugin to date. More than a simple update, this version represents a complete reengineering of the entire platform, focusing on robustness, security, reliability, and user experience. Critical new features have been introduced, and every existing component has been enhanced.
Plugin (C++ Component)
Complete Architectural Reengineering
- From Monolithic to Modular: The codebase has been entirely refactored from a linear structure to a modern, object-oriented, and highly modular architecture. This enhances stability, simplifies maintenance, and paves the way for future expansions.
- New Core Components: The logic has been divided into classes and namespaces with unique responsibilities:
Manage_JSON: Dedicated manager for the configuration file.Hash: Persistent identity and security system for the server.Cleanup: Safe shutdown manager to prevent "ghost" data.Reserved: Crash recovery system for abruptly terminated sessions.Public_IP: Robust service for public IP verification and validation.Secret_Manager: New security layer for key and endpoint obfuscation.plugin_constants: A new header centralizing all project constants, improving organization.plugin_update: A new module to automatically check if the plugin is up to date.
Comprehensive Configuration System (config.json)
The configuration management has been completely redesigned. The plugin now exclusively uses a spc-integration/config.json file, discontinuing support for server.cfg. This change enabled the implementation of a much more powerful, reliable, and user-friendly system.
-
Configuration System Features:
- Automatic Creation and Repair: If the
config.jsonfile is not found, the plugin automatically creates it with a clear default structure and values. If the file is corrupted or malformed, it is also repaired with the default structure, ensuring the plugin can always start. - Deep and Detailed Validation: Validation now goes beyond simply checking for a key's existence. The system verifies the correct data type for each parameter (string, integer, boolean), the format (IP, URL), and whether mandatory fields have been changed from their default values, providing highly specific error logs for the user.
- Atomic Saving: To prevent file corruption during unexpected shutdowns, all writes to
config.jsonare performed "atomically" (writing to a temporary file first, which then replaces the original), ensuring file integrity. - Intelligent Connection Management: After successful initialization, the
connectionsection of the file is temporarily removed and stored internally, being restored during shutdown. This discourages manual changes to connection parameters that could cause inconsistencies during server operation.
- Automatic Creation and Repair: If the
-
New Structure with Sections:
- The
config.jsonfile is now organized into two logical sections for greater clarity:connection: Contains critical parameters for the plugin's internal operation and communication.public_information: Contains all information that will be publicly displayed in SPC applications.
- The
-
New Configuration Parameters:
- In the
connectionsection:ip: The IP address or hostname of your server (e.g., "192.168.1.10" or "myserver.com").port: The game port of your server (e.g., 7777).production_environment: A security setting (trueorfalse). Whentrue, the plugin enables strict validations (such as public IP verification) and authorizes data sending to the SPC system.
- In the
public_informationsection:logo: (Replaces the oldspc_integration_image) URL for the main server logo.banner: (New) URL for a banner or header image.website: (Replaces the oldweburl) URL for the server's official website.discord,youtube,instagram,facebook,tiktok: (New) Dedicated fields for the server's social media links.description: (New) A text field for the server's description.team: (New) An advanced parameter that allows defining team members via a JSON object, includingname,role, andprofile picturefor each member.
- In the
New Security and Reliability Features
- Automatic Update Checker (New): Added a checker that runs during plugin initialization. It queries the GitHub API to fetch the latest version. If the local version is outdated, a clear warning message is displayed in the console, and plugin loading is halted. This ensures administrators are always aware of the latest versions, encouraging the adoption of security improvements.
- Security and Identity (New Hash System): Added a secondary authentication system. On the first run, the plugin generates a local SHA-256 hash (
hash.hash), which is confirmed with the backend. This hash becomes mandatory for all future requests (update,delete), ensuring only the correct plugin instance can manage the server's data. - Fault Resilience (Cleanup and Recovery System):
- The plugin now intercepts server shutdown signals (SIGTERM, CTRL+C). Upon shutdown, it sends a
deleterequest to the backend, ensuring the server is removed from the list and preventing "ghost servers". - Introduced a recovery file (
reserved.recovery). If the plugin starts and finds this file, it assumes a crash occurred, executes a backend recovery protocol, and restores the local configuration.
- The plugin now intercepts server shutdown signals (SIGTERM, CTRL+C). Upon shutdown, it sends a
- Real-Time Functionality (Use of
ProcessTick): The plugin now performs tasks periodically:- Data Updates: Sends an
updaterequest every 5 minutes, keeping the server "online" in the SPC system and allowing public information updates without restarting the server. - Integrity Verification: Continuously checks the integrity of the
hash.hashandreserved.recoveryfiles, shutting down for safety if tampering is detected.
- Data Updates: Sends an
- Secrets and Obfuscation: API keys and backend endpoints are no longer plain text in the binary. They are now obfuscated at compile time using the Dralyxor library, significantly increasing security against reverse engineering.
Component Improvements
- Public IP Resolution: The IP detection system was replaced with a
Public_IPclass that queries multiple external services in parallel, determining the real public IP with high accuracy and validating the user's configuration. - URL Validator: The validator is now generic and can validate different content types. For general URLs (
website), it usesHEADrequests to efficiently check accessibility. - HTTP Client: Completely refactored to be a generic, reusable, and robust class, with an integrated retry mechanism to handle intermittent network failures.
- Logger: Now supports multiple log levels (Info, Warning, Error), dividers for clarity, and, most importantly, automatically saves all console messages to
spc-integration/logs.logto facilitate debugging.
Backend (PHP Component)
The server-side infrastructure was completely rewritten to be more scalable, secure, and performant.
- Architectural Reengineering: The backend is no longer a single script and is now a modular object-oriented application, with dedicated classes for each function (file management, validation, rate limiting, etc.).
- Centralized Storage Model: The system of one JSON file per server was replaced by a single master file (
integration_list.json) that stores all servers. This drastically optimizes read/write operations and enables global functionality implementation. - Enhanced Security and Reliability:
- Rate Limiting: A rate-limiting system was implemented to prevent brute force and DoS (Denial of Service) attacks.
- Secure File Operations: All writes to the master data file now use file locks (
flock) to prevent race conditions and data corruption. The writing process is atomic. - Backup and Restoration: Before each modification, a backup of the data file is created. In case of failure, the backend automatically restores the backup, ensuring 100% data integrity.
- Business Logic and Management:
- New Server Lifecycle: The backend logic was updated to support the plugin's new handshake:
create->confirm_hash->update/delete, with hash verification at all secure stages. - Automatic Offline Server Cleanup: A system was added that scans the server list with each request and automatically removes any server that hasn’t sent an update in over 10 minutes.
- New Server Lifecycle: The backend logic was updated to support the plugin's new handshake:
Build Environment (Linux)
The build environment was modernized to ensure maximum portability and a better developer experience.
- Maximum Portability: Static OpenSSL Linking: This is the most critical change. The Docker environment no longer depends on the user’s system-installed OpenSSL. It now downloads the OpenSSL 1.1.1w source code and compiles it as a static library (
.a), which is then embedded directly into thespc-integration.sobinary. This completely eliminates external dependency issues and ensures the plugin works on any standard Linux distribution (32-bit) without additional user configuration. - Toolchain Modernization and Automation:
- The compiler was upgraded from GCC 8 to GCC 9.
- The
CMakeLists.txtwas improved to automatically discover sources and use OpenSSL static libraries. - The
build.shscript was completely rewritten to provide much clearer, colorful, and informative terminal output, guiding the user through each step of the build process.
Full comparison: v1.0.0...v1.0.1