summaryrefslogtreecommitdiff
path: root/src/coremods
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-01-07 01:36:20 +0000
committerPeter Powell <petpow@saberuk.com>2019-01-07 01:37:55 +0000
commit2e3c6309099841fd573b423d167980be47e634b2 (patch)
tree611382859aba2a9c8eb4272bb7be52b0ca5b0295 /src/coremods
parent4317e2c4d959e9884fc54869e270743030558099 (diff)
core_stub: add stubs for the SUMMON and USERS commands.
Diffstat (limited to 'src/coremods')
-rw-r--r--src/coremods/core_stub.cpp50
1 files changed, 48 insertions, 2 deletions
diff --git a/src/coremods/core_stub.cpp b/src/coremods/core_stub.cpp
index 7ed3865e3..e4f18cb22 100644
--- a/src/coremods/core_stub.cpp
+++ b/src/coremods/core_stub.cpp
@@ -21,6 +21,13 @@
#include "inspircd.h"
+enum
+{
+ // From RFC 1459.
+ ERR_SUMMONDISABLED = 445,
+ ERR_USERSDISABLED = 446
+};
+
/** Handle /CONNECT.
*/
@@ -134,22 +141,61 @@ class CommandSquit : public Command
}
};
+class CommandSummon
+ : public SplitCommand
+{
+ public:
+ CommandSummon(Module* Creator)
+ : SplitCommand(Creator, "SUMMON", 1)
+ {
+ }
+
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE
+ {
+ user->WriteNumeric(ERR_SUMMONDISABLED, "SUMMON has been disabled");
+ return CMD_SUCCESS;
+ }
+};
+
+class CommandUsers
+ : public SplitCommand
+{
+ public:
+ CommandUsers(Module* Creator)
+ : SplitCommand(Creator, "USERS")
+ {
+ }
+
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE
+ {
+ user->WriteNumeric(ERR_USERSDISABLED, "USERS has been disabled");
+ return CMD_SUCCESS;
+ }
+};
+
class CoreModStub : public Module
{
CommandConnect cmdconnect;
CommandLinks cmdlinks;
CommandServer cmdserver;
CommandSquit cmdsquit;
+ CommandSummon cmdsummon;
+ CommandUsers cmdusers;
public:
CoreModStub()
- : cmdconnect(this), cmdlinks(this), cmdserver(this), cmdsquit(this)
+ : cmdconnect(this)
+ , cmdlinks(this)
+ , cmdserver(this)
+ , cmdsquit(this)
+ , cmdsummon(this)
+ , cmdusers(this)
{
}
Version GetVersion() CXX11_OVERRIDE
{
- return Version("Provides the stub commands CONNECT, LINKS, SERVER and SQUIT", VF_VENDOR|VF_CORE);
+ return Version("Provides stubs for unimplemented commands", VF_VENDOR|VF_CORE);
}
};