From: Roland 'Quix0r' Haeder Date: Fri, 14 Mar 2014 22:05:47 +0000 (+0100) Subject: Added missing XML node 'dht-node-list' + object type 'dht_bootstrap_answer. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=985fceb46075252faf8c70198f7f44221e033d03;p=hub.git Added missing XML node 'dht-node-list' + object type 'dht_bootstrap_answer. Signed-off-by: Roland 'Quix0r' Haeder --- diff --git a/application/hub/main/template/answer/dht/class_XmlDhtBootstrapAnswerTemplateEngine.php b/application/hub/main/template/answer/dht/class_XmlDhtBootstrapAnswerTemplateEngine.php index cc33e5e7c..cc0cd9fb7 100644 --- a/application/hub/main/template/answer/dht/class_XmlDhtBootstrapAnswerTemplateEngine.php +++ b/application/hub/main/template/answer/dht/class_XmlDhtBootstrapAnswerTemplateEngine.php @@ -30,7 +30,8 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im const DHT_BOOTSTRAP_DATA_NODE_STATUS = 'my-status'; const DHT_BOOTSTRAP_DATA_EXTERNAL_IP = 'my-external-ip'; const DHT_BOOTSTRAP_DATA_INTERNAL_IP = 'my-internal-ip'; - const DHT_BOOTSTRAP_DATA_LISTEN_PORT = 'my-listen-port'; + const DHT_BOOTSTRAP_DATA_LISTEN_PORT = 'my-listen-port'; + const DHT_BOOTSTRAP_DATA_NODE_LIST = 'dht-node-list'; /** * Protected constructor @@ -58,6 +59,8 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im 'your-session-id', // Answer status (generic field) self::ANSWER_STATUS, + // DHT node list + self::DHT_BOOTSTRAP_DATA_NODE_LIST, ); } @@ -187,6 +190,26 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im $this->getStackerInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_NODE_STATUS); } + /** + * Starts the dht-node-list + * + * @return void + */ + protected function startDhtNodeList () { + // Push the node name on the stacker + $this->getStackerInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_NODE_LIST); + } + + /** + * Finishes the dht-node-list + * + * @return void + */ + protected function finishDhtNodeList () { + // Pop the last entry + $this->getStackerInstance()->popNamed('node_dht_bootstrap_answer'); + } + /** * Finishes the my-status * diff --git a/application/hub/templates/xml/object_registry/object_registry.xml b/application/hub/templates/xml/object_registry/object_registry.xml index c3470188c..a83a18380 100644 --- a/application/hub/templates/xml/object_registry/object_registry.xml +++ b/application/hub/templates/xml/object_registry/object_registry.xml @@ -105,6 +105,13 @@ along with this program. If not, see tcp all + + dht_bootstrap_answer + direct + 1 + tcp + hub + dht_publish_entry all