]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/recipient/self/class_SelfRecipient.php
Updated 'core'.
[hub.git] / application / hub / main / recipient / self / class_SelfRecipient.php
index efedc12835962b062bc174fddc34e531f738d76b..2f83c757be2ada589df21ee5f712bdca4f6ba2fa 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -46,7 +46,7 @@ class SelfRecipient extends BaseRecipient implements Recipient {
        }
 
        /**
-        * Tries to resolve given recipient into session ids or ip:port combination
+        * Tries to resolve given recipient into session ids or Universal Node Locator
         * depending on implementation (hint: Template Method Pattern)
         *
         * @param       $recipient              Recipient to resolve (e.g. could be a virtual recipient or direct session id)
@@ -57,19 +57,17 @@ class SelfRecipient extends BaseRecipient implements Recipient {
         */
        public function resolveRecipient ($recipient, Listable $listInstance, array $packageData) {
                // Make sure the recipient is valid
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SELF-RECIPIENT: recipient=' . $recipient);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SELF-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient);
+               // @TODO Add more checks on data
                assert($recipient == NetworkPackage::NETWORK_TARGET_SELF);
 
-               // Determine own port
-               $port = $this->getConfigInstance()->getConfigEntry('node_listen_port');
-
-               // Determine IP or 'external_ip' if set
-               $ip = HubTools::determineOwnExternalIp();
+               // Determine IP or 'external_address' if set
+               $unl = HubTools::determineOwnExternalAddress();
 
                // Is it not empty?
-               if (!empty($ip)) {
+               if (!empty($unl)) {
                        // Add it to the list
-                       $listInstance->addEntry('ip_port', $ip . ':' . $port);
+                       $listInstance->addEntry('unl', $unl);
                } // END - if
        }
 }