X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fserver.h;h=1aacdc2d97a9514f4235e71183e81b904de5700c;hb=b0f16081ccaef527ed4b5434a7264508cf455f39;hp=e6e96593d8546b6a35dee9af1a2e12797911bfb1;hpb=11916574f67962dce1d7a2fdf7ef6a3d2d1fa49f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/server.h b/include/server.h index e6e96593d..1aacdc2d9 100644 --- a/include/server.h +++ b/include/server.h @@ -1,6 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2019-2020 Sadie Powell + * Copyright (C) 2018 Matt Schatz * Copyright (C) 2014 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -22,21 +24,50 @@ class CoreExport Server : public classbase { protected: + /** The unique identifier for this server. */ + const std::string id; + /** The name of this server */ const std::string name; + /** The description of this server. + * This can be updated by the protocol module (for remote servers) or by a rehash (for the local server). + */ + std::string description; + /** True if this server is ulined */ bool uline; - /** True if this server is a silent uline, i.e. silent="true" in the uline block + /** True if this server is a silent uline, i.e. silent="yes" in the uline block */ bool silentuline; + /** Allow ConfigReaderThread to update the description on a rehash + */ + friend class ConfigReaderThread; + public: - Server(const std::string& srvname) - : name(srvname), uline(false), silentuline(false) { } + Server(const std::string& srvid, const std::string& srvname, const std::string& srvdesc) + : id(srvid) + , name(srvname) + , description(srvdesc) + , uline(false) + , silentuline(false) + { + } + + DEPRECATED_METHOD(Server(const std::string& srvname, const std::string& srvdesc)) + : name(srvname) + , description(srvdesc) + , uline(false) + , silentuline(false) + { + } + + /** Retrieves the unique identifier for this server (e.g. 36C). */ + const std::string& GetId() const { return id; } /** * Returns the name of this server @@ -44,6 +75,11 @@ class CoreExport Server : public classbase */ const std::string& GetName() const { return name; } + /** Returns the description of this server + * @return The description of this server + */ + const std::string& GetDesc() const { return description; } + /** * Checks whether this server is ulined * @return True if this server is ulined, false otherwise.