puts("[LIMITS]");
printf(" ConnectRetry = %d\n", Conf_ConnectRetry);
- printf(" MaxConnections = %ld\n", Conf_MaxConnections);
+ printf(" MaxConnections = %d\n", Conf_MaxConnections);
printf(" MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP);
printf(" MaxJoins = %d\n", Conf_MaxJoins > 0 ? Conf_MaxJoins : -1);
printf(" MaxNickLength = %u\n", Conf_MaxNickLength - 1);
}
/**
- * Check if the given nick name is an service.
+ * Check if the given nick name is reserved for services on a particular server.
*
+ * @param ConfServer The server index to check.
+ * @param Nick The nick name to check.
* @returns true if the given nick name belongs to an "IRC service".
*/
GLOBAL bool
-Conf_IsService(int ConfServer, const char *Nick)
+Conf_NickIsService(int ConfServer, const char *Nick)
{
- return MatchCaseInsensitive(Conf_Server[ConfServer].svs_mask, Nick);
+ assert (ConfServer >= 0);
+ assert (ConfServer < MAX_SERVERS);
+
+ return MatchCaseInsensitiveList(Conf_Server[ConfServer].svs_mask,
+ Nick, ",");
+}
+
+/**
+ * Check if the given nick name is blocked for "normal client" use.
+ *
+ * @param ConfServer The server index or NONE to check all configured servers.
+ * @param Nick The nick name to check.
+ * @returns true if the given nick name belongs to an "IRC service".
+ */
+GLOBAL bool
+Conf_NickIsBlocked(const char *Nick)
+{
+ int i;
+
+ for(i = 0; i < MAX_SERVERS; i++) {
+ if (!Conf_Server[i].name[0])
+ continue;
+ if (Conf_NickIsService(i, Nick))
+ return true;
+ }
+ return false;
}
/**
Set_Defaults(bool InitServers)
{
int i;
- char random[RANDOM_SALT_LEN];
+ char random[RANDOM_SALT_LEN + 1];
/* Global */
strcpy(Conf_ServerName, "");
return;
}
if (strcasecmp(Var, "MaxConnections") == 0) {
- Conf_MaxConnections = atol(Arg);
+ Conf_MaxConnections = atoi(Arg);
if (!Conf_MaxConnections && strcmp(Arg, "0"))
Config_Error_NaN(Line, Var);
return;