- for (nspace::hash_map<std::string,command_t*>::iterator x = ServerInstance->Parser->cmdlist.begin(); x != ServerInstance->Parser->cmdlist.end(); x++)
+ for (command_table::iterator x = ServerInstance->Parser->cmdlist.begin(); x != ServerInstance->Parser->cmdlist.end(); x++)
x->second->Disable(false);
/* Now disable all the ones which the user wants disabled */
while (dcmds >> thiscmd)
{
- nspace::hash_map<std::string,command_t*>::iterator cm = ServerInstance->Parser->cmdlist.find(thiscmd);
+ command_table::iterator cm = ServerInstance->Parser->cmdlist.find(thiscmd);
+ /* If we already have a servername, and they changed it, we should throw an exception. */
+ if ((strcasecmp(conf->ServerName, data.GetString())) && (*conf->ServerName))
+ {
+ throw CoreException("Configuration error: You cannot change your servername at runtime! Please restart your server for this change to be applied.");
+ /* XXX: We don't actually reach this return of course... */
+ return false;
+ }
if (!strchr(data.GetString(),'.'))
{
conf->GetInstance()->Log(DEFAULT,"WARNING: <server:name> '%s' is not a fully-qualified domain name. Changed to '%s%c'",data.GetString(),data.GetString(),'.');