From: Roland Häder Date: Tue, 6 Jul 2010 15:45:34 +0000 (+0000) Subject: Support for non-regular ports added X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=48eeedba1e9d3aed98dd312964e74c9c6db42d11;p=hub.git Support for non-regular ports added --- diff --git a/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php b/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php index ad062049d..d2dfcb6d2 100644 --- a/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php +++ b/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php @@ -74,8 +74,18 @@ class PackageRecipientDiscovery extends BaseHubDiscovery implements Discoverable // Determine own external ip by connecting to my (coder) server at 217.172.186.31 $ip = ConsoleTools::determineExternalIp(); + // Get mode + $mode = Registry::getRegistry()->getInstance('app')->getRequestInstance()->getRequestElement('mode'); + + // Set prefix + $prefix = ''; + if ($mode != 'regular') { + // Is a special node + $prefix = $mode . '_'; + } // END - if + // Get port and add it - $ipPort = $ip . ':' . $this->getConfigInstance()->getConfigEntry('node_' . $this->determineProtocolByPackageData($packageData) . '_listen_port'); + $ipPort = $ip . ':' . $this->getConfigInstance()->getConfigEntry($prefix . 'node_' . $this->determineProtocolByPackageData($packageData) . '_listen_port'); // Add it to the list $listInstance->addEntry('ip_port', $ipPort);