diff --git a/exec/ircd.js b/exec/ircd.js index b0d70abfdeb5e9a25f4b0148030366e59d2e3cc3..8a541c38cd0a9c0a345b7c3d238df79c6c6ee460 100644 --- a/exec/ircd.js +++ b/exec/ircd.js @@ -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) diff --git a/exec/load/ircd_server.js b/exec/load/ircd_server.js index aa0120e0dedf0a309627c52dbff3e0f42c0b0b63..5131f311cb37b94032dcbbda15c3dee5dd8fdc86 100644 --- a/exec/load/ircd_server.js +++ b/exec/load/ircd_server.js @@ -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; diff --git a/exec/load/ircd_unreg.js b/exec/load/ircd_unreg.js index dbbbe01a0377422d2d596e0da2e5d77b3d7dea8f..3387655e03104dc7fcacfe5dc5049ef53bfb5f9c 100644 --- a/exec/load/ircd_unreg.js +++ b/exec/load/ircd_unreg.js @@ -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()];