]> jfr.im git - irc/SurrealServices/srsv.git/commitdiff
NullServ! Great for ranting
authorerry <redacted>
Sat, 16 Jul 2011 09:56:49 +0000 (09:56 +0000)
committererry <redacted>
Sat, 16 Jul 2011 09:56:49 +0000 (09:56 +0000)
Fix some bugs in unreal
Code still sucks :F

git-svn-id: http://svn.tabris.net/repos/srsv@3541 70d4eda1-72e9-0310-a436-91e5bd24443c

branches/0.5.0/SrSv/Unreal/Parse.pm
branches/0.5.0/SrSv/Unreal/Send.pm
branches/0.5.0/modules/echoserv.pm
branches/0.5.0/modules/nullserv.pm [new file with mode: 0644]
branches/0.5.0/modules/serviceslibs/botserv.pm
branches/0.5.0/modules/serviceslibs/chanserv.pm
branches/0.5.0/modules/serviceslibs/nickserv.pm

index 771bac227bd3909062d47d7d165509ac3b224f39..9e159c53ac2198beb1056acc077b9321b1b0f9c8 100644 (file)
@@ -411,8 +411,10 @@ sub AWAY($) {
 
 sub NICK($) {
        my ($event, @args);
+       #>> 32 :erry_ & erry2 :1310809099
        if($_[0] =~ /^:(\S+) (?:NICK|\&) (\S+) :?(\S+)$/) {
-               return ('NICKCHANGE', undef, undef, WF_NICK, $1, $2, $3);
+               my $user = {NICK=>$1};          
+               return ('NICKCHANGE', undef, undef, WF_NICK, $user, $2, $3);
        }
        elsif(CLK && NICKIP && $_[0] =~ /^(?:NICK|\&) (\S+) (\d+) (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) (\S+) (\S+) (\S+) :(.*)$/) {
 #NICK Guest57385 1 !14b7t0 northman tabriel.tabris.net 38 0 +iowghaAxNWzt netadmin.SCnet.ops SCnet-3B0714C4.tabris.net CgECgw== :Sponsored By Skuld
@@ -475,10 +477,10 @@ sub NICK($) {
 }
 
 sub QUIT($) {
-       if ($_[0] =~ /^:(\S+) QUIT :(.*)$/) {
-               my $user = { NICK=>$1 };
-               return ('QUIT', 0, undef, WF_NICK, $user, $2);
-       }
+       print "?????????/";
+       $_[0] =~ /^:(\S+) (?:QUIT|\,) :(.*)$/;
+       my $user = { NICK=>$1 };
+       return ('QUIT', 0, undef, WF_NICK, $user, $2);
 }
 
 sub KILL($) {
index 91d09106fec9592406c099c46e5d0f8a253871cd..d0db7ac4ee818f7b240410808cd192178c6e573e 100644 (file)
@@ -324,8 +324,9 @@ sub setumode($$$) {
 
 sub setsvsstamp($$$) {
        my ($src, $dst, $stamp) = @_;
-       
-       ircsend(":$src SVS2MODE $dst +d $stamp");
+       my $srcN = $src->{NICK};
+       my $dstN = $dst->{NICK};
+       ircsend(":$srcN SVS2MODE $dstN +d $stamp");
        # This function basically set the svsstamp to
        # be the same as the userid. Not all ircd will
        # support this function.
index c2af21a8a64cd4accaf4c1b215b8515eacb29487..aa4c1be0ea91401790e8ece447394a756d34862c 100644 (file)
@@ -20,13 +20,24 @@ use SrSv::IRCd::Event qw( addhandler );
 use SrSv::Agent;
 use SrSv::Conf2Consts qw( main );
 
-my $esnick = 'EchoServ';
-
-addhandler('PRIVMSG', undef, lc $esnick, 'echoserv::ev_privmsg');
-sub ev_privmsg { ircd::privmsg($_[1], $_[0], $_[2]) }
+my $esnick_default = 'EchoServ';
+my $esnick = $esnick_default;
+addhandler('PRIVMSG', undef, undef, 'echoserv::ev_privmsg');
+our $esuser = { NICK => $esnick, ID => "123AAAAAI" }; #FIXME = erry
+sub ev_privmsg { 
+       $esuser = { NICK => $esnick, ID => "123AAAAAI" }; #FIXME = erry
+       my ($user, $dstUser, $msg) = @_;
+       return unless (lc $dstUser->{NICK} eq lc $esnick);
+       ircd::privmsg($dstUser, $user->{ID}, $msg);
+}
 
 addhandler('NOTICE', undef, lc $esnick, 'echoserv::ev_notice');
-sub ev_notice { ircd::notice($_[1], $_[0], $_[2]) }
+sub ev_notice { 
+       $esuser = { NICK => $esnick, ID => "123AAAAAI" }; #FIXME = erry
+       my ($user, $dstUser, $msg) = @_;
+       return unless (lc $dstUser->{NICK} eq lc $esnick);
+       ircd::notice($dstUser, $user, $msg);
+}
 
 agent_connect($esnick, 'services', undef, '+pqzBGHS', 'Echo Server');
 agent_join($esnick, main_conf_diag);
diff --git a/branches/0.5.0/modules/nullserv.pm b/branches/0.5.0/modules/nullserv.pm
new file mode 100644 (file)
index 0000000..4a7aa12
--- /dev/null
@@ -0,0 +1,35 @@
+#      This file is part of SurrealServices.
+#
+#      SurrealServices is free software; you can redistribute it and/or modify
+#      it under the terms of the GNU General Public License as published by
+#      the Free Software Foundation; either version 2 of the License, or
+#      (at your option) any later version.
+#
+#      SurrealServices is distributed in the hope that it will be useful,
+#      but WITHOUT ANY WARRANTY; without even the implied warranty of
+#      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#      GNU General Public License for more details.
+#
+#      You should have received a copy of the GNU General Public License
+#      along with SurrealServices; if not, write to the Free Software
+#      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+package echoserv;
+use strict;
+
+use SrSv::IRCd::Event qw( addhandler );
+use SrSv::Agent;
+use SrSv::Conf2Consts qw( main );
+
+my $nnsnick_default = 'NullServ';
+my $nnsnick = $nsnick_default;
+
+agent_connect($nnsnick, 'services', undef, '+pqzBGHS', 'Null Server');
+agent_join($nnsnick, main_conf_diag);
+ircd::setmode($nnsnick, main_conf_diag, '+o', $nnsnick);
+
+sub init { }
+sub begin { }
+sub end { }
+sub unload { }
+
+1;
index c2ad550638d6cb36315918e48e2846e6217fa96a..0ebedf2651b3bbb58df18a981d7c450c8bd8ece0 100644 (file)
@@ -46,12 +46,7 @@ our $bsnick_default = 'BotServ';
 our $bsnick = $bsnick_default;
 our $botchmode;
 our $bsuser = { NICK => $bsnick, ID => "123AAAAAF" };
-if(!ircd::PREFIXAQ_DISABLE() && $IRCd_capabilities{"FOUNDER"} ne "" && $IRCd_capabilities{"ADMIN"} ne "") {
-       $botchmode = '+q';
-} else {
-       $botchmode = '+o';
-}
-print Dumper ($botchmode);
+
 *agent = \&chanserv::agent;
 
 our $calc_safe = new Safe;
@@ -882,6 +877,11 @@ sub bot_join($;$) {
        unless(is_agent_in_chan($nick, $cn)) {
                agent_join($bot, $cn);
                my $bot2 = { NICK => $nick, ID => ircd::getUuid($nick), UID=>ircd::getUuid($nick) };
+               if(!ircd::PREFIXAQ_DISABLE() && $IRCd_capabilities{"FOUNDER"} ne "" && $IRCd_capabilities{"ADMIN"} ne "") {
+                       $botchmode = '+q';
+               } else {
+                       $botchmode = '+o';
+               }
                ircd::setmode($bot2, $cn, $botchmode, $bot2 );
        }
 }
index 47f113f421393a58a0afb04348b24c96de5500b5..94ec077bb75e661f602b92bb3b479642bad95a98 100644 (file)
@@ -3307,7 +3307,7 @@ sub cs_join($@) {
                push @out_cns, $cn;
                
        }
-       ircd::svsjoin(get_user_agent($user), get_user_nick($user), @out_cns) if scalar @out_cns;
+       ircd::svsjoin(get_user_agent($user), $user, @out_cns) if scalar @out_cns;
        notice($user, @reply) if scalar @reply;
 }
 
index dbebabd813fcd5cb09b56e5670af08e04f4c9378..97a73cf50e21e55e5fbdd1131b6d376ff945ab98 100644 (file)
@@ -2890,8 +2890,7 @@ sub do_umode($$) {
 }
 
 sub notify_auths($$) {
-       my $user = @_;
-       my $nick = get_user_nick ($user);
+       my ($user, $nick) = @_;
        $get_num_nicktext_type->execute($nick, NTF_AUTH);
        my ($count) = $get_num_nicktext_type->fetchrow_array(); $get_num_nicktext_type->finish();
        notice($user, "$nick has $count channel authorizations awaiting action.", 
@@ -3373,6 +3372,7 @@ sub nick_delete($$) {
        my $nick = $user->{NICK};
        get_lock($nick);
        my $id = get_user_id($user);
+       print "DELETE: $nick, $id\n";
        $del_nickchg_id->execute($id); $del_nickchg_id->finish();
        $quit_update->execute($quit, $id); $quit_update->finish();
        $update_lastseen->execute($id); $update_lastseen->finish();