tclserv

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 72e47f33380dbfe945a98ce73a006031b76ab45d
parent 34f646f25679c01344b0f432b8e21f218ac8ee92
Author: Ellenor Malik <ellenor@umbrellix.net>
Date:   Thu, 11 Feb 2021 04:48:55 -0800

pre-merge commit

Diffstat:
Mcore/0000-callbacks.tcl | 2+-
Mcore/2003-ts6.tcl | 6+++---
Mmain.tcl | 9+++++----
Mmodules/debugserv.tcl | 3++-
Mmodules/quoteserv.tcl | 2+-
5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/core/0000-callbacks.tcl b/core/0000-callbacks.tcl @@ -17,7 +17,7 @@ proc unllbindall {sock type client comd} { tnda unset "llbinds/$::netname($sock)/$type/$client/[ndcenc $comd]" } proc firellbind {sock type client comd args} { -# puts stdout "$sock $type $client [ndcenc $comd] $args" +# puts stdout "$sock $type $client $comd $args" global globuctx globctx set globctx $::netname($sock) set globuctx $client diff --git a/core/2003-ts6.tcl b/core/2003-ts6.tcl @@ -288,9 +288,9 @@ proc ::ts6::irc-main {sck} { # if {[lindex $comd [expr {$one + 2}]] != 1} {return};#we don't support jupes tnda set "servers/$::netname($sck)/[ndaenc [tnda get "socksid/$::netname($sck)"]]/name" [lindex $comd [expr {$one + 1}]] tnda set "servers/$::netname($sck)/[ndaenc [tnda get "socksid/$::netname($sck)"]]/description" [lindex $comd [expr {$one + 3}]] - firellbind $sck evnt "-" "alive" $::netname($sck) - firellbind - evnt "-" "alive" $::netname($sck) - firellbind $sck evnt "-" "ts6.alive" $::netname($sck) +# firellbind $sck evnt "-" "alive" $::netname($sck) + if {$one == 0} {firellbind - evnt "-" "alive" $::netname($sck)} +# firellbind $sck evnt "-" "ts6.alive" $::netname($sck) } "SID" { diff --git a/main.tcl b/main.tcl @@ -39,6 +39,7 @@ proc mysrc {script} { proc readfile {script} { set fp [open $script r] + chan configure $fp -encoding utf-8 set ev [read $fp] close $fp return $ev @@ -64,8 +65,8 @@ proc save.db {name var no oper} { if {$lastsave + 40 > [set now [clock seconds]]} {return} ;#save CPU time by not always saving DB; integrity problems may result # ensure DB save is atomic, so if tclserv is killed during or under 12.5 seconds after save catch [list file rename $name [format "%s.bk%s" $name $now]] - set there [open $name [list WRONLY CREAT TRUNC BINARY]] - chan configure $there -blocking 0 -buffering full -buffersize 8192 + set there [open $name [list WRONLY CREAT TRUNC]] + chan configure $there -encoding utf-8 -blocking 0 -buffering full -buffersize 8192 # should not block for long puts -nonewline $there $db flush $there @@ -81,10 +82,10 @@ set lastsave [clock seconds] if {[file exists services.db]} { puts stdout "reading the nda dict" - set nd [readbfile services.db] + set nd [readfile services.db] puts stdout $nd } -set nd [readbfile services.db] +#set nd [readfile services.db] set globwd [pwd] set gettext [list] diff --git a/modules/debugserv.tcl b/modules/debugserv.tcl @@ -40,8 +40,9 @@ proc debugserv.oneintro {headline block} { set net [lindex $headline 0] set nsock $::sock($net) dictassign $block logchan logchan nick nick ident ident host host modes modes realname realname rehashprivs rehashprivs idcommand nspass nickserv nickserv nsserv nsserv \ - dnsconf dnsconf + dnsconf dnsconf tclprivs tclprivs tnda set "debugserv/$net/rehashprivs" $rehashprivs + tnda set "debugserv/$net/tclprivs" $tclprivs tnda set "debugserv/$net/logchan" $logchan #tnda set "debugserv/$net/nspass" $nspass setctx $net diff --git a/modules/quoteserv.tcl b/modules/quoteserv.tcl @@ -40,7 +40,7 @@ proc quoteserv.oneintro {headline block} { tnda set "quoteserv/[curctx net]/logchan" $logchan #tnda set "quoteserv/[curctx net]/nspass" $nspass setctx $net - % sendUid $nick $ident $host $host [set ourid [% getfreeuid]] [expr {($realname == "") ? "* Debug Service *" : $realname}] $modes + % sendUid $nick $ident $host $host [set ourid [% getfreeuid]] [expr {($realname == "") ? "* Quote Service *" : $realname}] $modes tnda set "quoteserv/[curctx net]/ourid" $ourid # llbind $nsock pub - ".metadata" [list quoteserv.pmetadata $net] # llbind $nsock pub - ".rehash" [list quoteserv.crehash $net]