From 2e3c6309099841fd573b423d167980be47e634b2 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 7 Jan 2019 01:36:20 +0000 Subject: core_stub: add stubs for the SUMMON and USERS commands. --- src/coremods/core_stub.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) (limited to 'src/coremods') 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); } }; -- cgit v1.2.3