Rollback OS auto-selection; provision exact selected XML/service#147
Merged
iaretechnician merged 1 commit intoPanel-unstablefrom May 9, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/3df8435d-6b14-494a-b81e-ca5ca02f3332 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
iaretechnician
May 9, 2026 16:10
View session
There was a problem hiding this comment.
Pull request overview
This PR adjusts the billing storefront + provisioning flow to stop collapsing Linux/Windows “canonical” variants and to provision the exact selected billing_services row, while adding OS-vs-node compatibility checks and improving provisioning/install-state messaging.
Changes:
- Removed OS auto-switching/canonical dedupe so checkout/provisioning preserve the selected
service_id/ XML variant. - Added OS compatibility enforcement in
order.php,add_to_cart.php, andcreate_servers.php(with additional provisioning context logging). - Modernized
view_server_log.phpencoding handling for PHP 8.3 by replacing deprecatedutf8_encode()usage.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/gamemanager/view_server_log.php | Replaces deprecated utf8_encode() with mbstring/iconv-based UTF-8 normalization. |
| modules/billing/timestamp.txt | Updates storefront footer “Last Updated” timestamp. |
| modules/billing/serverlist.php | Stops canonical dedupe; shows one purchasable row per enabled service and adds OS variant label display. |
| modules/billing/order.php | Removes OS-driven service remapping; filters locations by detected service OS and surfaces user-facing errors. |
| modules/billing/create_servers.php | Re-validates OS compatibility during provisioning; logs selected service_id/home_cfg_id/XML; improves install-state messaging. |
| modules/billing/adminserverlist.php | UI/CSS tweak to reduce “Available Servers” column dominance. |
| modules/billing/add_to_cart.php | Adds server/location allowlist + OS compatibility validation before creating invoices; improved redirects with error messaging. |
| docs/COPILOT_TODO.md | Adds a follow-up item for showing an OS-variant badge in the admin/serverlist UI. |
| CHANGELOG.md | Documents the OS-variant rollback, compatibility enforcement, logging improvements, and UTF-8 change. |
Comment on lines
+37
to
+40
| if (preg_match('/(?:^|[_\-])(win|windows)(?:[_\-]|$)/i', $haystack)) { | ||
| return 'Windows'; | ||
| } | ||
| if (preg_match('/(?:^|[_\-])linux(?:[_\-]|$)/i', $haystack)) { |
Comment on lines
+116
to
120
| if (preg_match('/(?:^|[_\\-])(win|windows)(?:[_\\-]|$)/i', $haystack)) { | ||
| return 'windows'; | ||
| } | ||
| if (str_contains($lk, '_linux')) { | ||
| if (preg_match('/(?:^|[_\\-])linux(?:[_\\-]|$)/i', $haystack)) { | ||
| return 'linux'; |
Comment on lines
+80
to
+83
| if (preg_match('/(?:^|[_\\-])(win|windows)(?:[_\\-]|$)/i', $haystack)) { | ||
| return 'windows'; | ||
| } | ||
| if (preg_match('/(?:^|[_\\-])linux(?:[_\\-]|$)/i', $haystack)) { |
Comment on lines
+302
to
+305
| if (preg_match('/(?:^|[_\\-])(win|windows)(?:[_\\-]|$)/i', $haystack)) { | ||
| return 'windows'; | ||
| } | ||
| if (preg_match('/(?:^|[_\\-])linux(?:[_\\-]|$)/i', $haystack)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR rolls back Linux/Windows canonical collapsing and OS auto-switching so billing/provisioning always use the exact selected service row.
What changed
billing_servicesrow (no canonical dedupe).service_idis no longer swapped based on node OS).add_to_cart.phpblocks incompatible/manual submissions with clear user-facing errors.create_servers.phpre-validates compatibility and fails clearly instead of switching XML/service.service_id,home_cfg_id, andconfig_xml.create_servers.phpinstall-state messaging now reports "Server installation is in progress." when update/install is active but executable is not yet present.modules/gamemanager/view_server_log.phpreplaced deprecatedutf8_encode()usage with PHP 8.3-safe encoding handling.CHANGELOG.md,docs/COPILOT_TODO.md, andmodules/billing/timestamp.txt.Validation
php -lrun on all changed PHP files:modules/billing/serverlist.phpmodules/billing/order.phpmodules/billing/add_to_cart.phpmodules/billing/create_servers.phpmodules/billing/adminserverlist.phpmodules/gamemanager/view_server_log.php_linux.xml/_win.xmlswappingutf8_encodein target fileOGP_DB_PREFIXparallel_validationexecuted: