mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Add SendMetadata methods to Server.
This commit is contained in:
parent
5d2f760e4d
commit
4175ba7833
@ -84,4 +84,17 @@ public:
|
|||||||
* @return True if this server is a silent service, false otherwise.
|
* @return True if this server is a silent service, false otherwise.
|
||||||
*/
|
*/
|
||||||
bool IsSilentService() const { return silentservice; }
|
bool IsSilentService() const { return silentservice; }
|
||||||
|
|
||||||
|
/** Send metadata related to this server to the target server.
|
||||||
|
* @param key The name of the metadata (e.g. foo-bar).
|
||||||
|
* @param data The network representation of the metadata.
|
||||||
|
*/
|
||||||
|
virtual void SendMetadata(const std::string& key, const std::string& data) const;
|
||||||
|
|
||||||
|
/** Send metadata related to an extensible to the target server.
|
||||||
|
* @param ext The extensible to send metadata for.
|
||||||
|
* @param key The name of the metadata (e.g. foo-bar).
|
||||||
|
* @param data The network representation of the metadata.
|
||||||
|
*/
|
||||||
|
virtual void SendMetadata(const Extensible* ext, const std::string& key, const std::string& data) const;
|
||||||
};
|
};
|
||||||
|
@ -291,3 +291,15 @@ void TreeServer::RemoveHash()
|
|||||||
Utils->sidlist.erase(GetId());
|
Utils->sidlist.erase(GetId());
|
||||||
Utils->serverlist.erase(GetName());
|
Utils->serverlist.erase(GetName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TreeServer::SendMetadata(const std::string& key, const std::string& data) const
|
||||||
|
{
|
||||||
|
if (!GetRoute())
|
||||||
|
GetRoute()->GetSocket()->WriteLine(CommandMetadata::Builder(key, data));
|
||||||
|
}
|
||||||
|
|
||||||
|
void TreeServer::SendMetadata(const Extensible* ext, const std::string& key, const std::string& data) const
|
||||||
|
{
|
||||||
|
if (!GetRoute())
|
||||||
|
GetRoute()->GetSocket()->WriteLine(CommandMetadata::Builder(ext, key, data));
|
||||||
|
}
|
||||||
|
@ -97,6 +97,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
TreeServer();
|
TreeServer();
|
||||||
|
|
||||||
|
void SendMetadata(const std::string& key, const std::string& data) const override;
|
||||||
|
|
||||||
|
void SendMetadata(const Extensible* ext, const std::string& key, const std::string& data) const override;
|
||||||
|
|
||||||
/** When we create a new server, we call this constructor to initialize it.
|
/** When we create a new server, we call this constructor to initialize it.
|
||||||
* This constructor initializes the server's Route and Parent, and sets up
|
* This constructor initializes the server's Route and Parent, and sets up
|
||||||
* its ping counters so that it will be pinged one minute from now.
|
* its ping counters so that it will be pinged one minute from now.
|
||||||
|
@ -161,3 +161,13 @@ const std::string& Server::GetPublicName() const
|
|||||||
return ServerInstance->Config->HideServer;
|
return ServerInstance->Config->HideServer;
|
||||||
return GetName();
|
return GetName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Server::SendMetadata(const std::string& key, const std::string& data) const
|
||||||
|
{
|
||||||
|
// Do nothing for the local server.
|
||||||
|
}
|
||||||
|
|
||||||
|
void Server::SendMetadata(const Extensible* ext, const std::string& key, const std::string& data) const
|
||||||
|
{
|
||||||
|
// Do nothing for the local server.
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user