]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/coremods/core_oper/core_oper.h
Update copyright headers.
[user/henk/code/inspircd.git] / src / coremods / core_oper / core_oper.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com>
5  *   Copyright (C) 2017-2018 Sadie Powell <sadie@witchery.services>
6  *   Copyright (C) 2014-2015, 2018 Attila Molnar <attilamolnar@hush.com>
7  *
8  * This file is part of InspIRCd.  InspIRCd is free software: you can
9  * redistribute it and/or modify it under the terms of the GNU General Public
10  * License as published by the Free Software Foundation, version 2.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21
22 #pragma once
23
24 #include "inspircd.h"
25
26 namespace DieRestart
27 {
28         /** Send an ERROR to unregistered users and a NOTICE to all registered local users
29          * @param message Message to send
30          */
31         void SendError(const std::string& message);
32 }
33
34 /** Handle /DIE.
35  */
36 class CommandDie : public Command
37 {
38  public:
39         std::string& hash;
40         std::string password;
41
42         /** Constructor for die.
43          */
44         CommandDie(Module* parent, std::string& hashref);
45
46         /** Handle command.
47          * @param parameters The parameters to the command
48          * @param user The user issuing the command
49          * @return A value from CmdResult to indicate command success or failure.
50          */
51         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
52 };
53
54 /** Handle /KILL.
55  */
56 class CommandKill : public Command
57 {
58         std::string lastuuid;
59         std::string killreason;
60         ClientProtocol::EventProvider protoev;
61
62  public:
63         /** Set to a non empty string to obfuscate nicknames prepended to a KILL. */
64         std::string hidenick;
65
66         /** Set to hide kills from clients of ulined servers in snotices. */
67         bool hideuline;
68
69         /** Constructor for kill.
70          */
71         CommandKill(Module* parent);
72
73         /** Handle command.
74          * @param user User issuing the command
75          * @param parameters Parameters to the command
76          * @return A value from CmdResult to indicate command success or failure.
77          */
78         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
79
80         RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE;
81
82         void EncodeParameter(std::string& param, unsigned int index) CXX11_OVERRIDE;
83 };
84
85 /** Handle /OPER.
86  */
87 class CommandOper : public SplitCommand
88 {
89  public:
90         /** Constructor for oper.
91          */
92         CommandOper(Module* parent);
93
94         /** Handle command.
95          * @param user User issuing the command
96          * @param parameters Parameters to the command
97          * @return A value from CmdResult to indicate command success or failure.
98          */
99         CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
100 };
101
102 /** Handle /REHASH.
103  */
104 class CommandRehash : public Command
105 {
106  public:
107         /** Constructor for rehash.
108          */
109         CommandRehash(Module* parent);
110
111         /** Handle command.
112          * @param user User issuing the command
113          * @param parameters Parameters to the command
114          * @return A value from CmdResult to indicate command success or failure.
115          */
116         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
117 };
118
119 /** Handle /RESTART
120  */
121 class CommandRestart : public Command
122 {
123  public:
124         std::string& hash;
125         std::string password;
126
127         /** Constructor for restart.
128          */
129         CommandRestart(Module* parent, std::string& hashref);
130
131         /** Handle command.
132          * @param user User issuing the command
133          * @param parameters Parameters to the command
134          * @return A value from CmdResult to indicate command success or failure.
135          */
136         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
137 };