1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 16:53:16 +02:00

Made fantasy commands configurable

This commit is contained in:
Adam
2012-10-08 04:16:23 -04:00
parent b8b63ff115
commit e57b470e83
7 changed files with 168 additions and 54 deletions
+31
View File
@@ -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},
{"",
{""},
{""},