Skip to content
Snippets Groups Projects
Commit a8cfab1e authored by Randy Sommerfeld's avatar Randy Sommerfeld
Browse files

Don't allow duplicate H:Lines

parent 0c310120
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -241,6 +241,16 @@ function Read_Config_File() { ...@@ -241,6 +241,16 @@ function Read_Config_File() {
} }
} }
function HLine_Exists(str) {
var i;
for (i in HLines) {
if (HLines[i].servername.toLowerCase() == str.toLowerCase())
return true;
}
return false;
}
function ini_sections() { function ini_sections() {
this.Info = ini_Info; this.Info = ini_Info;
this.Port = ini_Port; this.Port = ini_Port;
...@@ -447,10 +457,13 @@ function ini_Ban(arg, ini) { ...@@ -447,10 +457,13 @@ function ini_Ban(arg, ini) {
/* Former H:Line */ /* Former H:Line */
/* Servermasks are deprecated */ /* Servermasks are deprecated */
function ini_Hub(arg, ini) { function ini_Hub(arg, ini) {
if (HLine_Exists(ini.Servername))
return;
HLines.push(new HLine( HLines.push(new HLine(
"*", /* servermask permitted */ "*", /* servermask permitted */
ini.Servername /* servername */ ini.Servername /* servername */
)); ));
return;
} }
/* Former C:Line and N:Line */ /* Former C:Line and N:Line */
...@@ -486,7 +499,7 @@ function ini_Server(arg, ini) { ...@@ -486,7 +499,7 @@ function ini_Server(arg, ini) {
ircclass = 0; ircclass = 0;
} }
if (ini_false_true(ini.Hub)) if (ini_false_true(ini.Hub) && !HLine_Exists(ini.Servername))
HLines.push(new HLine("*", ini.Servername)); HLines.push(new HLine("*", ini.Servername));
CLines.push(new CLine( CLines.push(new CLine(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment