From: Roland Häder Date: Thu, 17 May 2012 19:26:44 +0000 (+0000) Subject: Added missing node state 'reachable' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cd27e817246567d5bcaecc6ec701194831513fc5;p=hub.git Added missing node state 'reachable' --- diff --git a/.gitattributes b/.gitattributes index 8c66ae552..45c7020e0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -477,6 +477,8 @@ application/hub/main/states/node/class_ svneol=native#text/plain application/hub/main/states/node/class_BaseNodeState.php svneol=native#text/plain application/hub/main/states/node/init/.htaccess -text svneol=unset#text/plain application/hub/main/states/node/init/class_NodeInitState.php svneol=native#text/plain +application/hub/main/states/node/seniors/.htaccess -text svneol=unset#text/plain +application/hub/main/states/node/seniors/class_NodeReachableState.php svneol=native#text/plain application/hub/main/states/node/virgin/.htaccess -text svneol=unset#text/plain application/hub/main/states/node/virgin/class_NodeVirginState.php svneol=native#text/plain application/hub/main/states/peer/.htaccess -text svneol=unset#text/plain diff --git a/application/hub/config.php b/application/hub/config.php index 7bec78aa8..49bee6e90 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -516,6 +516,9 @@ $cfg->setConfigEntry('node_active_state_class', 'NodeActiveState'); // CFG: NODE-ANNOUNCED-STATE-CLASS $cfg->setConfigEntry('node_announced_state_class', 'NodeAnnouncedState'); +// CFG: NODE-REACHABLE-STATE-CLASS +$cfg->setConfigEntry('node_reachable_state_class', 'NodeReachableState'); + // CFG: NETWORK-PACKAGE-CLASS $cfg->setConfigEntry('network_package_class', 'NetworkPackage'); diff --git a/application/hub/main/states/node/seniors/.htaccess b/application/hub/main/states/node/seniors/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/states/node/seniors/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/states/node/seniors/class_NodeReachableState.php b/application/hub/main/states/node/seniors/class_NodeReachableState.php new file mode 100644 index 000000000..f4b8965c7 --- /dev/null +++ b/application/hub/main/states/node/seniors/class_NodeReachableState.php @@ -0,0 +1,60 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class NodeReachableState extends BaseNodeState implements Stateable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set state name + $this->setStateName('reachable'); + } + + /** + * Creates an instance of this class + * + * @param $nodeInstance An instance of a NodeHelper class + * @return $stateInstance An instance of a Stateable class + */ + public final static function createNodeReachableState (NodeHelper $nodeInstance) { + // Get new instance + $stateInstance = new NodeReachableState(); + + // Debug message + $stateInstance->debugOutput('NODE-STATE: Has changed from ' . $nodeInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + + // Set the node instance + $stateInstance->setNodeInstance($nodeInstance); + + // Return the prepared instance + return $stateInstance; + } +} + +// [EOF] +?>