+ else
+ {
+ /* Found something thats not a number, find out how much
+ * it multiplies the built up number by, multiply the total
+ * and reset the built up number.
+ */
+ if (subtotal)
+ total += subtotal * duration_multi[multiplier];
+
+ /* Next subtotal please */
+ subtotal = 0;
+ multiplier = *i;
+ times = 1;
+ }
+ }
+ if (multiplier)
+ {
+ total += subtotal * duration_multi[multiplier];
+ subtotal = 0;
+ }
+ /* Any trailing values built up are treated as raw seconds */
+ return total + subtotal;
+}
+
+bool InspIRCd::ULine(const std::string& sserver)
+{
+ if (sserver.empty())
+ return true;
+
+ return (Config->ulines.find(sserver.c_str()) != Config->ulines.end());
+}
+
+bool InspIRCd::SilentULine(const std::string& sserver)
+{
+ std::map<irc::string,bool>::iterator n = Config->ulines.find(sserver.c_str());
+ if (n != Config->ulines.end())
+ return n->second;
+ else
+ return false;
+}
+
+std::string InspIRCd::TimeString(time_t curtime)
+{
+#ifdef _WIN32
+ if (curtime < 0)
+ curtime = 0;
+#endif
+
+ struct tm* timeinfo = localtime(&curtime);
+ if (!timeinfo)
+ {
+ curtime = 0;
+ timeinfo = localtime(&curtime);
+ }
+
+ // If the calculated year exceeds four digits or is less than the year 1000,
+ // the behavior of asctime() is undefined
+ if (timeinfo->tm_year + 1900 > 9999)
+ timeinfo->tm_year = 9999 - 1900;
+ else if (timeinfo->tm_year + 1900 < 1000)
+ timeinfo->tm_year = 0;
+
+ return std::string(asctime(timeinfo),24);
+}
+
+// You should only pass a single character to this.
+void InspIRCd::AddExtBanChar(char c)
+{
+ std::string &tok = Config->data005;
+ std::string::size_type ebpos = tok.find(" EXTBAN=,");
+
+ if (ebpos == std::string::npos)
+ {
+ tok.append(" EXTBAN=,");
+ tok.push_back(c);