diff options
author | Adam <Adam@anope.org> | 2012-10-08 04:16:23 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-10-08 04:16:23 -0400 |
commit | e57b470e83fac205a354138b1daccec654214e39 (patch) | |
tree | 4574a088eda4bc5fa141f7bcbda07e141eae260a /src | |
parent | b8b63ff115f0daddf479b0da507a2f731255a06d (diff) |
Made fantasy commands configurable
Diffstat (limited to 'src')
-rw-r--r-- | src/command.cpp | 1 | ||||
-rw-r--r-- | src/config.cpp | 31 |
2 files changed, 31 insertions, 1 deletions
diff --git a/src/command.cpp b/src/command.cpp index 9f1b26fa4..976f89de7 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -239,7 +239,6 @@ void RunCommand(CommandSource &source, const Anope::string &message) if (MOD_RESULT == EVENT_STOP) return; - if (params.size() < c->MinParams) { c->OnSyntaxError(source, !params.empty() ? params[params.size() - 1] : ""); diff --git a/src/config.cpp b/src/config.cpp index e0cd21b68..b90c8598a 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -890,6 +890,8 @@ static bool DoneCommands(ServerConfig *config, const Anope::string &) return true; } +/*************************************************************************/ + static bool InitPrivileges(ServerConfig *config, const Anope::string &) { PrivilegeManager::ClearPrivileges(); @@ -1040,6 +1042,30 @@ static bool DoneServices(ServerConfig *config, const Anope::string &) /*************************************************************************/ +static bool InitFantasy(ServerConfig *config, const Anope::string &) +{ + config->Fantasy.clear(); + return true; +} + +static bool DoFantasy(ServerConfig *config, const Anope::string &, const Anope::string *, ValueList &values, int *) +{ + Anope::string name = values[0].GetValue(); + Anope::string service = values[1].GetValue(); + Anope::string permission = values[2].GetValue(); + + config->Fantasy[name].name = service; + config->Fantasy[name].permission = permission; + return true; +} + +static bool DoneFantasy(ServerConfig *config, const Anope::string &) +{ + return true; +} + +/*************************************************************************/ + ConfigurationFile::ConfigurationFile(const Anope::string &n, bool e) : name(n), executable(e), fp(NULL) { } @@ -1359,6 +1385,11 @@ ConfigItems::ConfigItems(ServerConfig *conf) {"", "", "", ""}, {DT_STRING, DT_STRING, DT_INTEGER, DT_STRING}, InitPrivileges, DoPrivileges, DonePrivileges}, + {"fantasy", + {"name", "command", "permission", ""}, + {"", "", "", ""}, + {DT_STRING, DT_STRING, DT_STRING}, + InitFantasy, DoFantasy, DoneFantasy}, {"", {""}, {""}, |