From c09b6737d9f734484bb2aa4ae1324b69cd262496 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 14:19:36 +0000 Subject: [PATCH] chore: apply final provisioning review cleanups Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/a39ca073-858c-4e1e-978f-09caabb0f029 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com> --- modules/billing/create_servers.php | 13 +++++++++++-- modules/gamemanager/server_monitor.php | 2 ++ modules/user_games/add_home.php | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/billing/create_servers.php b/modules/billing/create_servers.php index 6d99c5d5..036aefcd 100644 --- a/modules/billing/create_servers.php +++ b/modules/billing/create_servers.php @@ -48,6 +48,13 @@ if (!function_exists('billing_should_regenerate_provision_password')) { } } +if (!function_exists('billing_agent_offline_reason')) { + function billing_agent_offline_reason(int $remote_server_id, array $home_info): string + { + return "Agent is offline for remote server #{$remote_server_id} (" . ($home_info['agent_ip'] ?? 'unknown') . ":" . ($home_info['agent_port'] ?? 'unknown') . ")."; + } +} + if (!function_exists('billing_invoke_provision')) { function billing_invoke_provision(array $options = array()) { @@ -486,6 +493,8 @@ function exec_ogp_module() $order_failure_reason = "Could not create server_homes row for order #{$order_id}."; } if (!$order_failed) { + // Billing storefront defaults to FTP enabled for newly provisioned homes + // so panel/account flows remain consistent immediately after checkout. $db->changeFtpStatus('enabled', intval($home_id)); } @@ -589,7 +598,7 @@ function exec_ogp_module() } if (empty($autoInstall['ok'])) { if (stripos((string)($autoInstall['message'] ?? ''), 'Agent is offline') !== false) { - $order_failure_reason = "Agent is offline for remote server #{$remote_server_id} (" . ($home_info['agent_ip'] ?? 'unknown') . ":" . ($home_info['agent_port'] ?? 'unknown') . ")."; + $order_failure_reason = billing_agent_offline_reason(intval($remote_server_id), (array)$home_info); } $order_failed = true; $order_failure_reason = $order_failure_reason !== '' ? $order_failure_reason : ("Server files have not been installed yet. " . ($autoInstall['message'] ?? 'Auto install could not be started.')); @@ -706,7 +715,7 @@ function exec_ogp_module() } if (empty($autoInstall['ok'])) { if (stripos((string)($autoInstall['message'] ?? ''), 'Agent is offline') !== false) { - $order_failure_reason = "Agent is offline for remote server #{$remote_server_id} (" . ($home_info['agent_ip'] ?? 'unknown') . ":" . ($home_info['agent_port'] ?? 'unknown') . ")."; + $order_failure_reason = billing_agent_offline_reason(intval($remote_server_id), (array)$home_info); } $order_failed = true; $order_failure_reason = $order_failure_reason !== '' ? $order_failure_reason : ("Server files have not been installed yet. " . ($autoInstall['message'] ?? 'Auto install could not be started.')); diff --git a/modules/gamemanager/server_monitor.php b/modules/gamemanager/server_monitor.php index dc6cbb4c..fe9e74d8 100644 --- a/modules/gamemanager/server_monitor.php +++ b/modules/gamemanager/server_monitor.php @@ -449,6 +449,8 @@ echo "