summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-03-07 18:09:21 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-03-07 18:09:21 +0100
commitb15cffc167391fc8af6cab52061d4b591ec5bbf8 (patch)
treec6d1ca6d1953ef611663e0dc8d4a40adb9cbe660 /src
parent7f4a2cc351efa9c6b50ef15c5772c54cbaef4e75 (diff)
Move admin settings into core_info
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp3
-rw-r--r--src/coremods/core_info/cmd_admin.cpp8
-rw-r--r--src/coremods/core_info/core_info.cpp8
-rw-r--r--src/coremods/core_info/core_info.h15
4 files changed, 27 insertions, 7 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 6d5fc9a87..b9417bf3c 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -372,9 +372,6 @@ void ServerConfig::Fill()
XLineMessage = options->getString("xlinemessage", options->getString("moronbanner", "You're banned!"));
ServerDesc = ConfValue("server")->getString("description", "Configure Me");
Network = ConfValue("server")->getString("network", "Network");
- AdminName = ConfValue("admin")->getString("name", "");
- AdminEmail = ConfValue("admin")->getString("email", "null@example.com");
- AdminNick = ConfValue("admin")->getString("nick", "admin");
NetBufferSize = ConfValue("performance")->getInt("netbuffersize", 10240, 1024, 65534);
dns_timeout = ConfValue("dns")->getInt("timeout", 5);
DisabledCommands = ConfValue("disabled")->getString("commands", "");
diff --git a/src/coremods/core_info/cmd_admin.cpp b/src/coremods/core_info/cmd_admin.cpp
index 4832f22b6..722ef8668 100644
--- a/src/coremods/core_info/cmd_admin.cpp
+++ b/src/coremods/core_info/cmd_admin.cpp
@@ -36,13 +36,13 @@ CmdResult CommandAdmin::Handle (const std::vector<std::string>& parameters, User
return CMD_SUCCESS;
user->SendText(":%s %03d %s :Administrative info for %s", ServerInstance->Config->ServerName.c_str(),
RPL_ADMINME, user->nick.c_str(),ServerInstance->Config->ServerName.c_str());
- if (!ServerInstance->Config->AdminName.empty())
+ if (!AdminName.empty())
user->SendText(":%s %03d %s :Name - %s", ServerInstance->Config->ServerName.c_str(),
- RPL_ADMINLOC1, user->nick.c_str(), ServerInstance->Config->AdminName.c_str());
+ RPL_ADMINLOC1, user->nick.c_str(), AdminName.c_str());
user->SendText(":%s %03d %s :Nickname - %s", ServerInstance->Config->ServerName.c_str(),
- RPL_ADMINLOC2, user->nick.c_str(), ServerInstance->Config->AdminNick.c_str());
+ RPL_ADMINLOC2, user->nick.c_str(), AdminNick.c_str());
user->SendText(":%s %03d %s :E-Mail - %s", ServerInstance->Config->ServerName.c_str(),
- RPL_ADMINEMAIL, user->nick.c_str(), ServerInstance->Config->AdminEmail.c_str());
+ RPL_ADMINEMAIL, user->nick.c_str(), AdminEmail.c_str());
return CMD_SUCCESS;
}
diff --git a/src/coremods/core_info/core_info.cpp b/src/coremods/core_info/core_info.cpp
index 09f8ad18d..56c3c956d 100644
--- a/src/coremods/core_info/core_info.cpp
+++ b/src/coremods/core_info/core_info.cpp
@@ -36,6 +36,14 @@ class CoreModInfo : public Module
{
}
+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
+ {
+ ConfigTag* tag = ServerInstance->Config->ConfValue("admin");
+ cmdadmin.AdminName = tag->getString("name");
+ cmdadmin.AdminEmail = tag->getString("email", "null@example.com");
+ cmdadmin.AdminNick = tag->getString("nick", "admin");
+ }
+
Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides the ADMIN, COMMANDS, INFO, MODULES, MOTD, TIME and VERSION commands", VF_VENDOR|VF_CORE);
diff --git a/src/coremods/core_info/core_info.h b/src/coremods/core_info/core_info.h
index 894616cf7..f5dd9e648 100644
--- a/src/coremods/core_info/core_info.h
+++ b/src/coremods/core_info/core_info.h
@@ -26,6 +26,21 @@
class CommandAdmin : public Command
{
public:
+ /** Holds the admin's name, for output in
+ * the /ADMIN command.
+ */
+ std::string AdminName;
+
+ /** Holds the email address of the admin,
+ * for output in the /ADMIN command.
+ */
+ std::string AdminEmail;
+
+ /** Holds the admin's nickname, for output
+ * in the /ADMIN command
+ */
+ std::string AdminNick;
+
/** Constructor for admin.
*/
CommandAdmin(Module* parent);