rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
if (!this_nline) { | if (!this_nline || ((this_nline.password == "*") && !this.sentps)) { | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric461(command); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; for (nl in NLines) { if ((NLines[nl].password == this.password) && (NLines[nl].servername == cmd[1])) { this_nline = NLines[nl]; break; } else if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); var usernum = system.matchuser(qwkid); var bbsuser = new User(usernum); if ((this.password.toUpperCase() == bbsuser.security.password) && (bbsuser.security.restrictions&UFLAG_Q) ) { this_nline = NLines[nl]; break; } } } if (!this_nline) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.server = true; this.conntype = TYPE_SERVER; this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. this.ircclass = this.searchbyiline(); if (!this.ircclass) { this.quit("You are not authorized to use this server."); return 0; } // We meet registration criteria. Continue. hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { hcc_counter++; oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: TS"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(match_irc_mask(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :TS"); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); this.sentps = true; } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize(); }} |
cmd=cmdline.split(' '); | var cmd=cmdline.split(' '); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } var the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization.",true); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ( (!this_nline || ( (this_nline.password == "*") && !this.sentps && !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave) { this.quit("ERROR: Server not configured.",true); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists.",true); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server.",true); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server.",true); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied.",true); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); umode_notice(USERMODE_CLIENT,"Client","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); | this.numeric("004", servername + " " + VERSION + " oiwbgscrkfydnhF biklmnopstv"); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } var the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization.",true); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ( (!this_nline || ( (this_nline.password == "*") && !this.sentps && !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave) { this.quit("ERROR: Server not configured.",true); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists.",true); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server.",true); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server.",true); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied.",true); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); umode_notice(USERMODE_CLIENT,"Client","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); | server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode(true) + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } var the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization.",true); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ( (!this_nline || ( (this_nline.password == "*") && !this.sentps && !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave) { this.quit("ERROR: Server not configured.",true); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists.",true); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server.",true); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server.",true); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied.",true); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); umode_notice(USERMODE_CLIENT,"Client","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
this.numeric461(command); | this.numeric(409,":No origin specified."); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric461(command); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); var usernum = system.matchuser(qwkid); var bbsuser = new User(usernum); if ((this.password.toUpperCase() == bbsuser.security.password) && (bbsuser.security.restrictions&UFLAG_Q) ) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if (!this_nline || ((this_nline.password == "*") && !this.sentps)) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.server = true; this.conntype = TYPE_SERVER; this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. this.ircclass = this.searchbyiline(); if (!this.ircclass) { this.quit("You are not authorized to use this server."); return 0; } // We meet registration criteria. Continue. hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { hcc_counter++; oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: TS"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(match_irc_mask(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :TS"); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); this.sentps = true; } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize(); }} |
this.ircclass = this.searchbyiline(); if (!this.ircclass) { | var tmp_iline; tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric461(command); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); var usernum = system.matchuser(qwkid); var bbsuser = new User(usernum); if ((this.password.toUpperCase() == bbsuser.security.password) && (bbsuser.security.restrictions&UFLAG_Q) ) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if (!this_nline || ((this_nline.password == "*") && !this.sentps)) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.server = true; this.conntype = TYPE_SERVER; this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. this.ircclass = this.searchbyiline(); if (!this.ircclass) { this.quit("You are not authorized to use this server."); return 0; } // We meet registration criteria. Continue. hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { hcc_counter++; oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: TS"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(match_irc_mask(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :TS"); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); this.sentps = true; } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize(); }} |
this.ircclass = tmp_iline.ircclass; | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric461(command); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); var usernum = system.matchuser(qwkid); var bbsuser = new User(usernum); if ((this.password.toUpperCase() == bbsuser.security.password) && (bbsuser.security.restrictions&UFLAG_Q) ) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if (!this_nline || ((this_nline.password == "*") && !this.sentps)) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.server = true; this.conntype = TYPE_SERVER; this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. this.ircclass = this.searchbyiline(); if (!this.ircclass) { this.quit("You are not authorized to use this server."); return 0; } // We meet registration criteria. Continue. hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { hcc_counter++; oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: TS"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(match_irc_mask(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :TS"); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); this.sentps = true; } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize(); }} |
|
if ((NLines[nl].password == this.password) && (NLines[nl].servername == cmd[1])) { this_nline = NLines[nl]; break; } else if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { | if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric461(command); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; for (nl in NLines) { if ((NLines[nl].password == this.password) && (NLines[nl].servername == cmd[1])) { this_nline = NLines[nl]; break; } else if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); var usernum = system.matchuser(qwkid); var bbsuser = new User(usernum); if ((this.password.toUpperCase() == bbsuser.security.password) && (bbsuser.security.restrictions&UFLAG_Q) ) { this_nline = NLines[nl]; break; } } } if (!this_nline || ((this_nline.password == "*") && !this.sentps)) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.server = true; this.conntype = TYPE_SERVER; this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. this.ircclass = this.searchbyiline(); if (!this.ircclass) { this.quit("You are not authorized to use this server."); return 0; } // We meet registration criteria. Continue. hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { hcc_counter++; oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: TS"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(match_irc_mask(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :TS"); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); this.sentps = true; } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize(); }} |
} else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric461(command); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; for (nl in NLines) { if ((NLines[nl].password == this.password) && (NLines[nl].servername == cmd[1])) { this_nline = NLines[nl]; break; } else if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); var usernum = system.matchuser(qwkid); var bbsuser = new User(usernum); if ((this.password.toUpperCase() == bbsuser.security.password) && (bbsuser.security.restrictions&UFLAG_Q) ) { this_nline = NLines[nl]; break; } } } if (!this_nline || ((this_nline.password == "*") && !this.sentps)) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.server = true; this.conntype = TYPE_SERVER; this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. this.ircclass = this.searchbyiline(); if (!this.ircclass) { this.quit("You are not authorized to use this server."); return 0; } // We meet registration criteria. Continue. hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { hcc_counter++; oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: TS"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(match_irc_mask(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :TS"); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); this.sentps = true; } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize(); }} |
|
if ((!this_nline || ((this_nline.password == "*") && !this.sentps)) && !qwk_slave) { | if ( (!this_nline || ( (this_nline.password == "*") && !this.sentps && !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave) { | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization.",true); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ((!this_nline || ((this_nline.password == "*") && !this.sentps)) && !qwk_slave) { this.quit("ERROR: Server not configured.",true); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists.",true); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server.",true); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline; tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server.",true); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied.",true); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
var tmp_iline; tmp_iline = this.searchbyiline(); | var tmp_iline = this.searchbyiline(); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization.",true); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ((!this_nline || ((this_nline.password == "*") && !this.sentps)) && !qwk_slave) { this.quit("ERROR: Server not configured.",true); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists.",true); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server.",true); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline; tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server.",true); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied.",true); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
this.uprefix = "~" + parse_username(cmd[1]); | var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; | function IRCClient_unregistered_commands(command, cmdline) { cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric461(command); break; } if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } this_nline = ""; for (nl in NLines) { if ((NLines[nl].password == this.password) && (NLines[nl].servername == cmd[1])) { this_nline = NLines[nl]; break; } } if (!this_nline) { this.rawout("ERROR :Server not configured."); this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.rawout("ERROR :Server already exists."); this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1]; this.hops = cmd[2]; this.realname = ircstring(cmdline); this.server = true; this.conntype = TYPE_SERVER; this.linkparent = servername; break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); this.uprefix = "~" + parse_username(cmd[1]); break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*")) { // We meet registration criteria. Continue. hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running Synchronet IRCD " + version); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + version + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); server_wallops("Client Connect: " + this.ircnuh + " (" + this.realname + ")"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " " + this.decip + " 0 :" + this.realname); } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { hcc_counter++; server_wallops("SERVER Connect: " + this.nick + " (" + this.realname + ")"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(CLines[cl].servername == this.nick) { this.rawout("PASS " + CLines[cl].password + " :TS"); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); this.sentps = true; } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize(); }} |
} if (this.password && (unreg_username || (this.nick != "*"))) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } | function IRCClient_unregistered_commands(command, cmdline) { cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric461(command); break; } if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } this_nline = ""; for (nl in NLines) { if ((NLines[nl].password == this.password) && (NLines[nl].servername == cmd[1])) { this_nline = NLines[nl]; break; } } if (!this_nline) { this.rawout("ERROR :Server not configured."); this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.rawout("ERROR :Server already exists."); this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1]; this.hops = cmd[2]; this.realname = ircstring(cmdline); this.server = true; this.conntype = TYPE_SERVER; this.linkparent = servername; break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); this.uprefix = "~" + parse_username(cmd[1]); break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*")) { // We meet registration criteria. Continue. hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running Synchronet IRCD " + version); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + version + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); server_wallops("Client Connect: " + this.ircnuh + " (" + this.realname + ")"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " " + this.decip + " 0 :" + this.realname); } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { hcc_counter++; server_wallops("SERVER Connect: " + this.nick + " (" + this.realname + ")"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(CLines[cl].servername == this.nick) { this.rawout("PASS " + CLines[cl].password + " :TS"); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); this.sentps = true; } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize(); }} |
|
this.quit("No QWK master available for authorization."); | this.quit("No QWK master available for authorization.",true); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization."); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ((!this_nline || ((this_nline.password == "*") && !this.sentps)) && !qwk_slave) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline; tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server."); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied."); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
this.quit("ERROR: Server not configured."); | this.quit("ERROR: Server not configured.",true); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization."); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ((!this_nline || ((this_nline.password == "*") && !this.sentps)) && !qwk_slave) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline; tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server."); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied."); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
this.quit("ERROR: Server already exists."); | this.quit("ERROR: Server already exists.",true); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization."); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ((!this_nline || ((this_nline.password == "*") && !this.sentps)) && !qwk_slave) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline; tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server."); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied."); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
this.quit("You've been K:Lined from this server."); | this.quit("You've been K:Lined from this server.",true); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization."); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ((!this_nline || ((this_nline.password == "*") && !this.sentps)) && !qwk_slave) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline; tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server."); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied."); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
this.quit("You are not authorized to use this server."); | this.quit("You are not authorized to use this server.",true); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization."); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ((!this_nline || ((this_nline.password == "*") && !this.sentps)) && !qwk_slave) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline; tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server."); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied."); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
this.quit("Denied."); | this.quit("Denied.",true); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization."); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ((!this_nline || ((this_nline.password == "*") && !this.sentps)) && !qwk_slave) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline; tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server."); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied."); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); | umode_notice(USERMODE_CLIENT,"Client","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } var the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && match_irc_mask(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization.",true); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ( (!this_nline || ( (this_nline.password == "*") && !this.sentps && !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave) { this.quit("ERROR: Server not configured.",true); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists.",true); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; if (!qwk_slave) { // qwk slaves should never be hubs. this.server = true; this.conntype = TYPE_SERVER; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server.",true); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server.",true); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied.",true); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { this.finalize_server_connect("TS"); }} |
this.sentps = true; | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.ircout("PONG " + servername + " :" + ircstring(cmdline)); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } var this_nline = 0; for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && match_irc_mask(cmd[1],NLines[nl].servername)) { var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); var usernum = system.matchuser(qwkid); var bbsuser = new User(usernum); if ((this.password.toUpperCase() == bbsuser.security.password) && (bbsuser.security.restrictions&UFLAG_Q) ) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].password == this.password) && (match_irc_mask(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if (!this_nline || ((this_nline.password == "*") && !this.sentps)) { this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1].toLowerCase(); this.hops = cmd[2]; this.realname = ircstring(cmdline); this.server = true; this.conntype = TYPE_SERVER; this.linkparent = servername; this.parent = this.id; this.flags = this_nline.flags; for (hl in HLines) { if (HLines[hl].servername.toUpperCase() == this.nick.toUpperCase()) { this.hub = true; break; } } break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*")) && !this.server) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*") && !this.server) { // Check for a valid I:Line. var tmp_iline; tmp_iline = this.searchbyiline(); if (!tmp_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server."); return 0; } if (tmp_iline.password) { if (tmp_iline.password != this.password) { this.numeric(464, ":Password Incorrect."); this.quit("Denied."); return 0; } } // We meet registration criteria. Continue. this.ircclass = tmp_iline.ircclass; hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname); /// Otherwise, it's a server trying to connect. } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { hcc_counter++; oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: TS"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(match_irc_mask(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :TS"); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); this.sentps = true; } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize(); }} |
|
this.numeric("002", ":Your host is " + servername + ", running Synchronet IRCD " + VERSION); | this.numeric("002", ":Your host is " + servername + ", running " + VERSION); | function IRCClient_unregistered_commands(command, cmdline) { if (command.match(/^[0-9]+/)) return 0; // we ignore all numerics from unregistered clients. cmd=cmdline.split(' '); switch(command) { case "CAPAB": break; // silently ignore for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } the_nick = ircstring(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PING": if (!cmd[1]) { this.numeric461(command); break; } if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } this_nline = ""; for (nl in NLines) { if ((NLines[nl].password == this.password) && (NLines[nl].servername == cmd[1])) { this_nline = NLines[nl]; break; } } if (!this_nline) { this.rawout("ERROR :Server not configured."); this.quit("ERROR: Server not configured."); return 0; } if (searchbyserver(cmd[1])) { this.rawout("ERROR :Server already exists."); this.quit("ERROR: Server already exists."); return 0; } this.nick = cmd[1]; this.hops = cmd[2]; this.realname = ircstring(cmdline); this.server = true; this.conntype = TYPE_SERVER; this.linkparent = servername; this.parent = this.id; break; case "USER": if (this.server) { this.numeric462(); break; } if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = ircstring(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(ircstring(cmdline),true); return; default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*"))) { if (unreg_username) var usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) var usernum = system.matchuser(this.nick); if (usernum) { bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (count_local_nicks() + count_servers(false)) > hcc_total) hcc_total = count_local_nicks() + count_servers(false); if (count_local_nicks() > hcc_users) hcc_users = count_local_nicks(); if (this.realname && this.uprefix && (this.nick != "*")) { // Check for a valid I:Line. this.ircclass = this.searchbyiline(); if (!this.ircclass) { this.quit("You are not authorized to use this server."); return 0; } // We meet registration criteria. Continue. hcc_counter++; this.conntype = TYPE_USER; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh); this.numeric("002", ":Your host is " + servername + ", running Synchronet IRCD " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oi biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); this.lusers(); this.motd(); oper_notice("Notice","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " " + this.decip + " 0 :" + this.realname); } else if (this.nick.match("[.]") && this.hops && this.realname && this.server && (this.conntype == TYPE_SERVER)) { hcc_counter++; oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: TS"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(CLines[cl].servername == this.nick) { this.rawout("PASS " + CLines[cl].password + " :TS"); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); this.sentps = true; } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize(); }} |
server_wallops("!ERROR: Client has bogus conntype!"); | oper_notice("Notice","Client has bogus conntype!"); | function IRCClient_work() { if (!this.socket.is_connected) { this.quit("Connection reset by peer",true); return 0; } if (this.socket.data_waiting && (cmdline=this.socket.recvline(4096,0)) ) { if(cmdline==null) return 0; // nothing to do // Allow only 512 bytes per RFC for clients, however, servers // are allowed to fill up the entire buffer for bandwidth // savings, since we trust them more. if(!this.server) cmdline=cmdline.slice(0,512); // Some (broken) clients add extra CR garbage to the // beginning (end) of a line. Fix. // Eventually we should just strip cmdline of all // invalid characters, including these and NUL (00) // among others. if ((cmdline[0] == "\r") || (cmdline[0] == "\n")) cmdline=cmdline.slice(1); if (debug) log(format("[%s<-%s]: %s",servername,this.nick,cmdline)); cmd=cmdline.split(' '); if (cmdline[0] == ":") { // Silently ignore NULL originator commands. if (!cmd[1]) return 0; // if :<originator> doesn't match nick of originating // socket, drop silently per RFC. origin = cmd[0].slice(1); if ((this.conntype == TYPE_USER) && (origin.toUpperCase() != this.nick.toUpperCase())) return 0; command = cmd[1].toUpperCase(); cmdline = cmdline.slice(cmdline.indexOf(" ")+1); } else { command = cmd[0].toUpperCase(); origin = this.nick; } this.idletime = time(); if (this.conntype == TYPE_UNREGISTERED) { this.unregistered_commands(command,cmdline); } else if (this.conntype == TYPE_USER) { this.registered_commands(command,cmdline); } else if (this.conntype == TYPE_SERVER) { this.server_commands(origin,command,cmdline); } else { log("!ERROR: Client has bogus conntype!"); server_wallops("!ERROR: Client has bogus conntype!"); } } if ( (this.pinged) && ((time() - this.pinged) > pingtimeout_time) ) { this.pinged = false; this.quit("Ping Timeout",true); } else if (!this.pinged && ((time() - this.idletime) > ping_time)) { this.pinged = time(); this.rawout("PING :" + servername); }} |
if ( (this.pinged) && ((time() - this.pinged) > pingtimeout_time) ) { this.pinged = false; this.quit("Ping Timeout",true); } else if (!this.pinged && ((time() - this.idletime) > ping_time)) { this.pinged = time(); this.rawout("PING :" + servername); | if (this.nick) { if ( (this.pinged) && ((time() - this.pinged) > YLines[this.ircclass].pingfreq) ) { this.pinged = false; this.quit("Ping Timeout",true); } else if (!this.pinged && ((time() - this.idletime) > YLines[this.ircclass].pingfreq)) { this.pinged = time(); this.rawout("PING :" + servername); } | function IRCClient_work() { if (!this.socket.is_connected) { this.quit("Connection reset by peer",true); return 0; } if (this.socket.data_waiting && (cmdline=this.socket.recvline(4096,0)) ) { if(cmdline==null) return 0; // nothing to do // Allow only 512 bytes per RFC for clients, however, servers // are allowed to fill up the entire buffer for bandwidth // savings, since we trust them more. if(!this.server) cmdline=cmdline.slice(0,512); // Some (broken) clients add extra CR garbage to the // beginning (end) of a line. Fix. // Eventually we should just strip cmdline of all // invalid characters, including these and NUL (00) // among others. if ((cmdline[0] == "\r") || (cmdline[0] == "\n")) cmdline=cmdline.slice(1); if (debug) log(format("[%s<-%s]: %s",servername,this.nick,cmdline)); cmd=cmdline.split(' '); if (cmdline[0] == ":") { // Silently ignore NULL originator commands. if (!cmd[1]) return 0; // if :<originator> doesn't match nick of originating // socket, drop silently per RFC. origin = cmd[0].slice(1); if ((this.conntype == TYPE_USER) && (origin.toUpperCase() != this.nick.toUpperCase())) return 0; command = cmd[1].toUpperCase(); cmdline = cmdline.slice(cmdline.indexOf(" ")+1); } else { command = cmd[0].toUpperCase(); origin = this.nick; } this.idletime = time(); if (this.conntype == TYPE_UNREGISTERED) { this.unregistered_commands(command,cmdline); } else if (this.conntype == TYPE_USER) { this.registered_commands(command,cmdline); } else if (this.conntype == TYPE_SERVER) { this.server_commands(origin,command,cmdline); } else { log("!ERROR: Client has bogus conntype!"); server_wallops("!ERROR: Client has bogus conntype!"); } } if ( (this.pinged) && ((time() - this.pinged) > pingtimeout_time) ) { this.pinged = false; this.quit("Ping Timeout",true); } else if (!this.pinged && ((time() - this.idletime) > ping_time)) { this.pinged = time(); this.rawout("PING :" + servername); }} |
log("!ERROR: Client has bogus conntype!"); | function IRCClient_work() { var command; var cmdline; var origin; if (!this.socket.is_connected) { this.quit("Connection reset by peer",true); return 0; } if (this.socket.data_waiting && (cmdline=this.socket.recvline(4096,0)) ) { if(cmdline==null) return 0; // nothing to do // Allow only 512 bytes per RFC for clients, however, servers // are allowed to fill up the entire buffer for bandwidth // savings, since we trust them more. if(!this.server) cmdline=cmdline.slice(0,512); // Some (broken) clients add extra CR garbage to the // beginning (end) of a line. Fix. // Eventually we should just strip cmdline of all // invalid characters, including these and NUL (00) // among others. if ((cmdline[0] == "\r") || (cmdline[0] == "\n")) cmdline=cmdline.slice(1); if (debug) log(format("[%s<-%s]: %s",servername,this.nick,cmdline)); cmd=cmdline.split(' '); if (cmdline[0] == ":") { // Silently ignore NULL originator commands. if (!cmd[1]) return 0; // if :<originator> doesn't match nick of originating // socket, drop silently per RFC. origin = cmd[0].slice(1); if ((this.conntype == TYPE_USER) && (origin.toUpperCase() != this.nick.toUpperCase())) return 0; command = cmd[1].toUpperCase(); cmdline = cmdline.slice(cmdline.indexOf(" ")+1); } else { command = cmd[0].toUpperCase(); origin = this.nick; } this.idletime = time(); if (this.conntype == TYPE_UNREGISTERED) { this.unregistered_commands(command,cmdline); } else if (this.conntype == TYPE_USER) { this.registered_commands(command,cmdline); } else if (this.conntype == TYPE_SERVER) { this.server_commands(origin,command,cmdline); } else { log("!ERROR: Client has bogus conntype!"); oper_notice("Notice","Client has bogus conntype!"); } } if (this.nick) { if ( (this.pinged) && ((time() - this.pinged) > YLines[this.ircclass].pingfreq) ) { this.pinged = false; this.quit("Ping Timeout",true); } else if (!this.pinged && ((time() - this.idletime) > YLines[this.ircclass].pingfreq)) { this.pinged = time(); this.rawout("PING :" + servername); } }} |
|
if (!this.server && (command.match(/^[0-9]+/))) return 0; | function IRCClient_work() { if (!this.socket.is_connected) { this.quit("Connection reset by peer",true); return 0; } if (this.socket.data_waiting && (cmdline=this.socket.recvline(4096,0)) ) { if(cmdline==null) return 0; // nothing to do // Allow only 512 bytes per RFC for clients, however, servers // are allowed to fill up the entire buffer for bandwidth // savings, since we trust them more. if(!this.server) cmdline=cmdline.slice(0,512); // Some (broken) clients add extra CR garbage to the // beginning (end) of a line. Fix. // Eventually we should just strip cmdline of all // invalid characters, including these and NUL (00) // among others. if ((cmdline[0] == "\r") || (cmdline[0] == "\n")) cmdline=cmdline.slice(1); if (debug) log(format("[%s<-%s]: %s",servername,this.nick,cmdline)); cmd=cmdline.split(' '); if (cmdline[0] == ":") { // Silently ignore NULL originator commands. if (!cmd[1]) return 0; // if :<originator> doesn't match nick of originating // socket, drop silently per RFC. origin = cmd[0].slice(1); if ((this.conntype == TYPE_USER) && (origin.toUpperCase() != this.nick.toUpperCase())) return 0; command = cmd[1].toUpperCase(); cmdline = cmdline.slice(cmdline.indexOf(" ")+1); } else { command = cmd[0].toUpperCase(); origin = this.nick; } if (!this.server && (command.match(/^[0-9]+/))) return 0; // possible numeric from user, ignore per RFC this.idletime = time(); if (this.conntype == TYPE_UNREGISTERED) { this.unregistered_commands(command,cmdline); } else if (this.conntype == TYPE_USER) { this.registered_commands(command,cmdline); } else if (this.conntype == TYPE_SERVER) { this.server_commands(origin,command,cmdline); } else { log("!ERROR: Client has bogus conntype!"); server_wallops("!ERROR: Client has bogus conntype!"); } } if ( (this.pinged) && ((time() - this.pinged) > pingtimeout_time) ) { this.pinged = false; this.quit("Ping Timeout",true); } else if (!this.pinged && ((time() - this.idletime) > ping_time)) { this.pinged = time(); this.rawout("PING :" + servername); }} |
|
this.quit("Connection reset by peer",true); | this.quit("Connection reset by peer"); | function IRCClient_work() { var command; var cmdline; var origin; if (!this.socket.is_connected) { this.quit("Connection reset by peer",true); return 0; } if (this.socket.data_waiting && (cmdline=this.socket.recvline(4096,0)) ) { if(cmdline==null) return 0; // nothing to do // Allow only 512 bytes per RFC for clients, however, servers // are allowed to fill up the entire buffer for bandwidth // savings, since we trust them more. if(!this.server) cmdline=cmdline.slice(0,512); // Some (broken) clients add extra CR garbage to the // beginning (end) of a line. Fix. // Eventually we should just strip cmdline of all // invalid characters, including these and NUL (00) // among others. if ((cmdline[0] == "\r") || (cmdline[0] == "\n")) cmdline=cmdline.slice(1); if (debug) log(format("[%s<-%s]: %s",servername,this.nick,cmdline)); cmd=cmdline.split(' '); if (cmdline[0] == ":") { // Silently ignore NULL originator commands. if (!cmd[1]) return 0; // if :<originator> doesn't match nick of originating // socket, drop silently per RFC. origin = cmd[0].slice(1); if ((this.conntype == TYPE_USER) && (origin.toUpperCase() != this.nick.toUpperCase())) return 0; command = cmd[1].toUpperCase(); cmdline = cmdline.slice(cmdline.indexOf(" ")+1); } else { command = cmd[0].toUpperCase(); origin = this.nick; } this.idletime = time(); if (this.conntype == TYPE_UNREGISTERED) { this.unregistered_commands(command,cmdline); } else if (this.conntype == TYPE_USER) { this.registered_commands(command,cmdline); } else if (this.conntype == TYPE_SERVER) { this.server_commands(origin,command,cmdline); } else { oper_notice("Notice","Client has bogus conntype!"); } } if (this.nick) { if ( (this.pinged) && ((time() - this.pinged) > YLines[this.ircclass].pingfreq) ) { this.pinged = false; this.quit("Ping Timeout",true); } else if (!this.pinged && ((time() - this.idletime) > YLines[this.ircclass].pingfreq)) { this.pinged = time(); this.rawout("PING :" + servername); } }} |
this.quit("Ping Timeout",true); | this.quit("Ping Timeout"); | function IRCClient_work() { var command; var cmdline; var origin; if (!this.socket.is_connected) { this.quit("Connection reset by peer",true); return 0; } if (this.socket.data_waiting && (cmdline=this.socket.recvline(4096,0)) ) { if(cmdline==null) return 0; // nothing to do // Allow only 512 bytes per RFC for clients, however, servers // are allowed to fill up the entire buffer for bandwidth // savings, since we trust them more. if(!this.server) cmdline=cmdline.slice(0,512); // Some (broken) clients add extra CR garbage to the // beginning (end) of a line. Fix. // Eventually we should just strip cmdline of all // invalid characters, including these and NUL (00) // among others. if ((cmdline[0] == "\r") || (cmdline[0] == "\n")) cmdline=cmdline.slice(1); if (debug) log(format("[%s<-%s]: %s",servername,this.nick,cmdline)); cmd=cmdline.split(' '); if (cmdline[0] == ":") { // Silently ignore NULL originator commands. if (!cmd[1]) return 0; // if :<originator> doesn't match nick of originating // socket, drop silently per RFC. origin = cmd[0].slice(1); if ((this.conntype == TYPE_USER) && (origin.toUpperCase() != this.nick.toUpperCase())) return 0; command = cmd[1].toUpperCase(); cmdline = cmdline.slice(cmdline.indexOf(" ")+1); } else { command = cmd[0].toUpperCase(); origin = this.nick; } this.idletime = time(); if (this.conntype == TYPE_UNREGISTERED) { this.unregistered_commands(command,cmdline); } else if (this.conntype == TYPE_USER) { this.registered_commands(command,cmdline); } else if (this.conntype == TYPE_SERVER) { this.server_commands(origin,command,cmdline); } else { oper_notice("Notice","Client has bogus conntype!"); } } if (this.nick) { if ( (this.pinged) && ((time() - this.pinged) > YLines[this.ircclass].pingfreq) ) { this.pinged = false; this.quit("Ping Timeout",true); } else if (!this.pinged && ((time() - this.idletime) > YLines[this.ircclass].pingfreq)) { this.pinged = time(); this.rawout("PING :" + servername); } }} |
} else { oper_notice("Notice","Client has bogus conntype!"); | } else { umode_notice(UMODE_OPER,"Notice", "Client has bogus conntype!"); | function IRCClient_work() { var command; var cmdline; var origin; if (!this.socket.is_connected) { this.quit("Connection reset by peer"); return 0; } if (this.socket.data_waiting && (cmdline=this.socket.recvline(4096,0)) ) { if(cmdline==null) return 0; // nothing to do // Allow only 512 bytes per RFC for clients, however, servers // are allowed to fill up the entire buffer for bandwidth // savings, since we trust them more. if(!this.server) cmdline=cmdline.slice(0,512); // Some (broken) clients add extra CR garbage to the // beginning (end) of a line. Fix. // Eventually we should just strip cmdline of all // invalid characters, including these and NUL (00) // among others. if ((cmdline[0] == "\r") || (cmdline[0] == "\n")) cmdline=cmdline.slice(1); if (debug) log(format("[%s<-%s]: %s",servername,this.nick,cmdline)); cmd=cmdline.split(' '); if (cmdline[0] == ":") { // Silently ignore NULL originator commands. if (!cmd[1]) return 0; // if :<originator> doesn't match nick of originating // socket, drop silently per RFC. origin = cmd[0].slice(1); if ((this.conntype == TYPE_USER) && (origin.toUpperCase() != this.nick.toUpperCase())) return 0; command = cmd[1].toUpperCase(); cmdline = cmdline.slice(cmdline.indexOf(" ")+1); } else { command = cmd[0].toUpperCase(); origin = this.nick; } this.idletime = time(); if (this.conntype == TYPE_UNREGISTERED) { this.unregistered_commands(command,cmdline); } else if (this.conntype == TYPE_USER) { this.registered_commands(command,cmdline); } else if (this.conntype == TYPE_SERVER) { this.server_commands(origin,command,cmdline); } else { oper_notice("Notice","Client has bogus conntype!"); } }} |
if (!this.sendq.bytes && !sendsock.send(send_data + "\r\n")) | if (this.sendq.bytes || !sendsock.send(send_data + "\r\n")) | function ircout(str) { var send_data; var sendsock; if (debug) log(format("[%s->%s]: %s",servername,this.nick,str)); if(this.local) { sendsock = this.socket; } else if (this.parent) { sendsock = Servers[this.parent.toLowerCase()].socket; } else { log(LOG_ERR,"!ERROR: No socket to send to?"); return 0; } send_data = ":" + servername + " " + str; if (!this.sendq.bytes && !sendsock.send(send_data + "\r\n")) this.sendq.add(send_data);} |
sendsock = Servers[this.parent].socket; | sendsock = Servers[this.parent.toLowerCase()].socket; | function ircout(str) { var sendsock; if (debug) log(format("[%s->%s]: %s",servername,this.nick,str)); if(this.local) { sendsock = this.socket; } else if (this.parent) { sendsock = Servers[this.parent].socket; } else { log("!ERROR: No socket to send to?"); return 0; } if (!writeout(sendsock,":" + servername + " " + str)) this.flagged_for_quit = "Socket write failed miserably";} |
var cindex; | function ircstring(str,startword) { if (startword) { for(sw_counter=0;sw_counter<startword;sw_counter++) { str=str.slice(str.indexOf(" ")+1); } } cindex = str.indexOf(":")+1; if (!cindex) cindex = str.lastIndexOf(" ")+1; if (!cindex) return str; return(str.slice(cindex));} |
|
this.x11 = (agt.indexOf("x11") != -1); this.mac = (agt.indexOf("macintosh") != -1); this.win = (agt.indexOf("windows") != -1); | function Is () { // convert all characters to lowercase to simplify testing var agt=navigator.userAgent.toLowerCase(); this.major = parseInt(navigator.appVersion); this.minor = parseFloat(navigator.appVersion); this.nav = ((agt.indexOf('mozilla') != -1) && ((agt.indexOf('spoofer') == -1) && (agt.indexOf('compatible') == -1))); this.gecko = (this.nav && (agt.indexOf('gecko') != -1)); this.ie = (agt.indexOf("msie") != -1);} // Is |
|
var parentNode = element.parentNode; return drop._containers.detect(function(c) { return parentNode == c }); | var containmentNode; if(drop.tree) { containmentNode = element.treeNode; } else { containmentNode = element.parentNode; } return drop._containers.detect(function(c) { return containmentNode == c }); | isContained: function(element, drop) { var parentNode = element.parentNode; return drop._containers.detect(function(c) { return parentNode == c }); }, |
return this.startContent != tinyMCE.trim(this.getBody().innerHTML) && !tinyMCE.isNotDirty; | return tinyMCE.trim(this.startContent) != tinyMCE.trim(this.getBody().innerHTML) && !tinyMCE.isNotDirty; | isDirty : function() { // Is content modified and not in a submit procedure return this.startContent != tinyMCE.trim(this.getBody().innerHTML) && !tinyMCE.isNotDirty; }, |
return targetElement.style.display == "none"; | return targetElement.style.display == "none" || (targetElement.style.display == "" && targetElement.className.indexOf("hidden") >= 0); | function isElementHidden(namespace, elementId) { var targetElement = getNamespacedElement(namespace, elementId); return targetElement.style.display == "none";} |
} | }, | isFinished: function() { return this.current > this.finish; } |
if (tinyMCE.isMSIE) | var s; if (tinyMCE.isIE) | isHidden : function() { if (tinyMCE.isMSIE) return false; var s = this.getSel(); // Weird, wheres that cursor selection? return (!s || !s.rangeCount || s.rangeCount == 0); }, |
var s = this.getSel(); | s = this.getSel(); | isHidden : function() { if (tinyMCE.isMSIE) return false; var s = this.getSel(); // Weird, wheres that cursor selection? return (!s || !s.rangeCount || s.rangeCount == 0); }, |
if (document.jsEnabled == undefined) { | if (typeof document.jsEnabled == 'undefined') { | function isJsEnabled() { if (document.jsEnabled == undefined) { // Note: ! casts to boolean implicitly. document.jsEnabled = !( !document.getElementsByTagName || !document.createElement || !document.createTextNode || !document.getElementById); } return document.jsEnabled;} |
!document.documentElement || | function isJsEnabled() { if (typeof document.jsEnabled == 'undefined') { // Note: ! casts to boolean implicitly. document.jsEnabled = !( !document.getElementsByTagName || !document.createElement || !document.createTextNode || !document.getElementById); } return document.jsEnabled;} |
|
return 1; | return KLines[the_kl]; | function isklined(kl_str) { for(the_kl in KLines) { if (KLines[the_kl].hostmask && IRC_match(kl_str,KLines[the_kl].hostmask)) return 1; } return 0;} |
} | }, | isMultiWindowMode:function() { return this._isQueryParameterTrue('multiWindow'); } |
if (this.pageLoadError) throw this.pageLoadError; | this.isNewPageLoaded = function() { return self.newPageLoaded; }; |
|
LOG.error("isNewPageLoaded found an old pageLoadError"); | this.isNewPageLoaded = function() { if (this.pageLoadError) { var e = this.pageLoadError; this.pageLoadError = null; throw e; } return self.newPageLoaded; }; |
|
return c === " " || c === "\n" || c === "\t"; | return c === " " || c === "\r" || c === "\n" || c === "\t" || c === "\f"; | function isWhitespace(c) { return c === " " || c === "\n" || c === "\t"; }; |
var self = this; return { index: index, toString: function(index) { return self.variableName + "[" + this.index + "]"; } } | return this.variableName + "[" + index + "]"; | EqualsArray.prototype.item = function(index) { var self = this; return { index: index, toString: function(index) { return self.variableName + "[" + this.index + "]"; } }} |
if (e.originalTarget.tagName == "IMG") { | if (targetName == "img") { | function izOnMouseClick(e){ if (e.which == nsIPrefBranchObj.getIntPref("triggerbutton")){ if (haveZoomed){ e.preventDefault(); e.stopPropagation(); } else { // contextmenu on mousedown if (contextDisabled) { document.popupNode = e.originalTarget; izContext.showPopup(izContext.ownerDocument.documentElement, e.clientX, e.clientY, "context", "bottomleft", "topleft"); } } cancelScrollZoom(); gPanelContainer().removeEventListener("click",izOnMouseClick,true); } if (mousedown){ // Invoke varios mouse function when mouse is over an image only if (e.originalTarget.tagName == "IMG") { switch(e.which){ // Middle mouse button pressed while right button down, reset image case nsIPrefBranchObj.getIntPref("imageresetbutton"): e.preventDefault(); e.stopPropagation(); haveZoomed = true; var oizImage = new izImage(e.originalTarget); oizImage.setZoom(100); reportStatus(oizImage); break; // Left mouse button pressed while right button down, fit image to screen case nsIPrefBranchObj.getIntPref("imagefitbutton"): e.preventDefault(); e.stopPropagation(); haveZoomed = true; var oizImage = new izImage(e.originalTarget); oizImage.fit(nsIPrefBranchObj.getBoolPref("autocenter")); reportStatus(oizImage); break; } } else { gPanelContainer().removeEventListener("click",izOnMouseClick,true); } }} |
(mousedown) && | function izOnMouseDown(e){ if ( (e.originalTarget.tagName == "IMG") && ( (e.which == nsIPrefBranchObj.getIntPref("imageresetbutton")) || (e.which == nsIPrefBranchObj.getIntPref("imagefitbutton")) || (e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) ) ) { e.preventDefault(); e.stopPropagation(); } // prepare for the mouse functions on a right click when user option is true if ((e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) && (nsIPrefBranchObj.getBoolPref("usescroll"))) { if ((e.originalTarget.tagName == "IMG") || (nsIPrefBranchObj.getIntPref("scrollZoomMode") != 2)) { if (nsIPrefBranchObj.getIntPref("scrollZoomMode") == 2) { currentImage = e.originalTarget; } if (navigator.platform != "Win32" && navigator.platform != "OS/2") { addEventListener("popupshowing", disableContextMenu, true); } haveZoomed = false; gPanelContainer().addEventListener("DOMMouseScroll",ScrollImage,true); gPanelContainer().addEventListener("mouseup",izOnMouseUp,true); gPanelContainer().addEventListener("click",izOnMouseClick,true); gPanelContainer().addEventListener("mouseout", izOnMouseOut, true); currentURL = window._content.document.location; mousedown = true; } }} |
|
(e.originalTarget.tagName == "IMG") && | (targetName == "img") && | function izOnMouseDown(e){ if ( (e.originalTarget.tagName == "IMG") && (mousedown) && ( (e.which == nsIPrefBranchObj.getIntPref("imageresetbutton")) || (e.which == nsIPrefBranchObj.getIntPref("imagefitbutton")) || (e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) ) ) { e.preventDefault(); e.stopPropagation(); } // prepare for the mouse functions on a right click when user option is true if ((e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) && (nsIPrefBranchObj.getBoolPref("usescroll"))) { if ((e.originalTarget.tagName == "IMG") || (nsIPrefBranchObj.getIntPref("scrollZoomMode") != 2)) { if (nsIPrefBranchObj.getIntPref("scrollZoomMode") == 2) { currentImage = e.originalTarget; } if (navigator.platform != "Win32" && navigator.platform != "OS/2") { addEventListener("popupshowing", disableContextMenu, true); } haveZoomed = false; gPanelContainer().addEventListener("DOMMouseScroll",ScrollImage,true); gPanelContainer().addEventListener("mouseup",izOnMouseUp,true); gPanelContainer().addEventListener("click",izOnMouseClick,true); gPanelContainer().addEventListener("mouseout", izOnMouseOut, true); currentURL = window._content.document.location; mousedown = true; } }} |
if ((e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) && (nsIPrefBranchObj.getBoolPref("usescroll"))) | if ((e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) && (nsIPrefBranchObj.getBoolPref("usescroll")) && !(targetName == "embed" || targetName == "object")) | function izOnMouseDown(e){ if ( (e.originalTarget.tagName == "IMG") && (mousedown) && ( (e.which == nsIPrefBranchObj.getIntPref("imageresetbutton")) || (e.which == nsIPrefBranchObj.getIntPref("imagefitbutton")) || (e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) ) ) { e.preventDefault(); e.stopPropagation(); } // prepare for the mouse functions on a right click when user option is true if ((e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) && (nsIPrefBranchObj.getBoolPref("usescroll"))) { if ((e.originalTarget.tagName == "IMG") || (nsIPrefBranchObj.getIntPref("scrollZoomMode") != 2)) { if (nsIPrefBranchObj.getIntPref("scrollZoomMode") == 2) { currentImage = e.originalTarget; } if (navigator.platform != "Win32" && navigator.platform != "OS/2") { addEventListener("popupshowing", disableContextMenu, true); } haveZoomed = false; gPanelContainer().addEventListener("DOMMouseScroll",ScrollImage,true); gPanelContainer().addEventListener("mouseup",izOnMouseUp,true); gPanelContainer().addEventListener("click",izOnMouseClick,true); gPanelContainer().addEventListener("mouseout", izOnMouseOut, true); currentURL = window._content.document.location; mousedown = true; } }} |
if ((e.originalTarget.tagName == "IMG") || (nsIPrefBranchObj.getIntPref("scrollZoomMode") != 2)) | if ((targetName == "img") || (nsIPrefBranchObj.getIntPref("scrollZoomMode") != 2)) | function izOnMouseDown(e){ if ( (e.originalTarget.tagName == "IMG") && (mousedown) && ( (e.which == nsIPrefBranchObj.getIntPref("imageresetbutton")) || (e.which == nsIPrefBranchObj.getIntPref("imagefitbutton")) || (e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) ) ) { e.preventDefault(); e.stopPropagation(); } // prepare for the mouse functions on a right click when user option is true if ((e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) && (nsIPrefBranchObj.getBoolPref("usescroll"))) { if ((e.originalTarget.tagName == "IMG") || (nsIPrefBranchObj.getIntPref("scrollZoomMode") != 2)) { if (nsIPrefBranchObj.getIntPref("scrollZoomMode") == 2) { currentImage = e.originalTarget; } if (navigator.platform != "Win32" && navigator.platform != "OS/2") { addEventListener("popupshowing", disableContextMenu, true); } haveZoomed = false; gPanelContainer().addEventListener("DOMMouseScroll",ScrollImage,true); gPanelContainer().addEventListener("mouseup",izOnMouseUp,true); gPanelContainer().addEventListener("click",izOnMouseClick,true); gPanelContainer().addEventListener("mouseout", izOnMouseOut, true); currentURL = window._content.document.location; mousedown = true; } }} |
if ( (e.originalTarget.tagName == "IMG") && ( (e.which == nsIPrefBranchObj.getIntPref("imageresetbutton")) || (e.which == nsIPrefBranchObj.getIntPref("imagefitbutton")) || (e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) ) ) { e.preventDefault(); e.stopPropagation(); } | function izOnMouseDown(e){ // prepare for the mouse functions on a right click when user option is true if ((e.which == nsIPrefBranchObj.getIntPref("triggerbutton")) && (nsIPrefBranchObj.getBoolPref("usescroll"))) { if ((e.originalTarget.tagName == "IMG") || (nsIPrefBranchObj.getIntPref("scrollZoomMode") != 2)) { if (nsIPrefBranchObj.getIntPref("scrollZoomMode") == 2) { currentImage = e.originalTarget; } if (navigator.platform != "Win32" && navigator.platform != "OS/2") { addEventListener("popupshowing", disableContextMenu, true); } haveZoomed = false; gPanelContainer().addEventListener("DOMMouseScroll",ScrollImage,true); gPanelContainer().addEventListener("mouseup",izOnMouseUp,true); gPanelContainer().addEventListener("click",izOnMouseClick,true); gPanelContainer().addEventListener("mouseout", izOnMouseOut, true); currentURL = window._content.document.location; mousedown = true; } }} |
|
if ((e.originalTarget.tagName.toUpperCase() == "HTML") || (e.originalTarget.tagName == "xul:browser")){ | if ((e.originalTarget.tagName.toLowerCase() == "html") || (e.originalTarget.tagName.toLowerCase() == "xul:browser")){ | function izOnMouseOut(e) { if ((e.originalTarget.tagName.toUpperCase() == "HTML") || (e.originalTarget.tagName == "xul:browser")){ cancelScrollZoom(); }} |
for (var i in obj) { t += document.js_dump(obj[i], name +'.'+i); | var hold = new Array(); for (var i in obj) hold[hold.length] = i; hold = hold.sort(); for (var i = 0; i < hold.length; i++) { var n = hold[i]; t += document.js_dump(obj[n], name +'.'+n); | document.js_dump = function (obj, name) { var t = ''; if (! name) { name = '[obj]'; t = 'Dump:\n' } if (typeof(obj) != 'object') return name+'='+obj+'\n'; for (var i in obj) { t += document.js_dump(obj[i], name +'.'+i); } return t;} |
this.db.owner = this; | function jsAC(input, db) { var ac = this; this.input = input; this.db = db; this.db.owner = this; this.input.onkeydown = function (event) { return ac.onkeydown(this, event); }; this.input.onkeyup = function (event) { ac.onkeyup(this, event) }; this.input.onblur = function () { ac.hidePopup() }; this.popup = document.createElement('div'); this.popup.id = 'autocomplete'; this.popup.owner = this;}; |
|
removeStyleClass(currentRow, "current"); | currentRow.removeStyleClass("current"); | function jumpToLine(sourceId, line){ var script = scripts[sourceId]; if (line <= 0 || !script) return; var file = files[script.file]; if (!file) return; if (currentFile != script.file) loadFile(script.file, true); if (currentRow) removeStyleClass(currentRow, "current"); if (!file.element) return; if (line > file.element.firstChild.childNodes.length) return; currentRow = file.element.firstChild.childNodes.item(line - 1); if (!currentRow) return; addStyleClass(currentRow, "current"); var sourcesDiv = document.getElementById("sources"); var sourcesDocument = document.getElementById("sources").contentDocument; var parent = sourcesDocument.body; var offset = totalOffsetTop(currentRow, parent); if (offset < (parent.scrollTop + 20) || offset > (parent.scrollTop + sourcesDiv.clientHeight - 20)) parent.scrollTop = totalOffsetTop(currentRow, parent) - (sourcesDiv.clientHeight / 2) + 10;} |
addStyleClass(currentRow, "current"); | currentRow.addStyleClass("current"); | function jumpToLine(sourceId, line){ var script = scripts[sourceId]; if (line <= 0 || !script) return; var file = files[script.file]; if (!file) return; if (currentFile != script.file) loadFile(script.file, true); if (currentRow) removeStyleClass(currentRow, "current"); if (!file.element) return; if (line > file.element.firstChild.childNodes.length) return; currentRow = file.element.firstChild.childNodes.item(line - 1); if (!currentRow) return; addStyleClass(currentRow, "current"); var sourcesDiv = document.getElementById("sources"); var sourcesDocument = document.getElementById("sources").contentDocument; var parent = sourcesDocument.body; var offset = totalOffsetTop(currentRow, parent); if (offset < (parent.scrollTop + 20) || offset > (parent.scrollTop + sourcesDiv.clientHeight - 20)) parent.scrollTop = totalOffsetTop(currentRow, parent) - (sourcesDiv.clientHeight / 2) + 10;} |
if(!event.keyCode==Event.KEY_ESC) return; | if(event.keyCode!=Event.KEY_ESC) return; | keyPress: function(event) { if(!event.keyCode==Event.KEY_ESC) return; this.finishDrag(event, false); Event.stop(event); }, |
LOG.error(e); if (e instanceof TypeError) { throw e; } this.commandError(e.message); | this.handleCommandError(e); | this.kickoffNextCommandExecution = function() { var command; if (starting_up == true) { command = this.firstCommand(); starting_up = false; } else { command = this.nextCommand(); } if (!command) return TEST_FINISHED; // Make the current row blue this.commandStarted(command); LOG.debug("Executing: |" + command.command + " | " + command.target + " | " + command.value + " |"); var result; try { var handler = this.commandFactory.getCommandHandler(command.command); if(handler == null) { throw new Error("Unknown command: '" + command.command + "'"); } command.target = selenium.preprocessParameter(command.target); command.value = selenium.preprocessParameter(command.value); result = handler.execute(selenium, command); } catch (e) { LOG.error(e); // TODO: only throw typed errors from commands so that we can perform better error handling // to differentiate between expected command errors and unexpected javascript errors. if (e instanceof TypeError) { // Not a command error. throw e; } this.commandError(e.message); return TEST_FINISHED; } // Record the result so that we can continue the execution using window.setTimeout() this.lastCommandResult = result; if (result.processState == SELENIUM_PROCESS_WAIT) { this.waitForCondition = function() { return selenium.browserbot.isNewPageLoaded(); }; } if (this.waitForCondition) { this.pollUntilConditionIsTrue(); } else { // Continue processing this.continueCommandExecutionWithDelay(); } // Test is not finished. return TEST_CONTINUE; }; |
LOG.error(e); | this.kickoffNextCommandExecution = function() { var command; if (starting_up == true) { command = this.firstCommand(); starting_up = false; } else { command = this.nextCommand(); } if (!command) return TEST_FINISHED; // Make the current row blue this.commandStarted(command); var result; try { var handler = this.commandFactory.getCommandHandler(command.command); if(handler == null) { throw new Error("Unknown command"); } result = handler.execute(selenium, command); } catch (e) { // TODO: only throw typed errors from commands so that we can perform better error handling // to differentiate between expected command errors and unexpected javascript errors. if (e instanceof TypeError) { // Not a command error. throw e; } this.commandError(e.message); return TEST_FINISHED; } // Record the result so that we can continue the execution using window.setTimeout() this.lastCommandResult = result; if (result.processState == SELENIUM_PROCESS_WAIT) { executionContext.waitForPageLoad(this,selenium); } else { // Continue processing this.continueCommandExecutionWithDelay(); } // Test is not finished. return TEST_CONTINUE; }; |
|
throw new Error("Unknown command"); | throw new Error("Unknown command: '" + command.command + "'"); | this.kickoffNextCommandExecution = function() { var command; if (starting_up == true) { command = this.firstCommand(); starting_up = false; } else { command = this.nextCommand(); } if (!command) return TEST_FINISHED; // Make the current row blue this.commandStarted(command); LOG.debug("Executing: |" + command.command + " | " + command.target + " | " + command.value + " |"); var result; try { var handler = this.commandFactory.getCommandHandler(command.command); if(handler == null) { throw new Error("Unknown command"); } result = handler.execute(selenium, command); } catch (e) { LOG.error(e); // TODO: only throw typed errors from commands so that we can perform better error handling // to differentiate between expected command errors and unexpected javascript errors. if (e instanceof TypeError) { // Not a command error. throw e; } this.commandError(e.message); return TEST_FINISHED; } // Record the result so that we can continue the execution using window.setTimeout() this.lastCommandResult = result; if (result.processState == SELENIUM_PROCESS_WAIT) { executionContext.waitForPageLoad(this,selenium); } else { // Continue processing this.continueCommandExecutionWithDelay(); } // Test is not finished. return TEST_CONTINUE; }; |
return document.frames['myiframe']; | return frames['myiframe']; | function KonquerorIFrameExecutionContext() { this.loadFrame = function() { return document.getElementById('myiframe'); }; this.open = function(target,frame) { frame.src = target; }; this.getContentWindow = function(frame) { return document.frames['myiframe']; }; this.waitForPageLoad = function(testloop,selenium) { // Since we're waiting for page to reload, we can't continue command execution // directly, we need use a page load listener. // TODO there is a potential race condition by attaching a load listener after // the command has completed execution. selenium.callOnNextPageLoad(function() {eval("testLoop.continueCommandExecutionWithDelay()");}); };} |
KonquerorPageBot = function(pageWindow) { | var KonquerorPageBot = function(pageWindow) { | KonquerorPageBot = function(pageWindow) { PageBot.call(this, pageWindow);}; |
} | }, | last: function() { return this[this.length - 1]; } |
if(!isNav4) getObject(layer).innerHTML = file_loader.document.body.innerHTML; | if(!isNav4) { var o = getObject(layer); o.innerHTML = ""; o.innerHTML = file_loader.document.body.innerHTML; } | function layerLoadHandler(file_loader){ var layer = (isNav4? this.name: file_loader.layer_name); var properties = (isNav4? this.properties: file_loader.properties); if(!isNav4) getObject(layer).innerHTML = file_loader.document.body.innerHTML; boundPopup(layer); addPopup(layer, properties); captureMouseEvent(popupMove); show(layer);} |
var layer = (isNav4? this: file_loader.layer_name); | var layer = (isNav4? this.name: file_loader.layer_name); | function layerLoadHandler(file_loader){ var layer = (isNav4? this: file_loader.layer_name); var properties = (isNav4? this.properties: file_loader.properties); if(!isNav4) getObject(layer).innerHTML = file_loader.document.body.innerHTML; boundPopup(layer); addPopup(layer, "none", properties); captureMouseEvent(popupMove); show(layer);} |
addPopup(layer, "none", properties); | addPopup(layer, properties); | function layerLoadHandler(file_loader){ var layer = (isNav4? this.name: file_loader.layer_name); var properties = (isNav4? this.properties: file_loader.properties); if(!isNav4) getObject(layer).innerHTML = file_loader.document.body.innerHTML; boundPopup(layer); addPopup(layer, "none", properties); captureMouseEvent(popupMove); show(layer);} |
var self = this; return { toString: function(index) { return self.variableName + ".length"; } } | return this.variableName + ".length"; | EqualsArray.prototype.length = function() { var self = this; return { toString: function(index) { return self.variableName + ".length"; } }} |
this.hfg=8; this.hbg=1; | this.dfg=8; this.dbg=1; | function Lightbar(items){ this.fg=7; this.bg=1; this.xpos=1; this.ypos=1; this.direction=0; this.hfg=1; this.hbg=7; this.hfg=8; this.hbg=1; this.kfg=15; this.khfg=15; this.current=0; this.align=0; this.force_width=-1; this.getval=Lightbar_getval; this.draw=Lightbar_draw; this.clear=Lightbar_clearitems; this.add=Lightbar_additem; this.failsafe_getval=Lightbar_failsafe_getval; this.lpadding=null; this.rpadding=null; this.hblanks=2; this.hotkeys=''; if(items==undefined) this.items=new Array(); else this.items=items;} |
this.draw=Lightbar_draw; | function Lightbar(items){ this.fg=7; this.bg=1; this.xpos=1; this.ypos=1; this.direction=0; this.hfg=1; this.hbg=7; this.kfg=15; this.khfg=15; this.current=0; this.align=0; this.force_width=-1; this.getval=Lightbar_getval; this.clear=Lightbar_clearitems; this.add=Lightbar_additem; this.failsafe_getval=Lightbar_failsafe_getval; if(items==undefined) this.items=new Array(); else this.items=items;} |
|
if(!this.items[i].disabled) { | if(this.items[i].disabled) console.attributes=dattr; else { | function Lightbar_draw(current){ var attr=this.bg<<4|this.fg; var cattr=this.hbg<<4|this.hfg; var dattr=this.dbg<<4|this.dfg; var kattr=this.bg<<4|this.kfg; var kcattr=this.hbg<<4|this.khfg; var ret=undefined; if(current!=undefined) this.current=current; if(!(user.settings & USER_ANSI)) { return; } if(!(user.settings & USER_COLOR)) { return; } if(this.direction < 0 || this.direction > 1) { alert("Unknown lightbar direction!"); return; } /* Check that a vertical lightbar fits on the screen */ if(this.direction==0 && (this.ypos+this.items.length-1 > console.screen_rows)) { alert("Screen too short for lightbar!"); return; } /* Ensure current is valid */ if(this.current<0 || this.current >= this.items.length) { alert("current parameter is out of range!"); this.current=0; if(this.items.length<=0) return; } var orig_cur=this.current; while(this.items[this.current].retval==undefined || this.items[this.current].disabled) { this.current++; if(this.current==this.items.length) this.current=0; if(this.current==orig_cur) { alert("No items with a return value!"); return; } } /* Check that a horizontal lightbar fits on the screen */ if(this.direction==1) { var end=this.xpos; var i; for(i=0; i<this.items.length; i++) { if(this.force_width>0) { end+=this.force_width+1; continue; } if(this.items[i].width==undefined) { if(this.items[i]==undefined) { alert("Sparse items array!"); return; } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return; } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); end+=cleaned.length+1; } else { end+=this.items[i].width } } } var i; var j; var k; /* Draw items */ var curx=this.xpos; var cury=this.ypos; var cursx=this.xpos; var cursy=this.ypos; var item_count=0; for(i=0; i<this.items.length; i++) { var width; // Some basic validation. if(this.items[i]==undefined) { alert("Sparse items array!"); return; } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return; } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); if(this.force_width>0) width=this.force_width; else { width=cleaned.length; if(this.items[i].width!=undefined) width=this.items[i].width; } var lpadding=this.lpadding; var rpadding=this.rpadding; if(this.items[i].lpadding!=undefined) lpadding=this.items[i].lpadding; if(this.items[i].rpadding!=undefined) rpadding=this.items[i].rpadding; console.gotoxy(curx, cury); if(lpadding != undefined && lpadding != null) { console.attributes=attr; console.write(lpadding); curx+= lpadding.length; } if(i==this.current) { cursx=curx; cursy=cury; } k=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } for(;k<width-cleaned.length;k++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } for(;k<(width-cleaned.length)/2;k++) console.write(' '); } } for(j=0; j<this.items[i].text.length; j++) { if(width > -1 && k > width) break; if(this.items[i].text.substr(j,1)=='|') { if(!this.items[i].disabled) { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; } j++; } else { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } } console.write(this.items[i].text.substr(j,1)); k++; } if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } while(k<width) { console.write(" "); k++; } if(rpadding != undefined && rpadding != null) { console.attributes=attr; console.write(rpadding); curx+= rpadding.length; } if(this.direction==0) { cury++; curx=this.xpos; } else { console.attributes=attr; curx+=width; for(j=0; j<this.hblanks; j++) { console.write(" "); curx++; } } if(this.items[i].retval!=undefined) item_count++; } if(item_count==0) { alert("No items with a return value!"); return; }} |
if(!this.items[i].disabled) { | if(this.items[i].disabled) console.attributes=dattr; else { | function Lightbar_getval(current){ var attr=this.bg<<4|this.fg; var cattr=this.hbg<<4|this.hfg; var dattr=this.dbg<<4|this.dfg; var kattr=this.bg<<4|this.kfg; var kcattr=this.hbg<<4|this.khfg; var ret=undefined; var last_cur; if(current!=undefined) this.current=current; if(!(user.settings & USER_ANSI)) { return(this.failsafe_getval()); } if(!(user.settings & USER_COLOR)) { return(this.failsafe_getval()); } if(this.direction < 0 || this.direction > 1) { alert("Unknown lightbar direction!"); return(this.failsafe_getval()); } /* Check that a vertical lightbar fits on the screen */ if(this.direction==0 && (this.ypos+this.items.length-1 > console.screen_rows)) { alert("Screen too short for lightbar!"); return(this.failsafe_getval()); } /* Ensure current is valid */ if(this.current<0 || this.current >= this.items.length) { alert("current parameter is out of range!"); this.current=0; if(this.items.length<=0) return(null); } var orig_cur=this.current; while(this.items[this.current].retval==undefined || this.items[this.current].disabled) { this.current++; if(this.current==this.items.length) this.current=0; if(this.current==orig_cur) { alert("No items with a return value!"); return(undefined); } } /* Check that a horizontal lightbar fits on the screen */ if(this.direction==1) { var end=this.xpos; var i; for(i=0; i<this.items.length; i++) { if(this.force_width>0) { end+=this.force_width+1; continue; } if(this.items[i].width==undefined) { if(this.items[i]==undefined) { alert("Sparse items array!"); return(null); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); end+=cleaned.length+1; } else { end+=this.items[i].width } } } this.draw(); last_cur=this.current; /* Main loop */ while(1) { var i; var j; var k; /* Draw items */ var curx=this.xpos; var cury=this.ypos; var cursx=this.xpos; var cursy=this.ypos; var item_count=0; for(i=0; i<this.items.length; i++) { var width; // Some basic validation. if(this.items[i]==undefined) { alert("Sparse items array!"); return(this.failsafe_getval()); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); if(this.force_width>0) width=this.force_width; else { width=cleaned.length; if(this.items[i].width!=undefined) width=this.items[i].width; } var lpadding=this.lpadding; var rpadding=this.rpadding; if(this.items[i].lpadding!=undefined) lpadding=this.items[i].lpadding; if(this.items[i].rpadding!=undefined) rpadding=this.items[i].rpadding; if(lpadding != undefined && lpadding != null) curx+= lpadding.length; if(i==this.current || i==last_cur) { console.gotoxy(curx, cury); if(i==this.current) { cursx=curx; cursy=cury; } k=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } for(;k<width-cleaned.length;k++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } for(;k<(width-cleaned.length)/2;k++) console.write(' '); } } for(j=0; j<this.items[i].text.length; j++) { if(width > -1 && k > width) break; if(this.items[i].text.substr(j,1)=='|') { if(!this.items[i].disabled) { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; } j++; } else { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } } console.write(this.items[i].text.substr(j,1)); k++; } if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } while(k<width) { console.write(" "); k++; } } if(rpadding != undefined && rpadding != null) curx+= rpadding.length; if(this.direction==0) { cury++; curx=this.xpos; } else curx+=width+this.hblanks; if(this.items[i].retval!=undefined) item_count++; } if(item_count==0) { alert("No items with a return value!"); return(undefined); } console.gotoxy(cursx,cursy); if(ret!=undefined) return(ret); last_cur=this.current; /* Get input */ var key=console.getkey(K_UPPER); if(this.hotkeys.indexOf(key)!=-1) return(key); switch(key) { case KEY_UP: if(this.direction==0) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_DOWN: if(this.direction==0) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_LEFT: if(this.direction==1) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_RIGHT: if(this.direction==1) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_HOME: this.current=0; while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; } break; case KEY_END: this.current=this.items.length-1; while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined) { if(this.current==0) this.current=this.items.length; this.current--; } break; case '\r': case '\n': if(this.items[this.current].retval==undefined) return(undefined); return(this.items[this.current].retval); break; default: for(i=0; i<this.items.length; i++) { if((!this.items[i].disabled) && (this.items[i].text.indexOf('|'+key)!=-1 || this.items[i].text.indexOf('|'+key.toLowerCase())!=-1)) { if(this.items[i].retval==undefined) continue; this.current=i; /* Let it go through once more to highlight */ ret=this.items[this.current].retval; break; } } break; } }} |
} while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); | } while(this.items[this.current].disabled || this.items[this.current].retval==undefined); | function Lightbar_getval(current){ var attr=this.bg<<4|this.fg; var cattr=this.hbg<<4|this.hfg; var dattr=this.dbg<<4|this.dfg; var kattr=this.bg<<4|this.kfg; var kcattr=this.hbg<<4|this.khfg; var ret=undefined; var last_cur; if(current!=undefined) this.current=current; if(!(user.settings & USER_ANSI)) { return(this.failsafe_getval()); } if(!(user.settings & USER_COLOR)) { return(this.failsafe_getval()); } if(this.direction < 0 || this.direction > 1) { alert("Unknown lightbar direction!"); return(this.failsafe_getval()); } /* Check that a vertical lightbar fits on the screen */ if(this.direction==0 && (this.ypos+this.items.length-1 > console.screen_rows)) { alert("Screen too short for lightbar!"); return(this.failsafe_getval()); } /* Ensure current is valid */ if(this.current<0 || this.current >= this.items.length) { alert("current parameter is out of range!"); this.current=0; if(this.items.length<=0) return(null); } var orig_cur=this.current; while(this.items[this.current].retval==undefined || this.items[this.current].disabled) { this.current++; if(this.current==this.items.length) this.current=0; if(this.current==orig_cur) { alert("No items with a return value!"); return(undefined); } } /* Check that a horizontal lightbar fits on the screen */ if(this.direction==1) { var end=this.xpos; var i; for(i=0; i<this.items.length; i++) { if(this.force_width>0) { end+=this.force_width+1; continue; } if(this.items[i].width==undefined) { if(this.items[i]==undefined) { alert("Sparse items array!"); return(null); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); end+=cleaned.length+1; } else { end+=this.items[i].width } } } this.draw(); last_cur=this.current; /* Main loop */ while(1) { var i; var j; var k; /* Draw items */ var curx=this.xpos; var cury=this.ypos; var cursx=this.xpos; var cursy=this.ypos; var item_count=0; for(i=0; i<this.items.length; i++) { var width; // Some basic validation. if(this.items[i]==undefined) { alert("Sparse items array!"); return(this.failsafe_getval()); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); if(this.force_width>0) width=this.force_width; else { width=cleaned.length; if(this.items[i].width!=undefined) width=this.items[i].width; } var lpadding=this.lpadding; var rpadding=this.rpadding; if(this.items[i].lpadding!=undefined) lpadding=this.items[i].lpadding; if(this.items[i].rpadding!=undefined) rpadding=this.items[i].rpadding; if(lpadding != undefined && lpadding != null) curx+= lpadding.length; if(i==this.current || i==last_cur) { console.gotoxy(curx, cury); if(i==this.current) { cursx=curx; cursy=cury; } k=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } for(;k<width-cleaned.length;k++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } for(;k<(width-cleaned.length)/2;k++) console.write(' '); } } for(j=0; j<this.items[i].text.length; j++) { if(width > -1 && k > width) break; if(this.items[i].text.substr(j,1)=='|') { if(!this.items[i].disabled) { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; } j++; } else { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } } console.write(this.items[i].text.substr(j,1)); k++; } if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } while(k<width) { console.write(" "); k++; } } if(rpadding != undefined && rpadding != null) curx+= rpadding.length; if(this.direction==0) { cury++; curx=this.xpos; } else curx+=width+this.hblanks; if(this.items[i].retval!=undefined) item_count++; } if(item_count==0) { alert("No items with a return value!"); return(undefined); } console.gotoxy(cursx,cursy); if(ret!=undefined) return(ret); last_cur=this.current; /* Get input */ var key=console.getkey(K_UPPER); if(this.hotkeys.indexOf(key)!=-1) return(key); switch(key) { case KEY_UP: if(this.direction==0) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_DOWN: if(this.direction==0) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_LEFT: if(this.direction==1) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_RIGHT: if(this.direction==1) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_HOME: this.current=0; while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; } break; case KEY_END: this.current=this.items.length-1; while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined) { if(this.current==0) this.current=this.items.length; this.current--; } break; case '\r': case '\n': if(this.items[this.current].retval==undefined) return(undefined); return(this.items[this.current].retval); break; default: for(i=0; i<this.items.length; i++) { if((!this.items[i].disabled) && (this.items[i].text.indexOf('|'+key)!=-1 || this.items[i].text.indexOf('|'+key.toLowerCase())!=-1)) { if(this.items[i].retval==undefined) continue; this.current=i; /* Let it go through once more to highlight */ ret=this.items[this.current].retval; break; } } break; } }} |
while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined) { | while(this.items[this.current].disabled || this.items[this.current].retval==undefined) { | function Lightbar_getval(current){ var attr=this.bg<<4|this.fg; var cattr=this.hbg<<4|this.hfg; var dattr=this.dbg<<4|this.dfg; var kattr=this.bg<<4|this.kfg; var kcattr=this.hbg<<4|this.khfg; var ret=undefined; var last_cur; if(current!=undefined) this.current=current; if(!(user.settings & USER_ANSI)) { return(this.failsafe_getval()); } if(!(user.settings & USER_COLOR)) { return(this.failsafe_getval()); } if(this.direction < 0 || this.direction > 1) { alert("Unknown lightbar direction!"); return(this.failsafe_getval()); } /* Check that a vertical lightbar fits on the screen */ if(this.direction==0 && (this.ypos+this.items.length-1 > console.screen_rows)) { alert("Screen too short for lightbar!"); return(this.failsafe_getval()); } /* Ensure current is valid */ if(this.current<0 || this.current >= this.items.length) { alert("current parameter is out of range!"); this.current=0; if(this.items.length<=0) return(null); } var orig_cur=this.current; while(this.items[this.current].retval==undefined || this.items[this.current].disabled) { this.current++; if(this.current==this.items.length) this.current=0; if(this.current==orig_cur) { alert("No items with a return value!"); return(undefined); } } /* Check that a horizontal lightbar fits on the screen */ if(this.direction==1) { var end=this.xpos; var i; for(i=0; i<this.items.length; i++) { if(this.force_width>0) { end+=this.force_width+1; continue; } if(this.items[i].width==undefined) { if(this.items[i]==undefined) { alert("Sparse items array!"); return(null); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); end+=cleaned.length+1; } else { end+=this.items[i].width } } } this.draw(); last_cur=this.current; /* Main loop */ while(1) { var i; var j; var k; /* Draw items */ var curx=this.xpos; var cury=this.ypos; var cursx=this.xpos; var cursy=this.ypos; var item_count=0; for(i=0; i<this.items.length; i++) { var width; // Some basic validation. if(this.items[i]==undefined) { alert("Sparse items array!"); return(this.failsafe_getval()); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); if(this.force_width>0) width=this.force_width; else { width=cleaned.length; if(this.items[i].width!=undefined) width=this.items[i].width; } var lpadding=this.lpadding; var rpadding=this.rpadding; if(this.items[i].lpadding!=undefined) lpadding=this.items[i].lpadding; if(this.items[i].rpadding!=undefined) rpadding=this.items[i].rpadding; if(lpadding != undefined && lpadding != null) curx+= lpadding.length; if(i==this.current || i==last_cur) { console.gotoxy(curx, cury); if(i==this.current) { cursx=curx; cursy=cury; } k=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } for(;k<width-cleaned.length;k++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } for(;k<(width-cleaned.length)/2;k++) console.write(' '); } } for(j=0; j<this.items[i].text.length; j++) { if(width > -1 && k > width) break; if(this.items[i].text.substr(j,1)=='|') { if(!this.items[i].disabled) { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; } j++; } else { if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } } console.write(this.items[i].text.substr(j,1)); k++; } if(this.current==i) console.attributes=cattr; else { if(this.items[i].disabled) console.attributes=dattr; else console.attributes=attr; } while(k<width) { console.write(" "); k++; } } if(rpadding != undefined && rpadding != null) curx+= rpadding.length; if(this.direction==0) { cury++; curx=this.xpos; } else curx+=width+this.hblanks; if(this.items[i].retval!=undefined) item_count++; } if(item_count==0) { alert("No items with a return value!"); return(undefined); } console.gotoxy(cursx,cursy); if(ret!=undefined) return(ret); last_cur=this.current; /* Get input */ var key=console.getkey(K_UPPER); if(this.hotkeys.indexOf(key)!=-1) return(key); switch(key) { case KEY_UP: if(this.direction==0) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_DOWN: if(this.direction==0) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_LEFT: if(this.direction==1) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_RIGHT: if(this.direction==1) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined); } break; case KEY_HOME: this.current=0; while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; } break; case KEY_END: this.current=this.items.length-1; while(this.items[this.current]!=disabled || this.items[this.current].retval==undefined) { if(this.current==0) this.current=this.items.length; this.current--; } break; case '\r': case '\n': if(this.items[this.current].retval==undefined) return(undefined); return(this.items[this.current].retval); break; default: for(i=0; i<this.items.length; i++) { if((!this.items[i].disabled) && (this.items[i].text.indexOf('|'+key)!=-1 || this.items[i].text.indexOf('|'+key.toLowerCase())!=-1)) { if(this.items[i].retval==undefined) continue; this.current=i; /* Let it go through once more to highlight */ ret=this.items[this.current].retval; break; } } break; } }} |
if(this.items[i]==undefined) { alert("Sparse items array!"); return(this.failsafe_getval()); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } | function Lightbar_getval(current){ var attr=this.bg<<4|this.fg; var cattr=this.hbg<<4|this.hfg; var kattr=this.bg<<4|this.kfg; var kcattr=this.hbg<<4|this.khfg; var ret=undefined; if(current!=undefined) this.current=current; if(!(user.settings & USER_ANSI)) { return(this.failsafe_getval()); } if(!(user.settings & USER_COLOR)) { return(this.failsafe_getval()); } if(this.direction < 0 || this.direction > 1) { alert("Unknown lightbar direction!"); return(this.failsafe_getval()); } /* Check that a vertical lightbar fits on the screen */ if(this.direction==0 && (this.ypos+this.items.length-1 > console.screen_rows)) { alert("Screen too short for lightbar!"); return(this.failsafe_getval()); } /* Ensure current is valid */ if(this.current<0 || this.current >= this.items.length) { alert("current parameter is out of range!"); this.current=0; if(this.items.length<=0) return(null); } var orig_cur=this.current; while(this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; if(this.current==orig_cur) { alert("No items with a return value!"); return(undefined); } } /* Check that a horizontal lightbar fits on the screen */ if(this.direction==1) { var end=this.xpos; var i; for(i=0; i<this.items.length; i++) { if(this.force_width>0) { end+=this.force_width+1; continue; } if(this.items[i].width==undefined) { if(this.items[i]==undefined) { alert("Sparse items array!"); return(null); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); end+=cleaned.length+1; } else { end+=this.items[i].width } } } /* Main loop */ while(1) { var i; var j; /* Draw items */ var curx=this.xpos; var cury=this.ypos; var cursx=this.xpos; var cursy=this.ypos; var item_count=0; for(i=0; i<this.items.length; i++) { var width; var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); if(this.force_width>0) width=this.force_width; else { width=cleaned.length; if(this.items[i]==undefined) { alert("Sparse items array!"); return(this.failsafe_getval()); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } if(this.items[i].width!=undefined) width=this.items[i].width; } console.gotoxy(curx, cury); if(i==this.current) { cursx=curx; cursy=cury; } j=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<width-cleaned.length;j++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<(width-cleaned.length)/2;j++) console.write(' '); } } for(; j<this.items[i].text.length; j++) { if(width > -1 && j > width) break; if(this.items[i].text.substr(j,1)=='|') { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; j++; } else { if(this.current==i) console.attributes=cattr; else console.attributes=attr; } console.write(this.items[i].text.substr(j,1)); } if(this.current==i) console.attributes=cattr; else console.attributes=attr; while(j<width) { console.write(" "); j++; } if(this.direction==0) cury++; else { console.attributes=attr; console.write(" "); curx+=width+1; } if(this.items[i].retval!=undefined) item_count++; } if(item_count==0) { alert("No items with a return value!"); return(undefined); } console.gotoxy(cursx,cursy); if(ret!=undefined) return(ret); /* Get input */ var key=console.getkey(K_UPPER); switch(key) { case KEY_UP: if(this.direction==0) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current].retval==undefined); } break; case KEY_DOWN: if(this.direction==0) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current].retval==undefined); } break; case KEY_LEFT: if(this.direction==1) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current].retval==undefined); } break; case KEY_RIGHT: if(this.direction==1) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current].retval==undefined); } break; case KEY_HOME: this.current=0; while(this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; } break; case KEY_END: this.current=this.items.length-1; while(this.items[this.current].retval==undefined) { if(this.current==0) this.current=this.items.length; this.current--; } break; case '\r': case '\n': if(this.items[this.current].retval==undefined) return(undefined); return(this.items[this.current].retval); break; default: for(i=0; i<this.items.length; i++) { if(this.items[i].text.indexOf('|'+key)!=-1) { if(this.items[i].retval==undefined) continue; this.current=i; /* Let it go through once more to highlight */ ret=this.items[this.current].retval; break; } } break; } }} |
|
console.gotoxy(curx, cury); if(i==this.current) { cursx=curx; cursy=cury; } j=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<width-cleaned.length;j++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<(width-cleaned.length)/2;j++) console.write(' '); } } for(; j<this.items[i].text.length; j++) { if(width > -1 && j > width) break; if(this.items[i].text.substr(j,1)=='|') { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; j++; } else { if(this.current==i) console.attributes=cattr; else console.attributes=attr; } console.write(this.items[i].text.substr(j,1)); } if(this.current==i) console.attributes=cattr; else console.attributes=attr; while(j<width) { console.write(" "); j++; | if(i==this.current || i==last_cur) { console.gotoxy(curx, cury); if(i==this.current) { cursx=curx; cursy=cury; } k=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;k<width-cleaned.length;k++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;k<(width-cleaned.length)/2;k++) console.write(' '); } } for(j=0; j<this.items[i].text.length; j++) { if(width > -1 && k > width) break; if(this.items[i].text.substr(j,1)=='|') { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; j++; } else { if(this.current==i) console.attributes=cattr; else console.attributes=attr; } console.write(this.items[i].text.substr(j,1)); k++; } if(this.current==i) console.attributes=cattr; else console.attributes=attr; while(k<width) { console.write(" "); k++; } | function Lightbar_getval(current){ var attr=this.bg<<4|this.fg; var cattr=this.hbg<<4|this.hfg; var kattr=this.bg<<4|this.kfg; var kcattr=this.hbg<<4|this.khfg; var ret=undefined; if(current!=undefined) this.current=current; if(!(user.settings & USER_ANSI)) { return(this.failsafe_getval()); } if(!(user.settings & USER_COLOR)) { return(this.failsafe_getval()); } if(this.direction < 0 || this.direction > 1) { alert("Unknown lightbar direction!"); return(this.failsafe_getval()); } /* Check that a vertical lightbar fits on the screen */ if(this.direction==0 && (this.ypos+this.items.length-1 > console.screen_rows)) { alert("Screen too short for lightbar!"); return(this.failsafe_getval()); } /* Ensure current is valid */ if(this.current<0 || this.current >= this.items.length) { alert("current parameter is out of range!"); this.current=0; if(this.items.length<=0) return(null); } var orig_cur=this.current; while(this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; if(this.current==orig_cur) { alert("No items with a return value!"); return(undefined); } } /* Check that a horizontal lightbar fits on the screen */ if(this.direction==1) { var end=this.xpos; var i; for(i=0; i<this.items.length; i++) { if(this.force_width>0) { end+=this.force_width+1; continue; } if(this.items[i].width==undefined) { if(this.items[i]==undefined) { alert("Sparse items array!"); return(null); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); end+=cleaned.length+1; } else { end+=this.items[i].width } } } /* Main loop */ while(1) { var i; var j; /* Draw items */ var curx=this.xpos; var cury=this.ypos; var cursx=this.xpos; var cursy=this.ypos; var item_count=0; for(i=0; i<this.items.length; i++) { var width; var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); if(this.force_width>0) width=this.force_width; else { width=cleaned.length; if(this.items[i]==undefined) { alert("Sparse items array!"); return(this.failsafe_getval()); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } if(this.items[i].width!=undefined) width=this.items[i].width; } console.gotoxy(curx, cury); if(i==this.current) { cursx=curx; cursy=cury; } j=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<width-cleaned.length;j++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<(width-cleaned.length)/2;j++) console.write(' '); } } for(; j<this.items[i].text.length; j++) { if(width > -1 && j > width) break; if(this.items[i].text.substr(j,1)=='|') { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; j++; } else { if(this.current==i) console.attributes=cattr; else console.attributes=attr; } console.write(this.items[i].text.substr(j,1)); } if(this.current==i) console.attributes=cattr; else console.attributes=attr; while(j<width) { console.write(" "); j++; } if(this.direction==0) cury++; else { console.attributes=attr; console.write(" "); curx+=width+1; } if(this.items[i].retval!=undefined) item_count++; } if(item_count==0) { alert("No items with a return value!"); return(undefined); } console.gotoxy(cursx,cursy); if(ret!=undefined) return(ret); /* Get input */ var key=console.getkey(K_UPPER); switch(key) { case KEY_UP: if(this.direction==0) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current].retval==undefined); } break; case KEY_DOWN: if(this.direction==0) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current].retval==undefined); } break; case KEY_LEFT: if(this.direction==1) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current].retval==undefined); } break; case KEY_RIGHT: if(this.direction==1) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current].retval==undefined); } break; case KEY_HOME: this.current=0; while(this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; } break; case KEY_END: this.current=this.items.length-1; while(this.items[this.current].retval==undefined) { if(this.current==0) this.current=this.items.length; this.current--; } break; case '\r': case '\n': if(this.items[this.current].retval==undefined) return(undefined); return(this.items[this.current].retval); break; default: for(i=0; i<this.items.length; i++) { if(this.items[i].text.indexOf('|'+key)!=-1) { if(this.items[i].retval==undefined) continue; this.current=i; /* Let it go through once more to highlight */ ret=this.items[this.current].retval; break; } } break; } }} |
else { console.attributes=attr; console.write(" "); | else | function Lightbar_getval(current){ var attr=this.bg<<4|this.fg; var cattr=this.hbg<<4|this.hfg; var kattr=this.bg<<4|this.kfg; var kcattr=this.hbg<<4|this.khfg; var ret=undefined; if(current!=undefined) this.current=current; if(!(user.settings & USER_ANSI)) { return(this.failsafe_getval()); } if(!(user.settings & USER_COLOR)) { return(this.failsafe_getval()); } if(this.direction < 0 || this.direction > 1) { alert("Unknown lightbar direction!"); return(this.failsafe_getval()); } /* Check that a vertical lightbar fits on the screen */ if(this.direction==0 && (this.ypos+this.items.length-1 > console.screen_rows)) { alert("Screen too short for lightbar!"); return(this.failsafe_getval()); } /* Ensure current is valid */ if(this.current<0 || this.current >= this.items.length) { alert("current parameter is out of range!"); this.current=0; if(this.items.length<=0) return(null); } var orig_cur=this.current; while(this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; if(this.current==orig_cur) { alert("No items with a return value!"); return(undefined); } } /* Check that a horizontal lightbar fits on the screen */ if(this.direction==1) { var end=this.xpos; var i; for(i=0; i<this.items.length; i++) { if(this.force_width>0) { end+=this.force_width+1; continue; } if(this.items[i].width==undefined) { if(this.items[i]==undefined) { alert("Sparse items array!"); return(null); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); end+=cleaned.length+1; } else { end+=this.items[i].width } } } /* Main loop */ while(1) { var i; var j; /* Draw items */ var curx=this.xpos; var cury=this.ypos; var cursx=this.xpos; var cursy=this.ypos; var item_count=0; for(i=0; i<this.items.length; i++) { var width; var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); if(this.force_width>0) width=this.force_width; else { width=cleaned.length; if(this.items[i]==undefined) { alert("Sparse items array!"); return(this.failsafe_getval()); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } if(this.items[i].width!=undefined) width=this.items[i].width; } console.gotoxy(curx, cury); if(i==this.current) { cursx=curx; cursy=cury; } j=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<width-cleaned.length;j++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<(width-cleaned.length)/2;j++) console.write(' '); } } for(; j<this.items[i].text.length; j++) { if(width > -1 && j > width) break; if(this.items[i].text.substr(j,1)=='|') { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; j++; } else { if(this.current==i) console.attributes=cattr; else console.attributes=attr; } console.write(this.items[i].text.substr(j,1)); } if(this.current==i) console.attributes=cattr; else console.attributes=attr; while(j<width) { console.write(" "); j++; } if(this.direction==0) cury++; else { console.attributes=attr; console.write(" "); curx+=width+1; } if(this.items[i].retval!=undefined) item_count++; } if(item_count==0) { alert("No items with a return value!"); return(undefined); } console.gotoxy(cursx,cursy); if(ret!=undefined) return(ret); /* Get input */ var key=console.getkey(K_UPPER); switch(key) { case KEY_UP: if(this.direction==0) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current].retval==undefined); } break; case KEY_DOWN: if(this.direction==0) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current].retval==undefined); } break; case KEY_LEFT: if(this.direction==1) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current].retval==undefined); } break; case KEY_RIGHT: if(this.direction==1) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current].retval==undefined); } break; case KEY_HOME: this.current=0; while(this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; } break; case KEY_END: this.current=this.items.length-1; while(this.items[this.current].retval==undefined) { if(this.current==0) this.current=this.items.length; this.current--; } break; case '\r': case '\n': if(this.items[this.current].retval==undefined) return(undefined); return(this.items[this.current].retval); break; default: for(i=0; i<this.items.length; i++) { if(this.items[i].text.indexOf('|'+key)!=-1) { if(this.items[i].retval==undefined) continue; this.current=i; /* Let it go through once more to highlight */ ret=this.items[this.current].retval; break; } } break; } }} |
} | function Lightbar_getval(current){ var attr=this.bg<<4|this.fg; var cattr=this.hbg<<4|this.hfg; var kattr=this.bg<<4|this.kfg; var kcattr=this.hbg<<4|this.khfg; var ret=undefined; if(current!=undefined) this.current=current; if(!(user.settings & USER_ANSI)) { return(this.failsafe_getval()); } if(!(user.settings & USER_COLOR)) { return(this.failsafe_getval()); } if(this.direction < 0 || this.direction > 1) { alert("Unknown lightbar direction!"); return(this.failsafe_getval()); } /* Check that a vertical lightbar fits on the screen */ if(this.direction==0 && (this.ypos+this.items.length-1 > console.screen_rows)) { alert("Screen too short for lightbar!"); return(this.failsafe_getval()); } /* Ensure current is valid */ if(this.current<0 || this.current >= this.items.length) { alert("current parameter is out of range!"); this.current=0; if(this.items.length<=0) return(null); } var orig_cur=this.current; while(this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; if(this.current==orig_cur) { alert("No items with a return value!"); return(undefined); } } /* Check that a horizontal lightbar fits on the screen */ if(this.direction==1) { var end=this.xpos; var i; for(i=0; i<this.items.length; i++) { if(this.force_width>0) { end+=this.force_width+1; continue; } if(this.items[i].width==undefined) { if(this.items[i]==undefined) { alert("Sparse items array!"); return(null); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); end+=cleaned.length+1; } else { end+=this.items[i].width } } } /* Main loop */ while(1) { var i; var j; /* Draw items */ var curx=this.xpos; var cury=this.ypos; var cursx=this.xpos; var cursy=this.ypos; var item_count=0; for(i=0; i<this.items.length; i++) { var width; var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); if(this.force_width>0) width=this.force_width; else { width=cleaned.length; if(this.items[i]==undefined) { alert("Sparse items array!"); return(this.failsafe_getval()); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } if(this.items[i].width!=undefined) width=this.items[i].width; } console.gotoxy(curx, cury); if(i==this.current) { cursx=curx; cursy=cury; } j=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<width-cleaned.length;j++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<(width-cleaned.length)/2;j++) console.write(' '); } } for(; j<this.items[i].text.length; j++) { if(width > -1 && j > width) break; if(this.items[i].text.substr(j,1)=='|') { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; j++; } else { if(this.current==i) console.attributes=cattr; else console.attributes=attr; } console.write(this.items[i].text.substr(j,1)); } if(this.current==i) console.attributes=cattr; else console.attributes=attr; while(j<width) { console.write(" "); j++; } if(this.direction==0) cury++; else { console.attributes=attr; console.write(" "); curx+=width+1; } if(this.items[i].retval!=undefined) item_count++; } if(item_count==0) { alert("No items with a return value!"); return(undefined); } console.gotoxy(cursx,cursy); if(ret!=undefined) return(ret); /* Get input */ var key=console.getkey(K_UPPER); switch(key) { case KEY_UP: if(this.direction==0) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current].retval==undefined); } break; case KEY_DOWN: if(this.direction==0) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current].retval==undefined); } break; case KEY_LEFT: if(this.direction==1) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current].retval==undefined); } break; case KEY_RIGHT: if(this.direction==1) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current].retval==undefined); } break; case KEY_HOME: this.current=0; while(this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; } break; case KEY_END: this.current=this.items.length-1; while(this.items[this.current].retval==undefined) { if(this.current==0) this.current=this.items.length; this.current--; } break; case '\r': case '\n': if(this.items[this.current].retval==undefined) return(undefined); return(this.items[this.current].retval); break; default: for(i=0; i<this.items.length; i++) { if(this.items[i].text.indexOf('|'+key)!=-1) { if(this.items[i].retval==undefined) continue; this.current=i; /* Let it go through once more to highlight */ ret=this.items[this.current].retval; break; } } break; } }} |
|
last_cur=this.current; | function Lightbar_getval(current){ var attr=this.bg<<4|this.fg; var cattr=this.hbg<<4|this.hfg; var kattr=this.bg<<4|this.kfg; var kcattr=this.hbg<<4|this.khfg; var ret=undefined; if(current!=undefined) this.current=current; if(!(user.settings & USER_ANSI)) { return(this.failsafe_getval()); } if(!(user.settings & USER_COLOR)) { return(this.failsafe_getval()); } if(this.direction < 0 || this.direction > 1) { alert("Unknown lightbar direction!"); return(this.failsafe_getval()); } /* Check that a vertical lightbar fits on the screen */ if(this.direction==0 && (this.ypos+this.items.length-1 > console.screen_rows)) { alert("Screen too short for lightbar!"); return(this.failsafe_getval()); } /* Ensure current is valid */ if(this.current<0 || this.current >= this.items.length) { alert("current parameter is out of range!"); this.current=0; if(this.items.length<=0) return(null); } var orig_cur=this.current; while(this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; if(this.current==orig_cur) { alert("No items with a return value!"); return(undefined); } } /* Check that a horizontal lightbar fits on the screen */ if(this.direction==1) { var end=this.xpos; var i; for(i=0; i<this.items.length; i++) { if(this.force_width>0) { end+=this.force_width+1; continue; } if(this.items[i].width==undefined) { if(this.items[i]==undefined) { alert("Sparse items array!"); return(null); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); end+=cleaned.length+1; } else { end+=this.items[i].width } } } /* Main loop */ while(1) { var i; var j; /* Draw items */ var curx=this.xpos; var cury=this.ypos; var cursx=this.xpos; var cursy=this.ypos; var item_count=0; for(i=0; i<this.items.length; i++) { var width; var cleaned=this.items[i].text; cleaned=cleaned.replace(/\|/g,''); if(this.force_width>0) width=this.force_width; else { width=cleaned.length; if(this.items[i]==undefined) { alert("Sparse items array!"); return(this.failsafe_getval()); } if(this.items[i].text==undefined) { alert("No text for item "+i+"!"); return(this.failsafe_getval()); } if(this.items[i].width!=undefined) width=this.items[i].width; } console.gotoxy(curx, cury); if(i==this.current) { cursx=curx; cursy=cury; } j=0; if(cleaned.length < width) { if(this.align==1) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<width-cleaned.length;j++) console.write(' '); } if(this.align==2) { if(this.current==i) console.attributes=cattr; else console.attributes=attr; for(;j<(width-cleaned.length)/2;j++) console.write(' '); } } for(; j<this.items[i].text.length; j++) { if(width > -1 && j > width) break; if(this.items[i].text.substr(j,1)=='|') { if(this.current==i) console.attributes=kcattr; else console.attributes=kattr; j++; } else { if(this.current==i) console.attributes=cattr; else console.attributes=attr; } console.write(this.items[i].text.substr(j,1)); } if(this.current==i) console.attributes=cattr; else console.attributes=attr; while(j<width) { console.write(" "); j++; } if(this.direction==0) cury++; else { console.attributes=attr; console.write(" "); curx+=width+1; } if(this.items[i].retval!=undefined) item_count++; } if(item_count==0) { alert("No items with a return value!"); return(undefined); } console.gotoxy(cursx,cursy); if(ret!=undefined) return(ret); /* Get input */ var key=console.getkey(K_UPPER); switch(key) { case KEY_UP: if(this.direction==0) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current].retval==undefined); } break; case KEY_DOWN: if(this.direction==0) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current].retval==undefined); } break; case KEY_LEFT: if(this.direction==1) { do { if(this.current==0) this.current=this.items.length; this.current--; } while(this.items[this.current].retval==undefined); } break; case KEY_RIGHT: if(this.direction==1) { do { this.current++; if(this.current==this.items.length) this.current=0; } while(this.items[this.current].retval==undefined); } break; case KEY_HOME: this.current=0; while(this.items[this.current].retval==undefined) { this.current++; if(this.current==this.items.length) this.current=0; } break; case KEY_END: this.current=this.items.length-1; while(this.items[this.current].retval==undefined) { if(this.current==0) this.current=this.items.length; this.current--; } break; case '\r': case '\n': if(this.items[this.current].retval==undefined) return(undefined); return(this.items[this.current].retval); break; default: for(i=0; i<this.items.length; i++) { if(this.items[i].text.indexOf('|'+key)!=-1) { if(this.items[i].retval==undefined) continue; this.current=i; /* Let it go through once more to highlight */ ret=this.items[this.current].retval; break; } } break; } }} |
|
function Line(attr) | function Line() | function Line(attr){ var i; if(attr==undefined) attr=7; /* The actual text of this line */ this.text=''; /* The attributes of this line */ this.attr=new Array(); for(i=0; i<80; i++) this.attr[i]=attr; this.hardcr=false; this.draw=Line_draw;} |
if(attr==undefined) attr=7; | function Line(attr){ var i; if(attr==undefined) attr=7; /* The actual text of this line */ this.text=''; /* The attributes of this line */ this.attr=new Array(); for(i=0; i<80; i++) this.attr[i]=attr; this.hardcr=false; this.draw=Line_draw;} |
|
this.attr=new Array(); for(i=0; i<80; i++) this.attr[i]=attr; | this.attr=''; | function Line(attr){ var i; if(attr==undefined) attr=7; /* The actual text of this line */ this.text=''; /* The attributes of this line */ this.attr=new Array(); for(i=0; i<80; i++) this.attr[i]=attr; this.hardcr=false; this.draw=Line_draw;} |
this.draw=Line_draw; | this.kludged=false; this.firstchar=0; | function Line(attr){ var i; if(attr==undefined) attr=7; /* The actual text of this line */ this.text=''; /* The attributes of this line */ this.attr=new Array(); for(i=0; i<80; i++) this.attr[i]=attr; this.hardcr=false; this.draw=Line_draw;} |
docW = docW + "<a href='" + this.hreference + "' TARGET=_top " | docW = docW + "<a href='" + this.hreference + "' TARGET=_self " | function linkFolderHTML(isTextLink) { var docW = ""; if (this.hreference) { if (USEFRAMES) docW = docW + "<a href='" + this.hreference + "' TARGET=\"basefrm\" " else docW = docW + "<a href='" + this.hreference + "' TARGET=_top " if (isTextLink) { docW += "id=\"itemTextLink"+this.id+"\" "; } if (browserVersion > 0) docW = docW + "onClick='javascript:clickOnFolder(\""+this.getID()+"\")'" docW = docW + ">" } else docW = docW + "<a>" if (this.hreference == '') docW = ''; return docW;} |
var systems=0; | var udp_req=0; | function list_users(show){ imsg_user = new Array(); var systems=0; var replies=0; users = 0; start = new Date(); print("\1m\1hListing Systems and Users (Ctrl-C to Abort)..."); /* UDP systems */ sock = new Socket(SOCK_DGRAM); //sock.debug=true; sock.bind(); for(i=0;sys[i]!=undefined && !(bbs.sys_status&SS_ABORT);i++) { if(sys[i].ip==undefined) continue; if(!sock.sendto("\r\n",sys[i].ip,79)) // Get list of active users //printf("FAILED! (%d) Sending to %s\r\n",sock.last_error,sys[i].addr); continue; systems++; } begin = new Date(); while(replies<systems && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT) { if(!sock.poll(1)) continue; message=sock.recvfrom(20000); if(message==null) continue; i=get_sysnum(message.ip_address); if(i==-1) continue; replies++; sys[i].udp=true; sys[i].reply=new Date().valueOf()-start.valueOf(); response=message.data.split("\r\n"); if(show) { console.line_counter=0; // defeat pause printf("\1n\1h%-25.25s\1n ",sys[i].addr); } parse_response(response, show); } sock.close(); /* TCP systems */ for(i=0;sys[i]!=undefined && !(bbs.sys_status&SS_ABORT);i++) { if(sys[i].udp) continue; replies++; if(sys[i].failed) continue; begin = new Date(); if(show) { console.line_counter=0; // defeat pause printf("\1n\1h%-25.25s\1n ",sys[i].addr); } sock = new Socket(); is_connected = false; if(sys[i].ip != undefined) { is_connected = sock.connect(sys[i].ip,79); if(!is_connected) sys[i].ip = undefined; // IP no good, remove from cache } if(!is_connected && !sock.connect(sys[i].addr,79)) { log(format("!Finger connection to %s FAILED with error %d" ,sys[i].addr,sock.last_error)); alert("system not available"); sys[i].failed = true; continue; } sys[i].reply=new Date().valueOf()-begin.valueOf(); // cache the IP address for faster resolution if(sys[i].ip != sock.remote_ip_address) sys[i].ip = sock.remote_ip_address; sock.send("\r\n"); // Get list of active users var response=new Array(); while(bbs.online && sock.is_connected) { str=sock.readline(); if(str==null) break; str = truncsp(str); if(str=="") continue; response.push(str); } sock.close(); parse_response(response,show); } t = new Date().valueOf()-start.valueOf(); printf("\1m\1h%lu systems and %lu users listed in %d seconds.\r\n" ,replies, users, t/1000); save_sys_list();} |
systems++; | udp_req++; | function list_users(show){ imsg_user = new Array(); var systems=0; var replies=0; users = 0; start = new Date(); print("\1m\1hListing Systems and Users (Ctrl-C to Abort)..."); /* UDP systems */ sock = new Socket(SOCK_DGRAM); //sock.debug=true; sock.bind(); for(i=0;sys[i]!=undefined && !(bbs.sys_status&SS_ABORT);i++) { if(sys[i].ip==undefined) continue; if(!sock.sendto("\r\n",sys[i].ip,79)) // Get list of active users //printf("FAILED! (%d) Sending to %s\r\n",sock.last_error,sys[i].addr); continue; systems++; } begin = new Date(); while(replies<systems && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT) { if(!sock.poll(1)) continue; message=sock.recvfrom(20000); if(message==null) continue; i=get_sysnum(message.ip_address); if(i==-1) continue; replies++; sys[i].udp=true; sys[i].reply=new Date().valueOf()-start.valueOf(); response=message.data.split("\r\n"); if(show) { console.line_counter=0; // defeat pause printf("\1n\1h%-25.25s\1n ",sys[i].addr); } parse_response(response, show); } sock.close(); /* TCP systems */ for(i=0;sys[i]!=undefined && !(bbs.sys_status&SS_ABORT);i++) { if(sys[i].udp) continue; replies++; if(sys[i].failed) continue; begin = new Date(); if(show) { console.line_counter=0; // defeat pause printf("\1n\1h%-25.25s\1n ",sys[i].addr); } sock = new Socket(); is_connected = false; if(sys[i].ip != undefined) { is_connected = sock.connect(sys[i].ip,79); if(!is_connected) sys[i].ip = undefined; // IP no good, remove from cache } if(!is_connected && !sock.connect(sys[i].addr,79)) { log(format("!Finger connection to %s FAILED with error %d" ,sys[i].addr,sock.last_error)); alert("system not available"); sys[i].failed = true; continue; } sys[i].reply=new Date().valueOf()-begin.valueOf(); // cache the IP address for faster resolution if(sys[i].ip != sock.remote_ip_address) sys[i].ip = sock.remote_ip_address; sock.send("\r\n"); // Get list of active users var response=new Array(); while(bbs.online && sock.is_connected) { str=sock.readline(); if(str==null) break; str = truncsp(str); if(str=="") continue; response.push(str); } sock.close(); parse_response(response,show); } t = new Date().valueOf()-start.valueOf(); printf("\1m\1h%lu systems and %lu users listed in %d seconds.\r\n" ,replies, users, t/1000); save_sys_list();} |
while(replies<systems && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT) | while(replies<udp_req && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT) | function list_users(show){ imsg_user = new Array(); var systems=0; var replies=0; users = 0; start = new Date(); print("\1m\1hListing Systems and Users (Ctrl-C to Abort)..."); /* UDP systems */ sock = new Socket(SOCK_DGRAM); //sock.debug=true; sock.bind(); for(i=0;sys[i]!=undefined && !(bbs.sys_status&SS_ABORT);i++) { if(sys[i].ip==undefined) continue; if(!sock.sendto("\r\n",sys[i].ip,79)) // Get list of active users //printf("FAILED! (%d) Sending to %s\r\n",sock.last_error,sys[i].addr); continue; systems++; } begin = new Date(); while(replies<systems && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT) { if(!sock.poll(1)) continue; message=sock.recvfrom(20000); if(message==null) continue; i=get_sysnum(message.ip_address); if(i==-1) continue; replies++; sys[i].udp=true; sys[i].reply=new Date().valueOf()-start.valueOf(); response=message.data.split("\r\n"); if(show) { console.line_counter=0; // defeat pause printf("\1n\1h%-25.25s\1n ",sys[i].addr); } parse_response(response, show); } sock.close(); /* TCP systems */ for(i=0;sys[i]!=undefined && !(bbs.sys_status&SS_ABORT);i++) { if(sys[i].udp) continue; replies++; if(sys[i].failed) continue; begin = new Date(); if(show) { console.line_counter=0; // defeat pause printf("\1n\1h%-25.25s\1n ",sys[i].addr); } sock = new Socket(); is_connected = false; if(sys[i].ip != undefined) { is_connected = sock.connect(sys[i].ip,79); if(!is_connected) sys[i].ip = undefined; // IP no good, remove from cache } if(!is_connected && !sock.connect(sys[i].addr,79)) { log(format("!Finger connection to %s FAILED with error %d" ,sys[i].addr,sock.last_error)); alert("system not available"); sys[i].failed = true; continue; } sys[i].reply=new Date().valueOf()-begin.valueOf(); // cache the IP address for faster resolution if(sys[i].ip != sock.remote_ip_address) sys[i].ip = sock.remote_ip_address; sock.send("\r\n"); // Get list of active users var response=new Array(); while(bbs.online && sock.is_connected) { str=sock.readline(); if(str==null) break; str = truncsp(str); if(str=="") continue; response.push(str); } sock.close(); parse_response(response,show); } t = new Date().valueOf()-start.valueOf(); printf("\1m\1h%lu systems and %lu users listed in %d seconds.\r\n" ,replies, users, t/1000); save_sys_list();} |
sock.debug=true; | function list_users(show){ imsg_user = new Array(); var systems=0; var replies=0; users = 0; start = new Date(); print("\1m\1hListing Systems and Users (Ctrl-C to Abort)..."); /* UDP systems */ sock = new Socket(SOCK_DGRAM); sock.debug=true; sock.bind(); for(i=0;sys[i]!=undefined && !(bbs.sys_status&SS_ABORT);i++) { if(sys[i].ip==undefined) continue; if(!sock.sendto("\r\n",sys[i].ip,79)) // Get list of active users //printf("FAILED! (%d) Sending to %s\r\n",sock.last_error,sys[i].addr); continue; systems++; } begin = new Date(); while(replies<systems && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT) { if(!sock.poll(1)) continue; message=sock.recvfrom(20000); if(message==null) continue; i=get_sysnum(message.ip_address); if(i==-1) continue; replies++; sys[i].udp=true; sys[i].reply=new Date().valueOf()-start.valueOf(); response=message.data.split("\r\n"); if(show) { console.line_counter=0; // defeat pause printf("\1n\1h%-25.25s\1n ",sys[i].addr); } parse_response(response, show); } sock.close(); /* TCP systems */ for(i=0;sys[i]!=undefined && !(bbs.sys_status&SS_ABORT);i++) { if(sys[i].udp) continue; replies++; if(sys[i].failed) continue; begin = new Date(); if(show) { console.line_counter=0; // defeat pause printf("\1n\1h%-25.25s\1n ",sys[i].addr); } sock = new Socket(); is_connected = false; if(sys[i].ip != undefined) { is_connected = sock.connect(sys[i].ip,79); if(!is_connected) sys[i].ip = undefined; // IP no good, remove from cache } if(!is_connected && !sock.connect(sys[i].addr,79)) { log(format("!Finger connection to %s FAILED with error %d" ,sys[i].addr,sock.last_error)); alert("system not available"); sys[i].failed = true; continue; } sys[i].reply=new Date().valueOf()-begin.valueOf(); // cache the IP address for faster resolution if(sys[i].ip != sock.remote_ip_address) sys[i].ip = sock.remote_ip_address; sock.send("\r\n"); // Get list of active users var response=new Array(); while(bbs.online && sock.is_connected) { str=sock.readline(); if(str==null) break; str = truncsp(str); if(str=="") continue; response.push(str); } sock.close(); parse_response(response,show); } t = new Date().valueOf()-start.valueOf(); printf("\1m\1h%lu systems and %lu users listed in %d seconds.\r\n" ,replies, users, t/1000); save_sys_list();} |
|
live_kill_streams(); | function live_switchto(_mode){ live_kill_streams(); var _actual_spts = dbox_spts_status(); if(_mode == "tv" && !_actual_spts) dbox_spts_set(true); else if(_mode == "radio" && _actual_spts) dbox_spts_set(false); //var _actual_mode = dbox_getmode(); //if(_actual_mode != _mode) dbox_setmode(_mode);} |
|
var _actual_mode = dbox_getmode(); if(_actual_mode != _mode) | function live_switchto(_mode){ live_kill_streams(); var _actual_spts = dbox_spts_status(); if(_mode == "tv" && !_actual_spts) dbox_spts_set(true); else if(_mode == "radio" && _actual_spts) dbox_spts_set(false); //var _actual_mode = dbox_getmode(); //if(_actual_mode != _mode) dbox_setmode(_mode);} |
|
if(typeof Prototype=='undefined') | if((typeof Prototype=='undefined') || parseFloat(Prototype.Version.split(".")[0] + "." + Prototype.Version.split(".")[1]) < 1.4) | load: function() { // fixme: check for prototype version number if(typeof Prototype=='undefined') throw("script.aculo.us requires the Prototype JavaScript framework >= 1.4.0"); var scriptTags = document.getElementsByTagName("script"); for(var i=0;i<scriptTags.length;i++) { if(scriptTags[i].src && scriptTags[i].src.match(/scriptaculous\.js$/)) { var path = scriptTags[i].src.replace(/scriptaculous\.js$/,''); this.require(path + 'util.js'); this.require(path + 'effects.js'); this.require(path + 'dragdrop.js'); this.require(path + 'controls.js'); } } } |
doc.load(getScriptChrome("config.xml")); | try { doc.load(getScriptChrome("config.xml")); } catch (exc) { doc.load(getScriptChrome("default-config.xml")); } | this.load = function() { var doc = document.implementation.createDocument("", "", null); doc.async = false; doc.load(getScriptChrome("config.xml")); var nodes = document.evaluate("/UserScriptConfig/Script", doc, null, 0, null); this.scripts = []; for (var node = null; (node = nodes.iterateNext()); ) { var script = new Script(); for (var i = 0, childNode = null; (childNode = node.childNodes[i]); i++) { if (childNode.nodeName == "Include") { script.includes.push(childNode.firstChild.nodeValue); } else if (childNode.nodeName == "Exclude") { script.excludes.push(childNode.firstChild.nodeValue); } } script.id = node.getAttribute("id"); script.name = node.getAttribute("name"); script.namespace = node.getAttribute("namespace"); script.description = node.getAttribute("description"); script.enabled = node.getAttribute("enabled") == true.toString(); this.scripts.push(script); } } |
load:function(callback) { | function load(callback) { | load:function(callback) { this.doc = BXE_loader.load(this.filename,this.method,callback) }, |
}, | } | load:function(callback) { this.doc = BXE_loader.load(this.filename,this.method,callback) }, |
try { doc.load(getScriptChrome("config.xml")); } catch (exc) { doc.load(getScriptChrome("default-config.xml")); } | doc.load(configURI.spec); | this.load = function() { var doc = document.implementation.createDocument("", "", null); doc.async = false; try { doc.load(getScriptChrome("config.xml")); } catch (exc) { doc.load(getScriptChrome("default-config.xml")); } var nodes = document.evaluate("/UserScriptConfig/Script", doc, null, 0, null); this.scripts = []; for (var node = null; (node = nodes.iterateNext()); ) { var script = new Script(); for (var i = 0, childNode = null; (childNode = node.childNodes[i]); i++) { if (childNode.nodeName == "Include") { script.includes.push(childNode.firstChild.nodeValue); } else if (childNode.nodeName == "Exclude") { script.excludes.push(childNode.firstChild.nodeValue); } } script.filename = node.getAttribute("filename"); script.name = node.getAttribute("name"); script.namespace = node.getAttribute("namespace"); script.description = node.getAttribute("description"); script.enabled = node.getAttribute("enabled") == true.toString(); this.scripts.push(script); } } |
var re = /(<object data="\/googleplayer.swf\?videoUrl=)(.*?)(\&.*?<\/object>)/; | var re = /(?:videoUrl(?:\\u003d|=))(.*?)\&/; | function load_google_video(cached, vs) { if (!cached.uri.match(/^http:\/\/video.google.com\/videoplay/)) return true; var re = /(<object data="\/googleplayer.swf\?videoUrl=)(.*?)(\&.*?<\/object>)/; var match = cached.content.match(re); var url = unescape(match[2]); var meta = '<meta http-equiv="refresh" content="1; url=' + url + '" />'; cached.content = cached.content.replace(/<head>/, "<head>" + meta); return true;} |
var url = unescape(match[2]); | var url = unescape(match[1]); | function load_google_video(cached, vs) { if (!cached.uri.match(/^http:\/\/video.google.com\/videoplay/)) return true; var re = /(<object data="\/googleplayer.swf\?videoUrl=)(.*?)(\&.*?<\/object>)/; var match = cached.content.match(re); var url = unescape(match[2]); var meta = '<meta http-equiv="refresh" content="1; url=' + url + '" />'; cached.content = cached.content.replace(/<head>/, "<head>" + meta); return true;} |
yaml = yaml.replace(new RegExp('^','mg'),' '); | yaml = yaml.replace(new RegExp('^(.)','mg'),' $1'); | document.load_val_hash = function (form, val_hash) { // check the form we are using if (! form) return alert('Missing form or form name'); if (typeof(form) == 'string') { if (! document[form]) return alert('No form by name '+form); form = document[form]; } // if we already have validation - use it if (form.val_hash) return form.val_hash; // load in the validation and save it for future use if (typeof(val_hash) != 'object') { // get the hash from a javascript function if (typeof(val_hash) == 'function') { val_hash = val_hash(formname); } else if (typeof(val_hash) == 'undefined') { var el; // get hash from a global js variable if (typeof(document.validation) != 'undefined') { val_hash = document.validation; // get hash from a element by if of validation } else if (el = document.getElementById('validation')) { val_hash = el.innerHTML; val_hash = val_hash.replace(new RegExp('<', 'ig'),'<'); val_hash = val_hash.replace(new RegExp('>', 'ig'),'>'); val_hash = val_hash.replace(new RegExp('&','ig'),'&'); // read hash from <input name=foo validation=""> } else { var order = new Array(); var str = ''; var yaml = form.getAttribute('validation'); if (yaml) { if (m = yaml.match('^( +)')) yaml = yaml.replace(new RegExp('^'+m[1], 'g'), ''); //unindent yaml = yaml.replace(new RegExp('\\s*$',''),'\n'); // add trailing str += yaml; } var m; for (var i = 0; i < form.elements.length; i ++) { var name = form.elements[i].name; var yaml = form.elements[i].getAttribute('validation'); if (! name || ! yaml) continue; yaml = yaml.replace(new RegExp('\\s*$',''),'\n'); // add trailing yaml = yaml.replace(new RegExp('^','mg'),' '); // indent all yaml = yaml.replace(new RegExp('^( *[^\\s&*\\[\\{])',''),'\n$1'); // add newline str += name +':' + yaml; order[order.length] = name; } if (str) val_hash = str + "group order: [" + order.join(', ') + "]\n"; } } if (typeof(val_hash) == 'string') { if (! document.yaml_load) return; document.hide_yaml_errors = (! document.show_yaml_errors); if (location.search && location.search.indexOf('show_yaml_errors') != -1) document.hide_yaml_errors = 0; val_hash = document.yaml_load(val_hash); if (document.yaml_error_occured) return; } } // attach to the form form.val_hash = val_hash; return form.val_hash;} |
document.hide_yaml_errors = (! document.show_yaml_errors); if (location.search && location.search.indexOf('show_yaml_errors') != -1) document.hide_yaml_errors = 0; | document.load_val_hash = function (form, val_hash) { // check the form we are using if (! form) return alert('Missing form or form name'); if (typeof(form) == 'string') { if (! document[form]) return alert('No form by name '+form); form = document[form]; } // if we already have validation - use it if (form.val_hash) return form.val_hash; // load in the validation and save it for future use if (typeof(val_hash) != 'object') { // get the hash from a javascript function if (typeof(val_hash) == 'function') { val_hash = val_hash(formname); } else if (typeof(val_hash) == 'undefined') { var el; // get hash from a global js variable if (typeof(document.validation) != 'undefined') { val_hash = document.validation; // get hash from a element by if of validation } else if (el = document.getElementById('validation')) { val_hash = el.innerHTML; val_hash = val_hash.replace(new RegExp('<', 'ig'),'<'); val_hash = val_hash.replace(new RegExp('>', 'ig'),'>'); val_hash = val_hash.replace(new RegExp('&','ig'),'&'); // read hash from <input name=foo validation=""> } else { var found = 0; var _val_hash = new Array(); var group_order = new Array(); var anchors = new Array(); // hold anchors between yaml calls var ref; var str = form.getAttribute('validation'); if (str && (ref = document.yaml_load(str, anchors)) && ref[0]) { _val_hash = ref[0]; if (_val_hash.length) { alert("Inline validation may only have one group."); return; } found = 1; } var anc; for (var i = 0; i < form.elements.length; i ++) { var name = form.elements[i].name; var str = form.elements[i].getAttribute('validation'); if (! name || ! str) continue; str = str.replace('\\s*',''); if (anc = str.match('^\\ *&(\\w+)\\ *')) { str = str.substring(anc[0].length); anc = anc[1]; } if (str.indexOf('\n') == -1) str = str.replace(new RegExp('(\\w+:\\ +(\'[^\']*\'|"[^"]*"|[^,:]+)),\\s+','g'),'$1\n'); var ref = document.yaml_load(str,anchors); if (! ref || ! ref[0]) continue; var hash = ref[0]; if (! hash['field']) hash['field'] = name; if (anc) anchors[anc] = hash; _val_hash[name] = hash; group_order[group_order.length] = name; found = 1; } if (found) { val_hash = _val_hash; if (! val_hash['group order']) val_hash['group order'] = group_order; } } } if (typeof(val_hash) == 'string') { if (! document.yaml_load) return; //document.hide_yaml_errors = (! document.show_yaml_errors); //if (location.search && location.search.indexOf('show_yaml_errors') != -1) // document.hide_yaml_errors = 0; val_hash = document.yaml_load(val_hash); if (document.yaml_error_occured) return; } } // attach to the form form.val_hash = val_hash; return form.val_hash;} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.