]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/coremods/core_oper/core_oper.h
Demote core_ison and core_userhost to commands in core_user.
[user/henk/code/inspircd.git] / src / coremods / core_oper / core_oper.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 #include "inspircd.h"
23
24 namespace DieRestart
25 {
26         /** Send an ERROR to unregistered users and a NOTICE to all registered local users
27          * @param message Message to send
28          */
29         void SendError(const std::string& message);
30 }
31
32 /** Handle /DIE.
33  */
34 class CommandDie : public Command
35 {
36  public:
37         std::string& hash;
38         std::string password;
39
40         /** Constructor for die.
41          */
42         CommandDie(Module* parent, std::string& hashref);
43
44         /** Handle command.
45          * @param parameters The parameters to the command
46          * @param user The user issuing the command
47          * @return A value from CmdResult to indicate command success or failure.
48          */
49         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
50 };
51
52 /** Handle /KILL.
53  */
54 class CommandKill : public Command
55 {
56         std::string lastuuid;
57         std::string killreason;
58         ClientProtocol::EventProvider protoev;
59
60  public:
61         /** Set to a non empty string to obfuscate nicknames prepended to a KILL. */
62         std::string hidenick;
63
64         /** Set to hide kills from clients of ulined servers in snotices. */
65         bool hideuline;
66
67         /** Constructor for kill.
68          */
69         CommandKill(Module* parent);
70
71         /** Handle command.
72          * @param user User issuing the command
73          * @param parameters Parameters to the command
74          * @return A value from CmdResult to indicate command success or failure.
75          */
76         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
77
78         RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE;
79
80         void EncodeParameter(std::string& param, unsigned int index) CXX11_OVERRIDE;
81 };
82
83 /** Handle /OPER.
84  */
85 class CommandOper : public SplitCommand
86 {
87  public:
88         /** Constructor for oper.
89          */
90         CommandOper(Module* parent);
91
92         /** Handle command.
93          * @param user User issuing the command
94          * @param parameters Parameters to the command
95          * @return A value from CmdResult to indicate command success or failure.
96          */
97         CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
98 };
99
100 /** Handle /REHASH.
101  */
102 class CommandRehash : public Command
103 {
104  public:
105         /** Constructor for rehash.
106          */
107         CommandRehash(Module* parent);
108
109         /** Handle command.
110          * @param user User issuing the command
111          * @param parameters Parameters to the command
112          * @return A value from CmdResult to indicate command success or failure.
113          */
114         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
115 };
116
117 /** Handle /RESTART
118  */
119 class CommandRestart : public Command
120 {
121  public:
122         std::string& hash;
123         std::string password;
124
125         /** Constructor for restart.
126          */
127         CommandRestart(Module* parent, std::string& hashref);
128
129         /** Handle command.
130          * @param user User issuing the command
131          * @param parameters Parameters to the command
132          * @return A value from CmdResult to indicate command success or failure.
133          */
134         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
135 };