1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-09 01:43:12 +02:00

- Made it so me::numeric can be changed (when not linked to any servers) so no server restart

is needed anymore (#0002896).
This commit is contained in:
Bram Matthys
2006-04-29 15:17:39 +00:00
parent acbcd3cdd3
commit bdf968e11a
2 changed files with 35 additions and 1 deletions
+2
View File
@@ -1161,3 +1161,5 @@
- Updated sendnotice() so it sends a proper notice if the user is in pre-connect stage.
- Fixed bug with chinese-* charsets not getting detected properly by config parser.
Reported and patch provided by Xuefer (#0002891).
- Made it so me::numeric can be changed (when not linked to any servers) so no server restart
is needed anymore (#0002896).
+33 -1
View File
@@ -1602,6 +1602,38 @@ ConfigItem_log *ca = MyMallocEx(sizeof(ConfigItem_log));
AddListItem(ca, conf_log);
}
int isanyserverlinked(void)
{
int i;
aClient *acptr;
for (i = LastSlot; i >= 0; i--)
if ((acptr = local[i]) && (acptr != &me) && IsServer(acptr))
return 1;
return 0;
}
void applymeblock(void)
{
if (!conf_me || !me.serv)
return; /* uh-huh? */
/* Numeric change? */
if (conf_me->numeric != me.serv->numeric)
{
/* Can we apply ? */
if (!isanyserverlinked())
{
me.serv->numeric = conf_me->numeric;
} else {
config_warn("me::numeric: Numeric change detected, but change cannot be applied "
"due to being linked to other servers. Unlink all servers and /REHASH to "
"try again.");
}
}
}
int init_conf(char *rootconf, int rehash)
{
config_status("Loading IRCd configuration ..");
@@ -1681,7 +1713,7 @@ int init_conf(char *rootconf, int rehash)
abort();
}
charsys_finish();
applymeblock();
}
else
{