]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/server.h
Merge pull request #677 from Robby-/master-dnsblzline
[user/henk/code/inspircd.git] / include / server.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
5  *
6  * This file is part of InspIRCd.  InspIRCd is free software: you can
7  * redistribute it and/or modify it under the terms of the GNU General Public
8  * License as published by the Free Software Foundation, version 2.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19
20 #pragma once
21
22 class CoreExport Server : public classbase
23 {
24  protected:
25         /** The name of this server
26          */
27         const std::string name;
28
29         /** The description of this server.
30          * This can be updated by the protocol module (for remote servers) or by a rehash (for the local server).
31          */
32         std::string description;
33
34         /** True if this server is ulined
35          */
36         bool uline;
37
38         /** True if this server is a silent uline, i.e. silent="true" in the uline block
39          */
40         bool silentuline;
41
42         /** Allow ConfigReaderThread to update the description on a rehash
43          */
44         friend class ConfigReaderThread;
45
46  public:
47         Server(const std::string& srvname, const std::string& srvdesc)
48                 : name(srvname), description(srvdesc), uline(false), silentuline(false) { }
49
50         /**
51          * Returns the name of this server
52          * @return The name of this server, for example "irc.inspircd.org".
53          */
54         const std::string& GetName() const { return name; }
55
56         /** Returns the description (GECOS) of this server
57          * @return The description of this server
58          */
59         const std::string& GetDesc() const { return description; }
60
61         /**
62          * Checks whether this server is ulined
63          * @return True if this server is ulined, false otherwise.
64          */
65         bool IsULine() const { return uline; }
66
67         /**
68          * Checks whether this server is a silent uline
69          * Silent uline servers introduce, quit and oper up users without a snotice being generated.
70          * @return True if this server is a silent uline, false otherwise.
71          */
72         bool IsSilentULine() const { return silentuline; }
73 };