From d57e3d015213accd187f5658f7bcac3c43f13734 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 2 May 2026 20:42:46 +0000 Subject: [PATCH] Fix: array offset on false in getNextAvailablePort, array-to-string in render_node attributes, missing columns in sync_billing_services INSERT Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/5bf3f57e-9174-4768-ae8b-c3526a1daeca Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com> --- includes/database_mysqli.php | 4 ++-- modules/billing/adminserverlist.php | 9 +++++++-- modules/config_games/config_servers.php | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/includes/database_mysqli.php b/includes/database_mysqli.php index 4c161299..46d39b73 100644 --- a/includes/database_mysqli.php +++ b/includes/database_mysqli.php @@ -3588,11 +3588,11 @@ class OGPDatabaseMySQL extends OGPDatabase public function getNextAvailablePort($ip_id,$home_cfg_id){ $ranges = $this->getPortsRange($ip_id,$home_cfg_id); - $range = $ranges[0]; + $range = is_array($ranges) ? ($ranges[0] ?? null) : null; if(empty($range)) { $ranges = $this->getPortsRange($ip_id,"0"); - $range = $ranges[0]; + $range = is_array($ranges) ? ($ranges[0] ?? null) : null; } if(empty($range)) $range = array('start_port' => '27015','end_port' => '39915', 'port_increment' => '100'); diff --git a/modules/billing/adminserverlist.php b/modules/billing/adminserverlist.php index 5094dff7..48d346cf 100644 --- a/modules/billing/adminserverlist.php +++ b/modules/billing/adminserverlist.php @@ -73,6 +73,9 @@ function sync_billing_services(mysqli $db, string $prefix): array 'price_year' => "ADD COLUMN `price_year` FLOAT(15,4) NOT NULL DEFAULT 0", 'remote_server_id' => "ADD COLUMN `remote_server_id` VARCHAR(255) NOT NULL DEFAULT ''", 'install_method' => "ADD COLUMN `install_method` VARCHAR(255) NOT NULL DEFAULT 'steamcmd'", + 'ftp' => "ADD COLUMN `ftp` VARCHAR(255) NOT NULL DEFAULT ''", + 'manual_url' => "ADD COLUMN `manual_url` VARCHAR(255) NOT NULL DEFAULT ''", + 'access_rights' => "ADD COLUMN `access_rights` VARCHAR(255) NOT NULL DEFAULT ''", ]; foreach ($autoRepairCols as $col => $alterFragment) { @@ -138,12 +141,14 @@ function sync_billing_services(mysqli $db, string $prefix): array (home_cfg_id, mod_cfg_id, service_name, description, remote_server_id, enabled, out_of_stock, price_daily, price_monthly, price_year, - slot_min_qty, slot_max_qty, install_method) + slot_min_qty, slot_max_qty, install_method, + img_url, ftp, manual_url, access_rights) VALUES ({$homeCfgId}, {$modCfgId}, '{$svcName}', '{$svcName}', '', 0, 0, 0, 0, 0, - 1, 100, 'steamcmd')" + 1, 100, 'steamcmd', + '', '', '', '')" ); $messages[] = "Added new service: " . ($gm['mod_name'] ?: $gm['game_name']); } diff --git a/modules/config_games/config_servers.php b/modules/config_games/config_servers.php index 251d88f2..9404f83f 100644 --- a/modules/config_games/config_servers.php +++ b/modules/config_games/config_servers.php @@ -173,9 +173,9 @@ function config_games_render_node(SimpleXMLElement $node, array $ancestors, arra } $attributes = $node->attributes(); - if ($attributes && count((array)$attributes) > 0) { + if ($attributes && count($attributes) > 0) { $html .= "