]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/server.h
Add an oper only parameter to Simple{Channel,User}ModeHandler.
[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 unique identifier for this server. */
26         const std::string id;
27
28         /** The name of this server
29          */
30         const std::string name;
31
32         /** The description of this server.
33          * This can be updated by the protocol module (for remote servers) or by a rehash (for the local server).
34          */
35         std::string description;
36
37         /** True if this server is ulined
38          */
39         bool uline;
40
41         /** True if this server is a silent uline, i.e. silent="true" in the uline block
42          */
43         bool silentuline;
44
45         /** Allow ConfigReaderThread to update the description on a rehash
46          */
47         friend class ConfigReaderThread;
48
49  public:
50         Server(const std::string& srvid, const std::string& srvname, const std::string& srvdesc)
51                 : id(srvid)
52                 , name(srvname)
53                 , description(srvdesc)
54                 , uline(false)
55                 , silentuline(false)
56         {
57         }
58
59         DEPRECATED_METHOD(Server(const std::string& srvname, const std::string& srvdesc))
60                 : name(srvname)
61                 , description(srvdesc)
62                 , uline(false)
63                 , silentuline(false)
64         {
65         }
66
67         /** Retrieves the unique identifier for this server (e.g. 36C). */
68         const std::string& GetId() const { return id; }
69
70         /**
71          * Returns the name of this server
72          * @return The name of this server, for example "irc.inspircd.org".
73          */
74         const std::string& GetName() const { return name; }
75
76         /** Returns the description of this server
77          * @return The description of this server
78          */
79         const std::string& GetDesc() const { return description; }
80
81         /**
82          * Checks whether this server is ulined
83          * @return True if this server is ulined, false otherwise.
84          */
85         bool IsULine() const { return uline; }
86
87         /**
88          * Checks whether this server is a silent uline
89          * Silent uline servers introduce, quit and oper up users without a snotice being generated.
90          * @return True if this server is a silent uline, false otherwise.
91          */
92         bool IsSilentULine() const { return silentuline; }
93 };