summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_lockserv.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/modules/m_lockserv.cpp b/src/modules/m_lockserv.cpp
index dc71101a8..3408e4621 100644
--- a/src/modules/m_lockserv.cpp
+++ b/src/modules/m_lockserv.cpp
@@ -39,9 +39,15 @@ public:
CmdResult Handle (const std::vector<std::string> &parameters, User *user)
{
+ if (locked)
+ {
+ user->WriteServ("NOTICE %s :The server is already locked.", user->nick.c_str());
+ return CMD_FAILURE;
+ }
+
locked = true;
user->WriteNumeric(988, "%s %s :Closed for new connections", user->nick.c_str(), user->server.c_str());
- ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used LOCKSERV to temporarily close for new connections", user->nick.c_str());
+ ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used LOCKSERV to temporarily disallow new connections", user->nick.c_str());
return CMD_SUCCESS;
}
};
@@ -59,9 +65,15 @@ public:
CmdResult Handle (const std::vector<std::string> &parameters, User *user)
{
+ if (!locked)
+ {
+ user->WriteServ("NOTICE %s :The server isn't locked.", user->nick.c_str());
+ return CMD_FAILURE;
+ }
+
locked = false;
user->WriteNumeric(989, "%s %s :Open for new connections", user->nick.c_str(), user->server.c_str());
- ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used UNLOCKSERV to allow for new connections", user->nick.c_str());
+ ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used UNLOCKSERV to allow new connections", user->nick.c_str());
return CMD_SUCCESS;
}
};