+ virtual void OnRehash(User* user)
+ {
+ ConfigTag* tag = ServerInstance->Config->ConfValue("nationalchars");
+ charset = tag->getString("file");
+ casemapping = tag->getString("casemapping", ServerConfig::CleanFilename(charset.c_str()));
+ if (casemapping.find(' ') != std::string::npos)
+ throw ModuleException("<nationalchars:casemapping> must not contain any spaces!");
+#if defined _WIN32
+ if (!ServerInstance->Config->StartsWithWindowsDriveLetter(charset))
+ charset.insert(0, "./locales/");
+#else
+ if(charset[0] != '/')
+ charset.insert(0, "../locales/");
+#endif
+ unsigned char * tables[8] = { m_additional, m_additionalMB, m_additionalUp, m_lower, m_upper, m_additionalUtf8, m_additionalUtf8range, m_additionalUtf8interval };
+ if (!loadtables(charset, tables, 8, 5))
+ throw ModuleException("The locale file failed to load. Check your log file for more information.");
+ forcequit = tag->getBool("forcequit");
+ CheckForceQuit("National character set changed");
+ CheckRehash();
+ }
+
+ void CheckForceQuit(const char * message)
+ {
+ if (!forcequit)
+ return;
+
+ for (LocalUserList::const_iterator iter = ServerInstance->Users->local_users.begin(); iter != ServerInstance->Users->local_users.end(); ++iter)