Skip to content
Snippets Groups Projects
Commit e96b79d8 authored by cyan's avatar cyan
Browse files

Fix for 'invalid origin' bug on the QWK master, involving not checking for

existing servers before allowing dynamic QWK connects.
parent 6cc71a6f
No related branches found
No related tags found
No related merge requests found
......@@ -1144,17 +1144,44 @@ function IRCClient_numeric482(tmp_chan_nam) {
//////////////////// Multi-numeric Display Functions ////////////////////
function IRCClient_lusers() {
// FIXME: calc invis clients
this.numeric("251", ":There are " + true_array_len(Users) + " users and 0 invisible on " + true_array_len(Servers) + " servers.");
// FIXME: calc total opers
this.numeric("252", "0 :IRC operators online.");
this.numeric("253", "0 :unknown connection(s).");
this.numeric("254", true_array_len(Channels) + " :channels formed.");
this.numeric("255", ":I have " + true_array_len(Local_Users) + " clients and " + true_array_len(Local_Servers) + " servers.");
this.numeric("250", ":Highest connection count: " + hcc_total + " (" + hcc_users + " clients.)");
this.numeric(251, ":There are " + num_noninvis_users() + " users and " + num_invis_users() + " invisible on " + true_array_len(Servers) + " servers.");
this.numeric(252, num_opers() + " :IRC operators online.");
var unknown_connections = true_array_len(Unregistered);
if (unknown_connections)
this.numeric(253, unknown_connections + " :unknown connection(s).");
this.numeric(254, true_array_len(Channels) + " :channels formed.");
this.numeric(255, ":I have " + true_array_len(Local_Users) + " clients and " + true_array_len(Local_Servers) + " servers.");
this.numeric(250, ":Highest connection count: " + hcc_total + " (" + hcc_users + " clients.)");
this.server_notice(hcc_counter + " clients have connected since " + strftime("%a %b %e %H:%M:%S %Y %Z",server_uptime));
}
function num_noninvis_users() {
var counter = 0;
for(myuser in Users) {
if (!Users[myuser].mode&USERMODE_INVISIBLE)
counter++;
}
return counter;
}
function num_invis_users() {
var counter = 0;
for(myuser in Users) {
if (Users[myuser].mode&USERMODE_INVISIBLE)
counter++;
}
return counter;
}
function num_opers() {
var counter = 0;
for(myuser in Users) {
if (Users[myuser].mode&USERMODE_OPER)
counter++;
}
return counter;
}
function IRCClient_motd() {
var motd_file = new File(system.text_dir + "ircmotd.txt");
if (motd_file.exists==false)
......
......@@ -72,7 +72,6 @@ function IRC_Server() {
this.synchronize=IRCClient_synchronize;
this.reintroduce_nick=IRCClient_reintroduce_nick;
this.finalize_server_connect=IRCClient_finalize_server_connect;
this.do_msg=IRCClient_do_msg;
// Global Functions
this.check_timeout=IRCClient_check_timeout;
this.set_chanmode=IRCClient_set_chanmode;
......
......@@ -170,6 +170,10 @@ function Unregistered_Commands() {
this.numeric461("SERVER");
break;
}
if (Servers[cmd[1].toUpperCase()]) {
this.quit("Server already exists.");
return 0;
}
var this_nline = 0;
var qwk_slave = false;
var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase();
......@@ -208,10 +212,6 @@ function Unregistered_Commands() {
this.quit("Server not configured.");
return 0;
}
if (Servers[cmd[1].toUpperCase()]) {
this.quit("Server already exists.");
return 0;
}
// Take care of registration right now.
Servers[cmd[1].toLowerCase()] = new IRC_Server;
var new_server = Servers[cmd[1].toLowerCase()];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment