X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fhub%2Fmain%2Fnodes%2Fclass_BaseHubNode.php;h=1dff70eea9b166becf1ecf95f0b33ebb619caec0;hb=280fca59f8ed35ddde36a794c7a9f4991911e46a;hp=2228b3114ae06925ebd20d19a5302e337421ec8e;hpb=0553b20da2815d73580a07212106ee3be7aa3407;p=hub.git diff --git a/application/hub/main/nodes/class_BaseHubNode.php b/application/hub/main/nodes/class_BaseHubNode.php index 2228b3114..1dff70eea 100644 --- a/application/hub/main/nodes/class_BaseHubNode.php +++ b/application/hub/main/nodes/class_BaseHubNode.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 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 * @@ -84,6 +84,9 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { // Set it here $this->setCryptoInstance($cryptoInstance); + // Set the node instance in registry + Registry::getRegistry()->addInstance('node', $this); + // Init state which sets the state to 'init' $this->initState(); } @@ -95,7 +98,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { */ private function initState() { // Get the state factory and create the initial state. - NodeStateFactory::createNodeStateInstanceByName('init', $this); + NodeStateFactory::createNodeStateInstanceByName('init'); } /** @@ -238,7 +241,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { // Output all lines self::createDebugInstance(__CLASS__)->debugOutput(' '); self::createDebugInstance(__CLASS__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . $this->getRequestInstance()->getRequestElement('mode') . ' mode active'); - self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2014 Hub Developer Team'); + self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2015 Hub Developer Team'); self::createDebugInstance(__CLASS__)->debugOutput(' '); self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); self::createDebugInstance(__CLASS__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); @@ -311,7 +314,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { // Output message self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Created new session-id: ' . $this->getSessionId() . ''); - // Change the state because the node has auired a hub id + // Change the state because the node has aquired a session id $this->getStateInstance()->nodeGeneratedSessionId(); } @@ -743,8 +746,10 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $unlInstance = $this->determineUniversalNodeLocator(); // Make sure the instance is valid - // * DEBUG: */ $this->debugInstance('unlInstance[]=' . gettype($unlInstance)); - assert($unlInstance instanceof LocateableNode); + if (!$unlInstance instanceof LocateableNode) { + // No valid instance, so better debug this + $this->debugBackTrace('unlInstance[' . gettype($unlInstance) . ']=' . $unlInstance); + } // END - if // ... and the array from it $unlData = $unlInstance->getUnlData();