tclserv

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

commit a8955a504c78d1fd58ed66e0f14b3449cef0ccbb
parent cdc4e3d2a84e603753e3c54d45a5e2a91c43a437
Author: Ellenor Malik ellenor@umbrellix.net <j4jackj@gmx.com>
Date:   Fri, 22 Jun 2018 19:14:41 -0700

wugh

Diffstat:
Mcore/2003-ts6.tcl | 2+-
Mlanguage.txt | 1+
Mmodules/debugserv.tcl | 33++++++++++++++++++++++++++++++---
Mservices.conf.example | 4++++
4 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/core/2003-ts6.tcl b/core/2003-ts6.tcl @@ -253,7 +253,7 @@ proc ::ts6::irc-main {sck} { global sid sock socksid if {[eof $sck]} {close $sck} gets $sck line - puts stdout $line + #puts stdout $line set line [string trim $line "\r\n"] set one [string match ":*" $line] set line [string trimleft $line ":"] diff --git a/language.txt b/language.txt @@ -8,3 +8,4 @@ debugserv.youreoper 14/3/9/ YOU (UID %s) are an oper on this network. debugserv.yourentoper 14/5/4/ YOU (UID %s) are 4NOT an oper on this network. debugserv.youvenoprivs 14/5/4/ YOU (UID %s) do 4NOT have the required privileges to execute the commanded action. debugserv.youvenoprivs2 14/5/4/ YOU (UID %s) do 4NOT have the required privileges to execute the commanded action. (Requires %s) +debugserv.impostornickserv 14/5/4/ NickServ specified in config file (nick %s, UID %s, intended server %s, whose SID is "%s" - check links if blank) is gone or an impostor! Not identifying with NickServ - DebugServ WILL NOT BE ABLE TO ACCESS SOME CHANNELS. diff --git a/modules/debugserv.tcl b/modules/debugserv.tcl @@ -9,18 +9,45 @@ proc debugserv.connect {arg} { } } +proc debugserv.find6sid {n s {hunting 0}} { + # we're trying to get the sid of the server named $s + # if hunting, we're looking for the first splat match + set servs [tnda get "servers/$n"] + foreach {.k dv} $servs { + set k [string toupper [ndadec ${.k}]] + # name description uplink sid - we only need two + dictassign $dv name sname + if {$hunting} { + if {[string match [string tolower $s] [string tolower $sname]] == 1} {return $k} + } { + if {[string tolower $s] == [string tolower $sname]} {return $k} + } + } + return "" +} + 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 + dictassign $block logchan logchan nick nick ident ident host host modes modes realname realname rehashprivs rehashprivs idcommand nspass nickserv nickserv nsserv nsserv tnda set "debugserv/$net/rehashprivs" $rehashprivs + tnda set "debugserv/$net/logchan" $logchan + #tnda set "debugserv/$net/nspass" $nspass setctx $net $::nettype($net) sendUid $nsock $nick $ident $host $host [set ourid [$::nettype($net) getfreeuid $net]] [expr {($realname == "") ? "* Debug Service *" : $realname}] $modes tnda set "debugserv/$net/ourid" $ourid bind $nsock pub - ".metadata" [list debugserv.pmetadata $net] # bind $nsock pub - ".rehash" [list debugserv.crehash $net] - $::nettype($net) putjoin $nsock $ourid $logchan - after 500 [list $::nettype($net) putmode $nsock $ourid $logchan "+ao" [format "%s %s" [$::nettype($net) intclient2uid $net $ourid] [$::nettype($net) intclient2uid $net $ourid]]] + if {[string length $nspass] != 0 && [string length $nickserv] != 0} { + # only works if nettype is ts6! + if {[string first [debugserv.find6sid $net $nsserv] [$::nettype($net) nick2uid $n $nickserv]] == 0} { + $::nettype($net) privmsg $nsock $ourid $nickserv $nspass + } { + $::nettype($net) privmsg $nsock $ourid $logchan [gettext debugserv.impostornickserv $nickserv [$::nettype($net) nick2uid $n $nickserv] $nsserv [debugserv.find6sid $net $nsserv]] + } + } + after 650 $::nettype($net) putjoin $nsock $ourid $logchan + after 700 [list $::nettype($net) putmode $nsock $ourid $logchan "+ao" [format "%s %s" [$::nettype($net) intclient2uid $net $ourid] [$::nettype($net) intclient2uid $net $ourid]]] bind $nsock msg [tnda get "debugserv/$net/ourid"] "metadata" [list debugserv.metadata $net] # bind $nsock msg [tnda get "debugserv/$net/ourid"] "rehash" [list debugserv.rehash $net] # bind $nsock pub - "gettext" [list debugserv.gettext $net] diff --git a/services.conf.example b/services.conf.example @@ -28,4 +28,8 @@ debugserv "pand" { host services.umbrellix.net modes +oiS comment "Or +oiDS if you dont want it to hear channel convos" + comment "idcommand is obvious." + nickserv "NickServ" + nsserv services.umbrellix.net + idcommand "IDENTIFY InvictusWAUS None" }