]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/nodes/boot/class_HubBootNode.php
Added all node types, moved iterator class:
[hub.git] / application / hub / main / nodes / boot / class_HubBootNode.php
index e4cf363dccc6e43bc9eb6b2773059393bdd2edd0..9b7de39253c5cace26aa371ec0bd61595954341c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -38,7 +38,7 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable {
         * @param       $requestInstance        An instance of a Requestable class
         * @return      $nodeInstance           An instance of this hub-node class
         */
-       public final static function createHubBootNode (Requestable $requestInstance) {
+       public static final function createHubBootNode (Requestable $requestInstance) {
                // Get a new instance
                $nodeInstance = new HubBootNode();
 
@@ -61,7 +61,7 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable {
                // Now check if the IP address matches one of the bootstrap nodes
                if ($this->ifAddressMatchesBootstrappingNodes($this->getConfigInstance()->detectServerAddress())) {
                        // Get our port from configuration
-                       $ourPort = $this->getConfigInstance()->getConfigEntry('node_tcp_listen_port');
+                       $ourPort = $this->getConfigInstance()->getConfigEntry('boot_node_tcp_listen_port');
 
                        // Extract port
                        $bootPort = substr($this->getBootIpPort(), -strlen($ourPort), strlen($ourPort));
@@ -71,13 +71,13 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable {
                                // It is the same!
                                $this->debugOutput('BOOTSTRAP: IP/port matches bootstrapping node ' . $this->getBootIpPort() . '.');
 
-                               // Now, does the mode match (should be 'boot'!)
-                               if ($this->getRequestInstance()->getRequestElement('mode') == 'boot') {
+                               // Now, does the mode match
+                               if ($this->getRequestInstance()->getRequestElement('mode') == BaseHubNode::NODE_TYPE_BOOT) {
                                        // Output debug message
                                        $this->debugOutput('BOOTSTRAP: Our node is a valid bootstrapping node.');
                                } else {
                                        // Output warning
-                                       $this->debugOutput('BOOTSTRAP: WARNING: Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=boot detected.');
+                                       $this->debugOutput('BOOTSTRAP: WARNING: Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=' . BaseHubNode::NODE_TYPE_BOOT . ' detected.');
                                }
                        } else {
                                // IP does match, but no port
@@ -109,7 +109,7 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable {
         *
         * @return      void
         */
-       public function addExtraHubFilters () {
+       public function addExtraNodeFilters () {
                // Get the application instance from registry
                $applicationInstance = Registry::getRegistry()->getInstance('app');
 
@@ -121,5 +121,5 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable {
        }
 }
 
-//
+// [EOF]
 ?>