From bc2256dfd0e332490626a80d9359e7900545c5b8 Mon Sep 17 00:00:00 2001 From: Daniel Barton Date: Tue, 28 May 2024 22:01:01 +0800 Subject: [PATCH] Add support for custom ports --- pterodactyl/pterodactyl.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pterodactyl/pterodactyl.php b/pterodactyl/pterodactyl.php index 12af1b6..7b382f0 100644 --- a/pterodactyl/pterodactyl.php +++ b/pterodactyl/pterodactyl.php @@ -45,7 +45,8 @@ function pterodactyl_GetHostname(array $params) { if(ip2long($hostname) !== false) $hostname = 'http://' . $hostname; else $hostname = ($params['serversecure'] ? 'https://' : 'http://') . $hostname; - return rtrim($hostname, '/'); + // Append port and return + return rtrim($hostname, '/') . ':' . $params['serverport']; } function pterodactyl_API(array $params, $endpoint, array $data = [], $method = "GET", $dontLog = false) { @@ -99,6 +100,8 @@ function pterodactyl_MetaData() { "DisplayName" => "Pterodactyl", "APIVersion" => "1.1", "RequiresServer" => true, + 'DefaultNonSSLPort' => '80', + 'DefaultSSLPort' => '443', ]; }