From 0d3ea3aa52f4a62b4f8a64892bfbe579164eb26d Mon Sep 17 00:00:00 2001 Message-Id: <0d3ea3aa52f4a62b4f8a64892bfbe579164eb26d.1715740710.git.mdw@distorted.org.uk> From: Mark Wooding Date: Mon, 2 Jul 2001 16:16:58 +0000 Subject: [PATCH] Produce error if you say "register spong". Change mustpingbefore to muststartby, and look for 001 msg rather than PING. Add ncipher config. Organization: Straylight/Edgeware From: Ian Jackson --- bot.tcl | 3 +++ irccore.tcl | 19 +++++++++++-------- ncipher.tcl | 11 +++++++++++ usebnbot.tcl | 4 ++-- 4 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 ncipher.tcl diff --git a/bot.tcl b/bot.tcl index fc98c2e..3da92b3 100755 --- a/bot.tcl +++ b/bot.tcl @@ -1026,6 +1026,9 @@ def_ucmd register { ucmdr {} "This is fine, but bear in mind that people will be able to mess with your settings. Channel management features need a secure registration." "makes an insecure registration for your nick." } } + default { + error "you mean register / register delete / register insecure" + } } } diff --git a/irccore.tcl b/irccore.tcl index 1ff6840..5d28cef 100644 --- a/irccore.tcl +++ b/irccore.tcl @@ -11,7 +11,7 @@ defset ident blight defset ownfullname "testing bot" defset ownmailaddr test-irc-bot@example.com -defset musthaveping_ms 10000 +defset muststartby_ms 10000 defset out_maxburst 6 defset out_interval 2100 defset out_lag_lag 5000 @@ -259,12 +259,15 @@ proc prefix_nick {} { } proc msg_PING {p c s1} { - global musthaveping_after prefix_none sendout PONG $s1 - if {[info exists musthaveping_after]} { - after cancel $musthaveping_after - unset musthaveping_after +} + +proc msg_001 {args} { + global muststartby_after + if {[info exists muststartby_after]} { + after cancel $muststartby_after + unset muststartby_after connected } } @@ -286,7 +289,7 @@ proc fail {msg} { proc ensure_connecting {} { global sock ownfullname host port nick ident socketargs - global musthaveping_ms musthaveping_after + global muststartby_ms muststartby_after ensure_outqueue @@ -299,6 +302,6 @@ proc ensure_connecting {} { sendout NICK $nick fileevent $sock readable onread - set musthaveping_after [after $musthaveping_ms \ - {fail "no ping within timeout"}] + set muststartby_after [after $muststartby_ms \ + {fail "no successfuly connect within timeout"}] } diff --git a/ncipher.tcl b/ncipher.tcl new file mode 100644 index 0000000..cf94ca3 --- /dev/null +++ b/ncipher.tcl @@ -0,0 +1,11 @@ +# Configuration for nCipher + +set host cam.irc.devel.ncipher.com +set host cromer +set nick Fastness +set ownfullname "here to Help" +set ownmailaddr iwj@ncipher.com +set socketargs {} +set ident fastness + +source bot.tcl diff --git a/usebnbot.tcl b/usebnbot.tcl index ee7737a..8e227c6 100644 --- a/usebnbot.tcl +++ b/usebnbot.tcl @@ -18,13 +18,13 @@ proc bnbot__vars {} { } def_bnbot ensure_connecting {} { - global musthaveping_ms bnbot + global muststartby_ms bnbot if {[info exists bnchan]} return defset bnport 6112 set bnchan [open [list | $bnbot $bnhost $bnport] w+] fconfigure $bnchan -buffering line - set bnmbokafter [after $musthaveping_ms \ + set bnmbokafter [after $muststartby_ms \ "fail {bot $botid not ok within timeout}"] set bnstate Connected fileevent $bnchan readable [list bnbot_onread $botid] -- [mdw]