1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 08:13:15 +02:00

That doesn't work either, just don't use references.

find ./ -name '*.cpp' -exec sed -i 's/Get<const Anope::string\&>/Get<const Anope::string>/g' {} \;
This commit is contained in:
Adam
2013-05-05 21:05:43 -04:00
parent 3e8752fe66
commit 5b3f81ea78
64 changed files with 260 additions and 266 deletions
+72 -78
View File
@@ -77,37 +77,31 @@ const Block::item_map* Block::GetItems() const
return NULL;
}
template<> const Anope::string& Block::Get(const Anope::string &tag, const Anope::string& def) const
template<> const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const
{
static Anope::string ret;
if (!this)
{
ret = def;
return ret;
}
return def;
Anope::map<Anope::string>::const_iterator it = items.find(tag);
if (it != items.end())
return it->second;
ret = def;
return ret;
return def;
}
template<> time_t Block::Get(const Anope::string &tag, const Anope::string &def) const
{
return Anope::DoTime(Get<const Anope::string &>(tag, def));
return Anope::DoTime(Get<const Anope::string>(tag, def));
}
template<> const char* Block::Get(const Anope::string &tag, const Anope::string &def) const
{
return this->Get<const Anope::string &>(tag, def).c_str();
return this->Get<const Anope::string>(tag, def).c_str();
}
template<> bool Block::Get(const Anope::string &tag, const Anope::string &def) const
{
const Anope::string &str = Get<const Anope::string &>(tag, def);
const Anope::string &str = Get<const Anope::string>(tag, def);
return str.equals_ci("yes") || str.equals_ci("on") || str.equals_ci("true");
}
@@ -134,8 +128,8 @@ Conf::Conf() : Block("")
{
Block *include = this->GetBlock("include", i);
const Anope::string &type = include->Get<const Anope::string &>("type"),
&file = include->Get<const Anope::string &>("name");
const Anope::string &type = include->Get<const Anope::string>("type"),
&file = include->Get<const Anope::string>("name");
File f(file, type == "executable");
this->LoadConf(f);
@@ -165,7 +159,7 @@ Conf::Conf() : Block("")
};
for (unsigned i = 0; i < sizeof(noreload) / sizeof(noreload[0]); ++i)
if (this->GetBlock(noreload[i].block)->Get<const Anope::string &>(noreload[i].name, noreload[i].def) != Config->GetBlock(noreload[i].block)->Get<const Anope::string &>(noreload[i].name, noreload[i].def))
if (this->GetBlock(noreload[i].block)->Get<const Anope::string>(noreload[i].name, noreload[i].def) != Config->GetBlock(noreload[i].block)->Get<const Anope::string>(noreload[i].name, noreload[i].def))
throw ConfigException("<" + noreload[i].block + ":" + noreload[i].name + "> can not be modified once set");
}
@@ -178,17 +172,17 @@ Conf::Conf() : Block("")
ValidateNotZero("options", "warningtimeout", options->Get<time_t>("warningtimeout"));
ValidateNotZero("options", "timeoutcheck", options->Get<time_t>("timeoutcheck"));
ValidateNotEmpty("options", "enforceruser", options->Get<const Anope::string &>("enforceruser"));
ValidateNotEmpty("options", "enforcerhost", options->Get<const Anope::string &>("enforcerhost"));
ValidateNotEmpty("options", "guestnickprefix", options->Get<const Anope::string &>("guestnickprefix"));
ValidateNotEmpty("options", "enforceruser", options->Get<const Anope::string>("enforceruser"));
ValidateNotEmpty("options", "enforcerhost", options->Get<const Anope::string>("enforcerhost"));
ValidateNotEmpty("options", "guestnickprefix", options->Get<const Anope::string>("guestnickprefix"));
spacesepstream(options->Get<const Anope::string &>("ulineservers")).GetTokens(this->Ulines);
spacesepstream(options->Get<const Anope::string>("ulineservers")).GetTokens(this->Ulines);
if (mail->Get<bool>("usemail"))
{
Anope::string check[] = { "sendmailpath", "sendfrom", "registration_subject", "registration_message", "emailchange_subject", "emailchange_message", "memo_subject", "memo_message" };
for (unsigned i = 0; i < sizeof(check) / sizeof(Anope::string); ++i)
ValidateNotEmpty("mail", check[i], mail->Get<const Anope::string &>(check[i]));
ValidateNotEmpty("mail", check[i], mail->Get<const Anope::string>(check[i]));
}
this->ReadTimeout = options->Get<unsigned>("readtimeout");
@@ -196,20 +190,20 @@ Conf::Conf() : Block("")
this->StrictPrivmsg = options->Get<bool>("usestrictprivmsg") ? "/msg " : "/";
{
std::vector<Anope::string> defaults;
spacesepstream(this->GetModule("nickserv")->Get<const Anope::string &>("defaults")).GetTokens(defaults);
spacesepstream(this->GetModule("nickserv")->Get<const Anope::string>("defaults")).GetTokens(defaults);
this->DefPrivmsg = std::find(defaults.begin(), defaults.end(), "msg") != defaults.end();
}
this->DefLanguage = options->Get<const Anope::string &>("defaultlanguage");
this->DefLanguage = options->Get<const Anope::string>("defaultlanguage");
this->TimeoutCheck = options->Get<time_t>("timeoutcheck");
for (int i = 0; i < this->CountBlock("uplink"); ++i)
{
Block *uplink = this->GetBlock("uplink", i);
const Anope::string &host = uplink->Get<const Anope::string &>("host");
const Anope::string &host = uplink->Get<const Anope::string>("host");
bool ipv6 = uplink->Get<bool>("ipv6");
int port = uplink->Get<int>("port");
const Anope::string &password = uplink->Get<const Anope::string &>("password");
const Anope::string &password = uplink->Get<const Anope::string>("password");
ValidateNotEmpty("uplink", "host", host);
ValidateNotEmpty("uplink", "password", password);
@@ -221,7 +215,7 @@ Conf::Conf() : Block("")
{
Block *module = this->GetBlock("module", i);
const Anope::string &modname = module->Get<const Anope::string &>("name");
const Anope::string &modname = module->Get<const Anope::string>("name");
ValidateNotEmpty("module", "name", modname);
@@ -232,11 +226,11 @@ Conf::Conf() : Block("")
{
Block *opertype = this->GetBlock("opertype", i);
const Anope::string &oname = opertype->Get<const Anope::string &>("name"),
&modes = opertype->Get<const Anope::string &>("modes"),
&inherits = opertype->Get<const Anope::string &>("inherits"),
&commands = opertype->Get<const Anope::string &>("commands"),
&privs = opertype->Get<const Anope::string &>("privs");
const Anope::string &oname = opertype->Get<const Anope::string>("name"),
&modes = opertype->Get<const Anope::string>("modes"),
&inherits = opertype->Get<const Anope::string>("inherits"),
&commands = opertype->Get<const Anope::string>("commands"),
&privs = opertype->Get<const Anope::string>("privs");
ValidateNotEmpty("opertype", "name", oname);
@@ -277,12 +271,12 @@ Conf::Conf() : Block("")
{
Block *oper = this->GetBlock("oper", i);
const Anope::string &nname = oper->Get<const Anope::string &>("name"),
&type = oper->Get<const Anope::string &>("type"),
&password = oper->Get<const Anope::string &>("password"),
&certfp = oper->Get<const Anope::string &>("certfp"),
&host = oper->Get<const Anope::string &>("host"),
&vhost = oper->Get<const Anope::string &>("vhost");
const Anope::string &nname = oper->Get<const Anope::string>("name"),
&type = oper->Get<const Anope::string>("type"),
&password = oper->Get<const Anope::string>("password"),
&certfp = oper->Get<const Anope::string>("certfp"),
&host = oper->Get<const Anope::string>("host"),
&vhost = oper->Get<const Anope::string>("vhost");
bool require_oper = oper->Get<bool>("require_oper");
ValidateNotEmpty("oper", "name", nname);
@@ -312,12 +306,12 @@ Conf::Conf() : Block("")
{
Block *service = this->GetBlock("service", i);
const Anope::string &nick = service->Get<const Anope::string &>("nick"),
&user = service->Get<const Anope::string &>("user"),
&host = service->Get<const Anope::string &>("host"),
&gecos = service->Get<const Anope::string &>("gecos"),
&modes = service->Get<const Anope::string &>("modes"),
&channels = service->Get<const Anope::string &>("channels");
const Anope::string &nick = service->Get<const Anope::string>("nick"),
&user = service->Get<const Anope::string>("user"),
&host = service->Get<const Anope::string>("host"),
&gecos = service->Get<const Anope::string>("gecos"),
&modes = service->Get<const Anope::string>("modes"),
&channels = service->Get<const Anope::string>("channels");
ValidateNotEmpty("service", "nick", nick);
ValidateNotEmpty("service", "user", user);
@@ -398,15 +392,15 @@ Conf::Conf() : Block("")
LogInfo l(logage, rawio, debug);
spacesepstream(log->Get<const Anope::string &>("target")).GetTokens(l.targets);
spacesepstream(log->Get<const Anope::string &>("source")).GetTokens(l.sources);
spacesepstream(log->Get<const Anope::string &>("admin")).GetTokens(l.admin);
spacesepstream(log->Get<const Anope::string &>("override")).GetTokens(l.override);
spacesepstream(log->Get<const Anope::string &>("commands")).GetTokens(l.commands);
spacesepstream(log->Get<const Anope::string &>("servers")).GetTokens(l.servers);
spacesepstream(log->Get<const Anope::string &>("channels")).GetTokens(l.channels);
spacesepstream(log->Get<const Anope::string &>("users")).GetTokens(l.users);
spacesepstream(log->Get<const Anope::string &>("normal")).GetTokens(l.normal);
spacesepstream(log->Get<const Anope::string>("target")).GetTokens(l.targets);
spacesepstream(log->Get<const Anope::string>("source")).GetTokens(l.sources);
spacesepstream(log->Get<const Anope::string>("admin")).GetTokens(l.admin);
spacesepstream(log->Get<const Anope::string>("override")).GetTokens(l.override);
spacesepstream(log->Get<const Anope::string>("commands")).GetTokens(l.commands);
spacesepstream(log->Get<const Anope::string>("servers")).GetTokens(l.servers);
spacesepstream(log->Get<const Anope::string>("channels")).GetTokens(l.channels);
spacesepstream(log->Get<const Anope::string>("users")).GetTokens(l.users);
spacesepstream(log->Get<const Anope::string>("normal")).GetTokens(l.normal);
this->LogInfos.push_back(l);
}
@@ -417,11 +411,11 @@ Conf::Conf() : Block("")
{
Block *command = this->GetBlock("command", i);
const Anope::string &service = command->Get<const Anope::string &>("service"),
&nname = command->Get<const Anope::string &>("name"),
&cmd = command->Get<const Anope::string &>("command"),
&permission = command->Get<const Anope::string &>("permission"),
&group = command->Get<const Anope::string &>("group");
const Anope::string &service = command->Get<const Anope::string>("service"),
&nname = command->Get<const Anope::string>("name"),
&cmd = command->Get<const Anope::string>("command"),
&permission = command->Get<const Anope::string>("permission"),
&group = command->Get<const Anope::string>("group");
bool hide = command->Get<bool>("hide");
ValidateNotEmpty("command", "service", service);
@@ -442,8 +436,8 @@ Conf::Conf() : Block("")
{
Block *privilege = this->GetBlock("privilege", i);
const Anope::string &nname = privilege->Get<const Anope::string &>("name"),
&desc = privilege->Get<const Anope::string &>("desc");
const Anope::string &nname = privilege->Get<const Anope::string>("name"),
&desc = privilege->Get<const Anope::string>("desc");
int rank = privilege->Get<int>("rank");
PrivilegeManager::AddPrivilege(Privilege(nname, desc, rank));
@@ -453,10 +447,10 @@ Conf::Conf() : Block("")
{
Block *fantasy = this->GetBlock("fantasy", i);
const Anope::string &nname = fantasy->Get<const Anope::string &>("name"),
&service = fantasy->Get<const Anope::string &>("command"),
&permission = fantasy->Get<const Anope::string &>("permission"),
&group = fantasy->Get<const Anope::string &>("group");
const Anope::string &nname = fantasy->Get<const Anope::string>("name"),
&service = fantasy->Get<const Anope::string>("command"),
&permission = fantasy->Get<const Anope::string>("permission"),
&group = fantasy->Get<const Anope::string>("group");
bool hide = fantasy->Get<bool>("hide"),
prepend_channel = fantasy->Get<bool>("prepend_channel");
@@ -475,8 +469,8 @@ Conf::Conf() : Block("")
{
Block *command_group = this->GetBlock("command_group", i);
const Anope::string &nname = command_group->Get<const Anope::string &>("name"),
&description = command_group->Get<const Anope::string &>("description");
const Anope::string &nname = command_group->Get<const Anope::string>("name"),
&description = command_group->Get<const Anope::string>("description");
CommandGroup gr;
gr.name = nname;
@@ -505,9 +499,9 @@ Conf::Conf() : Block("")
Log() << "Tied oper " << na->nc->display << " to type " << o->ot->GetName();
}
if (options->Get<const Anope::string &>("casemap", "ascii") == "ascii")
if (options->Get<const Anope::string>("casemap", "ascii") == "ascii")
Anope::casemap = std::locale(std::locale(), new Anope::ascii_ctype<char>());
else if (options->Get<const Anope::string &>("casemap") == "rfc1459")
else if (options->Get<const Anope::string>("casemap") == "rfc1459")
Anope::casemap = std::locale(std::locale(), new Anope::rfc1459_ctype<char>());
else
{
@@ -517,7 +511,7 @@ Conf::Conf() : Block("")
}
catch (const std::runtime_error &)
{
Log() << "Unknown casemap " << options->Get<const Anope::string &>("casemap") << " - casemap not changed";
Log() << "Unknown casemap " << options->Get<const Anope::string>("casemap") << " - casemap not changed";
}
}
Anope::CaseMapRebuild();
@@ -527,27 +521,27 @@ Conf::Conf() : Block("")
Log() << "Configuration option options:seed should be set. It's for YOUR safety! Remember that!";
#ifndef _WIN32
if (!options->Get<const Anope::string &>("user").empty())
if (!options->Get<const Anope::string>("user").empty())
{
errno = 0;
struct passwd *u = getpwnam(options->Get<const char *>("user"));
if (u == NULL)
Log() << "Unable to setuid to " << options->Get<const Anope::string &>("user") << ": " << Anope::LastError();
Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError();
else if (setuid(u->pw_uid) == -1)
Log() << "Unable to setuid to " << options->Get<const Anope::string &>("user") << ": " << Anope::LastError();
Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError();
else
Log() << "Successfully set user to " << options->Get<const Anope::string &>("user");
Log() << "Successfully set user to " << options->Get<const Anope::string>("user");
}
if (!options->Get<const Anope::string &>("group").empty())
if (!options->Get<const Anope::string>("group").empty())
{
errno = 0;
struct group *g = getgrnam(options->Get<const char *>("group"));
if (g == NULL)
Log() << "Unable to setgid to " << options->Get<const Anope::string &>("group") << ": " << Anope::LastError();
Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError();
else if (setuid(g->gr_gid) == -1)
Log() << "Unable to setgid to " << options->Get<const Anope::string &>("group") << ": " << Anope::LastError();
Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError();
else
Log() << "Successfully set group to " << options->Get<const Anope::string &>("group");
Log() << "Successfully set group to " << options->Get<const Anope::string>("group");
}
#endif
@@ -584,7 +578,7 @@ Block *Conf::GetModule(const Anope::string &mname)
{
Block *b = &iters.first->second;
if (b->Get<const Anope::string &>("name") == mname)
if (b->Get<const Anope::string>("name") == mname)
{
block = b;
break;
@@ -835,10 +829,10 @@ void Conf::LoadConf(File &file)
{
Block *define = this->GetBlock("define", i);
const Anope::string &dname = define->Get<const Anope::string &>("name");
const Anope::string &dname = define->Get<const Anope::string>("name");
if (dname == wordbuffer)
wordbuffer = define->Get<const Anope::string &>("value");
wordbuffer = define->Get<const Anope::string>("value");
}
if (b)
+3 -3
View File
@@ -216,7 +216,7 @@ static void write_pidfile()
atexit(remove_pidfile);
}
else
throw CoreException("Can not write to PID file " + Config->GetBlock("serverinfo")->Get<const Anope::string &>("pid"));
throw CoreException("Can not write to PID file " + Config->GetBlock("serverinfo")->Get<const Anope::string>("pid"));
}
void Anope::Init(int ac, char **av)
@@ -430,7 +430,7 @@ void Anope::Init(int ac, char **av)
/* Create me */
Configuration::Block *block = Config->GetBlock("serverinfo");
Me = new Server(NULL, block->Get<const Anope::string &>("name"), 0, block->Get<const Anope::string &>("description"), block->Get<const Anope::string &>("id"));
Me = new Server(NULL, block->Get<const Anope::string>("name"), 0, block->Get<const Anope::string>("description"), block->Get<const Anope::string>("id"));
for (botinfo_map::const_iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it)
{
it->second->server = Me;
@@ -452,7 +452,7 @@ void Anope::Init(int ac, char **av)
/* load modules */
Log() << "Loading modules...";
for (int i = 0; i < Config->CountBlock("module"); ++i)
ModuleManager::LoadModule(Config->GetBlock("module", i)->Get<const Anope::string &>("name"), NULL);
ModuleManager::LoadModule(Config->GetBlock("module", i)->Get<const Anope::string>("name"), NULL);
Module *protocol = ModuleManager::FindFirstOf(PROTOCOL);
if (protocol == NULL)
+1 -1
View File
@@ -37,7 +37,7 @@ void Language::InitLanguages()
setlocale(LC_ALL, "");
spacesepstream sep(Config->GetBlock("options")->Get<const Anope::string &>("languages"));
spacesepstream sep(Config->GetBlock("options")->Get<const Anope::string>("languages"));
Anope::string language;
while (sep.GetToken(language))
{
+7 -7
View File
@@ -14,7 +14,7 @@
#include "mail.h"
#include "config.h"
Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) : Thread(), sendmail_path(Config->GetBlock("mail")->Get<const Anope::string &>("sendmailpath")), send_from(sf), mail_to(mailto), addr(a), subject(s), message(m), dont_quote_addresses(Config->GetBlock("mail")->Get<bool>("dontquoteaddresses")), success(false)
Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) : Thread(), sendmail_path(Config->GetBlock("mail")->Get<const Anope::string>("sendmailpath")), send_from(sf), mail_to(mailto), addr(a), subject(s), message(m), dont_quote_addresses(Config->GetBlock("mail")->Get<bool>("dontquoteaddresses")), success(false)
{
}
@@ -60,19 +60,19 @@ bool Mail::Send(User *u, NickCore *nc, const BotInfo *service, const Anope::stri
if (!u)
{
if (!b->Get<bool>("usemail") || b->Get<const Anope::string &>("sendfrom").empty())
if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty())
return false;
else if (nc->email.empty())
return false;
nc->lastmail = Anope::CurTime;
Thread *t = new Mail::Message(b->Get<const Anope::string &>("sendfrom"), nc->display, nc->email, subject, message);
Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->display, nc->email, subject, message);
t->Start();
return true;
}
else
{
if (!b->Get<bool>("usemail") || b->Get<const Anope::string &>("sendfrom").empty())
if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty())
u->SendMessage(service, _("Services have been configured to not send mail."));
else if (Anope::CurTime - u->lastmail < b->Get<time_t>("delay"))
u->SendMessage(service, _("Please wait \002%d\002 seconds and retry."), b->Get<time_t>("delay") - (Anope::CurTime - u->lastmail));
@@ -81,7 +81,7 @@ bool Mail::Send(User *u, NickCore *nc, const BotInfo *service, const Anope::stri
else
{
u->lastmail = nc->lastmail = Anope::CurTime;
Thread *t = new Mail::Message(b->Get<const Anope::string &>("sendfrom"), nc->display, nc->email, subject, message);
Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->display, nc->email, subject, message);
t->Start();
return true;
}
@@ -93,11 +93,11 @@ bool Mail::Send(User *u, NickCore *nc, const BotInfo *service, const Anope::stri
bool Mail::Send(NickCore *nc, const Anope::string &subject, const Anope::string &message)
{
Configuration::Block *b = Config->GetBlock("mail");
if (!b->Get<bool>("usemail") || b->Get<const Anope::string &>("sendfrom").empty() || !nc || nc->email.empty() || subject.empty() || message.empty())
if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty() || !nc || nc->email.empty() || subject.empty() || message.empty())
return false;
nc->lastmail = Anope::CurTime;
Thread *t = new Mail::Message(b->Get<const Anope::string &>("sendfrom"), nc->display, nc->email, subject, message);
Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->display, nc->email, subject, message);
t->Start();
return true;
+1 -1
View File
@@ -382,7 +382,7 @@ bool Anope::Match(const Anope::string &str, const Anope::string &mask, bool case
if (r == NULL || r->GetExpression() != stripped_mask)
{
ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string &>("regexengine"));
ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string>("regexengine"));
if (provider)
{
try
+2 -2
View File
@@ -139,8 +139,8 @@ class CoreExport NickServRelease : public User, public Timer
* @param na The nick
* @param delay The delay before the nick is released
*/
NickServRelease(NickAlias *na, time_t delay) : User(na->nick, Config->GetBlock("options")->Get<const Anope::string &>("enforceruser"),
Config->GetBlock("options")->Get<const Anope::string &>("enforcerhost"), "", "", Me, "Services Enforcer", Anope::CurTime, "", Servers::TS6_UID_Retrieve()), Timer(delay), nick(na->nick)
NickServRelease(NickAlias *na, time_t delay) : User(na->nick, Config->GetBlock("options")->Get<const Anope::string>("enforceruser"),
Config->GetBlock("options")->Get<const Anope::string>("enforcerhost"), "", "", Me, "Services Enforcer", Anope::CurTime, "", Servers::TS6_UID_Retrieve()), Timer(delay), nick(na->nick)
{
/* Erase the current release timer and use the new one */
std::map<Anope::string, NickServRelease *>::iterator nit = NickServReleases.find(this->nick);
+2 -2
View File
@@ -349,8 +349,8 @@ bool IRCDProto::IsHostValid(const Anope::string &host)
if (host.empty() || host.length() > Config->GetBlock("networkinfo")->Get<unsigned>("hostlen"))
return false;
const Anope::string &vhostdisablebe = Config->GetBlock("networkinfo")->Get<const Anope::string &>("disallow_start_or_end"),
vhostchars = Config->GetBlock("networkinfo")->Get<const Anope::string &>("vhost_chars");
const Anope::string &vhostdisablebe = Config->GetBlock("networkinfo")->Get<const Anope::string>("disallow_start_or_end"),
vhostchars = Config->GetBlock("networkinfo")->Get<const Anope::string>("vhost_chars");
if (vhostdisablebe.find_first_of(host[0]) != Anope::string::npos)
return false;
+1 -1
View File
@@ -377,7 +377,7 @@ const Anope::string Servers::TS6_SID_Retrieve()
if (!IRCD || !IRCD->RequiresID)
return "";
static Anope::string current_sid = Config->GetBlock("options")->Get<const Anope::string &>("id");
static Anope::string current_sid = Config->GetBlock("options")->Get<const Anope::string>("id");
if (current_sid.empty())
current_sid = "00A";
+2 -2
View File
@@ -44,8 +44,8 @@ void Uplink::Connect()
Configuration::Uplink &u = Config->Uplinks[Anope::CurrentUplink];
new UplinkSocket();
if (!Config->GetBlock("serverinfo")->Get<const Anope::string &>("localhost").empty())
UplinkSock->Bind(Config->GetBlock("serverinfo")->Get<const Anope::string &>("localhost"));
if (!Config->GetBlock("serverinfo")->Get<const Anope::string>("localhost").empty())
UplinkSock->Bind(Config->GetBlock("serverinfo")->Get<const Anope::string>("localhost"));
FOREACH_MOD(I_OnPreServerConnect, OnPreServerConnect());
Anope::string ip = Anope::Resolve(u.host, u.ipv6 ? AF_INET6 : AF_INET);
Log(LOG_TERMINAL) << "Attempting to connect to uplink #" << (Anope::CurrentUplink + 1) << " " << u.host << " (" << ip << "), port " << u.port;
+1 -1
View File
@@ -322,7 +322,7 @@ void User::Collide(NickAlias *na)
if (IRCD->CanSVSNick)
{
const Anope::string &guestprefix = Config->GetBlock("options")->Get<const Anope::string &>("guestnickprefix");
const Anope::string &guestprefix = Config->GetBlock("options")->Get<const Anope::string>("guestnickprefix");
Anope::string guestnick;
+2 -2
View File
@@ -25,11 +25,11 @@ Serialize::Checker<std::multimap<Anope::string, XLine *, ci::less> > XLineManage
void XLine::InitRegex()
{
if (this->mask.length() >= 2 && this->mask[0] == '/' && this->mask[this->mask.length() - 1] == '/' && !Config->GetBlock("options")->Get<const Anope::string &>("regexengine").empty())
if (this->mask.length() >= 2 && this->mask[0] == '/' && this->mask[this->mask.length() - 1] == '/' && !Config->GetBlock("options")->Get<const Anope::string>("regexengine").empty())
{
Anope::string stripped_mask = this->mask.substr(1, this->mask.length() - 2);
ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string &>("regexengine"));
ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string>("regexengine"));
if (provider)
{
try