commit b4608531f574ddb6a4fbbea1d646d38a9f4e9347
parent f50e82ce9d642fe364b50a0531e0f592c0c066b4
Author: Ellenor Malik <ellenor@umbrellix.net>
Date: Wed, 9 Oct 2019 17:43:14 -0700
further cleanup
Diffstat:
4 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/chanserv.conf.example b/chanserv.conf.example
@@ -1,7 +1 @@
-set cs(nick) "Mars"
-set cs(ident) "services"
-set cs(host) "pandersticks.com"
-set cs(admin) "Ellenor"
-# REPLACE THIS! ^^ This user gets +mno set on them every bootup.
-set cs(netname) yournet
-::ts6::login $::sock($cs(netname)) $::numeric $::password $cs(netname)
+# you basically put source lines here ad libitum
diff --git a/core/0000-callbacks.tcl b/core/0000-callbacks.tcl
@@ -33,7 +33,9 @@ proc firellbind {sock type client comd args} {
lappend scr $a
}
if {[set errcode [catch {eval $scr} erre]] > 0} {
- puts stdout [format "in script %s:\n\nerror code %s, %s\ncontact script developer for assistance\n" $scr $errcode $erre]
+ foreach logline [split [format "in script %s:\n\nerror code %s, %s\ncontact script developer for assistance\n" $scr $errcode $erre] "\n"] {
+ putloglev o * $logline
+ }
firellbind $sock evnt - error $erre {*}$scr
}
}
@@ -62,7 +64,9 @@ proc firellmbind {sock type client comd args} {
lappend scr $a
}
if {[set errcode [catch {eval $scr} erre]] > 0} {
- puts stdout [format "in script (#%s) %s:\n\nerror code %s, %s\ncontact script developer for assistance\n" $id $scr $errcode $erre]
+ foreach logline [split [format "in script (#%s) %s:\n\nerror code %s, %s\ncontact script developer for assistance\n" $id $scr $errcode $erre] "\n"] {
+ putloglev o * $logline
+ }
firellbind $sock evnt - error $erre {*}$scr
}
}
diff --git a/modules/chanserv.tcl b/modules/chanserv.tcl
@@ -27,6 +27,7 @@ proc chanserv.connect {arg} {
proc cs.confighandler {servicename defdbname headline block} {
set net [lindex $headline 0]
set nsock $::sock($net)
+ set servicename [format "%s.%s" $servicename [lindex $headline 1]]
dictassign $block nick nick ident ident host host modes modes realname realname
if {[llength [tnda get "service/$net/$servicename/config"]] != 0} {return -code error "<$servicename> O damn, I'm already loaded for $net!"}
tnda set "service/$net/$servicename/config" $block
diff --git a/services.conf.example b/services.conf.example
@@ -1,6 +1,7 @@
# TCLServ Config File
+# This is a valid Tcl script when sourced by TCLServ
-# needs prefix for ts6
+# needs prefix for ts6; this example is for irca. Give it the isupport from your ircd if you are running some other TS6.
network "pand" "services.invalid" {
host 127.0.0.1 port +6697
numeric 53
@@ -38,7 +39,7 @@ debugserv "pand" {
idcommand "IDENTIFY InvictusWAUS None"
}
-quoteserv "panda" {
+quoteserv "pand" {
logchan #services
nick QuoteServ
ident Quote
@@ -53,10 +54,16 @@ quoteserv "panda" {
operflags "oper:quote,oper:admin"
}
-chanserv "pand" {
+# Syntax for ChanServ's header is different.
+# Instead of just being network, it is network servicename.
+# This is because ChanServ is not ChanServ, but a script runner.
+# the config is referenced relative to the working directory when you
+# start TclServ.
+chanserv "pand" "ChanServ" {
nick ChanServ
ident Channel
host Services.Umbrellix.Net
modes +oiS
+ config chanserv.conf
realname "Channels Services"
}