*TempDir = *ServerName = *Network = *ServerDesc = *AdminName = '\0';
*HideWhoisServer = *AdminEmail = *AdminNick = *diepass = *restartpass = '\0';
*CustomVersion = *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0';
- *OperOnlyStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0';
+ *UserStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0';
log_file = NULL;
NoUserDns = forcedebug = OperSpyWhois = nofork = HideBans = HideSplits = false;
CycleHosts = writelog = AllowHalfop = true;
std::ostringstream errstr; /* String stream containing the error output */
/* These tags MUST occur and must ONLY occur once in the config file */
- static char* Once[] = { "server", "admin", "files", "power", "options", "pid", NULL };
+ static char* Once[] = { "server", "admin", "files", "power", "options", NULL };
/* These tags can occur ONCE or not at all */
static InitialConfig Values[] = {
{"files", "motd", &this->motd, DT_CHARPTR, ValidateMotd},
{"files", "rules", &this->rules, DT_CHARPTR, ValidateRules},
{"power", "diepass", &this->diepass, DT_CHARPTR, NoValidation},
- {"power", "pauseval", &this->DieDelay, DT_INTEGER, NoValidation},
+ {"power", "pause", &this->DieDelay, DT_INTEGER, NoValidation},
{"power", "restartpass", &this->restartpass, DT_CHARPTR, NoValidation},
{"options", "prefixquit", &this->PrefixQuit, DT_CHARPTR, NoValidation},
{"die", "value", &this->DieValue, DT_CHARPTR, NoValidation},
{"dns", "timeout", &this->dns_timeout, DT_INTEGER, ValidateDnsTimeout},
{"options", "moduledir", &this->ModPath, DT_CHARPTR, ValidateModPath},
{"disabled", "commands", &this->DisabledCommands, DT_CHARPTR, NoValidation},
- {"options", "operonlystats", &this->OperOnlyStats, DT_CHARPTR, NoValidation},
+ {"options", "userstats", &this->UserStats, DT_CHARPTR, NoValidation},
{"options", "customversion", &this->CustomVersion, DT_CHARPTR, NoValidation},
{"options", "hidesplits", &this->HideSplits, DT_BOOLEAN, NoValidation},
{"options", "hidebans", &this->HideBans, DT_BOOLEAN, NoValidation},
if (this->LoadConf(newconfig, CONFIG_FILE, errstr))
{
/* If we succeeded, set the ircd config to the new one */
- this->config_data = newconfig;
-
-/* int c = 1;
- std::string last;
-
- for(ConfigDataHash::const_iterator i = this->config_data.begin(); i != this->config_data.end(); i++)
- {
- c = (i->first != last) ? 1 : c+1;
- last = i->first;
-
- std::cout << "[" << i->first << " " << c << "/" << this->config_data.count(i->first) << "]" << std::endl;
-
- for(KeyValList::const_iterator j = i->second.begin(); j != i->second.end(); j++)
- std::cout << "\t" << j->first << " = " << j->second << std::endl;
-
- std::cout << "[/" << i->first << " " << c << "/" << this->config_data.count(i->first) << "]" << std::endl;
- }
- */ }
+ this->config_data = newconfig;
+ }
else
{
ServerInstance->Log(DEFAULT, "There were errors in your configuration:\n%s", errstr.str().c_str());
*/
if (!bail)
{
- ServerInstance->stats->BoundPortCount = ServerInstance->BindPorts(false);
+ int found_ports;
+ ServerInstance->stats->BoundPortCount = ServerInstance->BindPorts(false, found_ports);
if (!removed_modules.empty())
for (std::vector<std::string>::iterator removing = removed_modules.begin(); removing != removed_modules.end(); removing++)
if (conf.get(real_character))
{
ServerInstance->Log(DEBUG,"Escaping %c", real_character);
+ if (real_character == 'n')
+ real_character = '\n';
line += real_character;
continue;
}
if ((*c == '\\') && (in_quote))
{
c++;
- current_value += *c;
+ if (*c == 'n')
+ current_value += '\n';
+ else
+ current_value += *c;
continue;
}
if (*c == '"')
char linebuf[MAXBUF];
F.clear();
- file = fopen(fname,"r");
+
+ if (*fname != '/')
+ {
+ std::string::size_type pos;
+ std::string confpath = CONFIG_FILE;
+ if((pos = confpath.find("/inspircd.conf")) != std::string::npos)
+ {
+ /* Leaves us with just the path */
+ std::string newfile = confpath.substr(0, pos) + std::string("/") + fname;
+ file = fopen(newfile.c_str(), "r");
+
+ }
+ }
+ else
+ file = fopen(fname, "r");
if (file)
{
while (!feof(file))
{
- fgets(linebuf,sizeof(linebuf),file);
- linebuf[strlen(linebuf)-1]='\0';
-
- if (!*linebuf)
- {
- strcpy(linebuf," ");
- }
+ fgets(linebuf, sizeof(linebuf), file);
+ linebuf[strlen(linebuf)-1] = 0;
if (!feof(file))
{
- F.push_back(linebuf);
+ F.push_back(*linebuf ? linebuf : " ");
}
}