From: Roland Häder Date: Fri, 22 Feb 2013 04:16:20 +0000 (+0000) Subject: Also include accepted node types from own node X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=debb0c2e960342196991f332e25ecc53e659d598;p=hub.git Also include accepted node types from own node --- diff --git a/application/hub/main/database/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php b/application/hub/main/database/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php index 83c5ec4e4..f9d74bdad 100644 --- a/application/hub/main/database/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php +++ b/application/hub/main/database/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php @@ -33,6 +33,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem const DB_COLUMN_PRIVATE_KEY = 'private_key'; const DB_COLUMN_PRIVATE_KEY_HASH = 'private_key_hash'; const DB_COLUMN_NODE_MODE = 'node_mode'; + const DB_COLUMN_ACCEPTED_OBJECTS = 'accepted_object_types'; /** * Protected constructor @@ -84,6 +85,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem // Make sure both is valid assert(($ipPort[0] !== 'invalid') && ($ipPort[1] !== 'invalid')); + // Get an array of all accepted object types + $objectList = $nodeInstance->getListFromAcceptedObjectTypes(); + // Add public node data $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_MODE , $requestInstance->getRequestElement('mode')); $dataSetInstance->addCriteria(self::DB_COLUMN_EXTERNAL_IP , $ipPort[0]); @@ -91,6 +95,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_ID , $nodeInstance->getNodeId()); $dataSetInstance->addCriteria(self::DB_COLUMN_SESSION_ID , $nodeInstance->getSessionId()); $dataSetInstance->addCriteria(self::DB_COLUMN_PRIVATE_KEY_HASH, $nodeInstance->getPrivateKeyHash()); + $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPTED_OBJECTS, implode(BaseHubNode::OBJECT_LIST_SEPARATOR, $objectList)); // Return it return $dataSetInstance;