- locked = true;
- user->WriteNumeric(988, "%s %s :Closed for new connections", user->nick.c_str(), user->server);
- ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used LOCKSERV to temporarily close for new connections", user->nick.c_str());
- /* Dont send to the network */
- return CMD_LOCALONLY;
+ if (!locked.empty())
+ {
+ user->WriteNotice("The server is already locked.");
+ return CMD_FAILURE;
+ }
+
+ locked = parameters.empty() ? "Server is temporarily closed. Please try again later." : parameters[0];
+ user->WriteNumeric(RPL_SERVLOCKON, user->server->GetName(), "Closed for new connections");
+ ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used LOCKSERV to temporarily disallow new connections", user->nick.c_str());
+ return CMD_SUCCESS;