home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.madoka.org
/
2014.12.ftp.madoka.org.tar
/
ftp.madoka.org
/
pub
/
plum
/
2.x
/
plum2_15_2.lzh
/
module
/
channel
/
mode
/
oper
/
set.plm
< prev
Wrap
Text File
|
1997-12-12
|
6KB
|
197 lines
# <!-- -*- perl -*-
# $Id: set.plm,v 2.4 1997/12/12 21:51:00 hasegawa Exp $
# copyright (c)1997 pupu_j <hasegawa@agusa.nuie.nagoya-u.ac.jp>
package channel_mode_oper_set;
$DELAY = 20;
$_ = 'channel_mode_oper_set';
sub main_loop {
local($userno) = @_;
local($delay, $no, $chan, @names);
$delay = &'property($userno, 'delay');
$delay = $DELAY unless defined($delay);
foreach $key (keys(%operlist)) {
($no, $chan) = split(/$;/, $key, 2);
next unless $no == $userno;
next unless &'exist($'nameslist{$no, $chan}, "\@$'nickname[$userno]");
next if $operlist{$key} eq $;;
$wait[$userno]++;
@names = &'array($operlist{$key});
next unless $wait[$userno] >= $delay;
&'s_print($'server[$userno], '', 'MODE', $chan, '+o', shift(@names));
$operlist{$key} = &'list(@names);
$wait[$userno] = 0;
}
}
sub ss_join {
local($serverno, $prefix, $cmd, $chan) = @_;
local($userno, $nick, $regex, $name, $mode, $delay);
$userno = $'userno[$serverno];
$nick = &'prefix($prefix);
($name, $mode) = (split(/\cG/, $chan), '');
if ($nick ne $'nick[$serverno] && index($mode, 'o') == -1) {
foreach $not (&'property($userno, 'not')) {
$regex = &'regex($not);
return ($prefix, $cmd, $chan) if $prefix =~ /$regex/i;
}
foreach $user (&'property($userno, 'user')) {
$regex = &'regex($user);
next unless $prefix =~ /$regex/i;
$delay = &'property($userno, 'delay');
$delay = $DELAY unless defined($delay);
if ($delay) {
$operlist{$userno, $name} = &'add($operlist{$userno, $name}, $nick);
} else {
&'s_print($serverno, '', 'MODE', $name, '+o', $nick);
}
return ($prefix, $cmd, $chan);
}
}
return ($prefix, $cmd, $chan);
}
sub ss_mode {
local($serverno, $prefix, $cmd, @params) = @_;
local($chan, $mode, @modes) = @params;
local($userno, $flag, $name);
$userno = $'userno[$serverno];
foreach $char (split(//, $mode)) {
if ($char eq '+' || $char eq '-') {
$flag = $char;
} elsif ($char eq 'b') {
shift(@modes);
} elsif ($char eq 'i') {
} elsif ($char eq 'k') {
shift(@modes);
} elsif ($char eq 'l') {
shift(@modes) if $flag eq '+';
} elsif ($char eq 'o') {
$name = shift(@modes);
if ($flag eq '+') {
$operlist{$userno, $chan} = &'remove($operlist{$userno, $chan}, $name);
}
} elsif ($char eq 'v') {
shift(@modes);
}
}
return ($prefix, $cmd, @params);
}
sub ss_nick {
local($serverno, $prefix, $cmd, $newnick) = @_;
local($userno, $nick, $no, $chan);
$userno = $'userno[$serverno];
$nick = &'prefix($prefix);
if ($nick ne $'nick[$serverno]) {
foreach $key (keys(%operlist)) {
($no, $chan) = split(/$;/, $key, 2);
next unless $no == $userno;
$operlist{$no, $chan} = &'change($operlist{$no, $chan}, $nick, $newnick);
}
}
return ($prefix, $cmd, $newnick);
}
sub ss_part {
local($serverno, $prefix, $cmd, $chan, $msg) = @_;
local($nick, $userno);
$userno = $'userno[$serverno];
$nick = &'prefix($prefix);
if ($nick eq $'nick[$serverno]) {
delete $operlist{$userno, $chan};
} else {
$operlist{$userno, $chan} = &'remove($operlist{$userno, $chan}, $nick);
}
return ($prefix, $cmd, $chan, $msg);
}
sub ss_quit {
local($serverno, $prefix, $cmd, $msg) = @_;
local($userno, $nick, $no, $chan);
$userno = $'userno[$serverno];
$nick = &'prefix($prefix);
foreach $key (keys(%operlist)) {
($no, $chan) = split(/$;/, $key, 2);
next unless $no == $userno;
$operlist{$no, $chan} = &'remove($operlist{$no, $chan}, $nick);
}
return ($prefix, $cmd, $msg);
}
sub ss_kick {
local($serverno, $prefix, $cmd, $chan, $who, $msg) = @_;
local($userno) = $'userno[$serverno];
if ($who eq $'nick[$serverno]) {
delete $operlist{$userno, $chan};
} else {
$operlist{$userno, $chan} = &'remove($operlist{$userno, $chan}, $who);
}
return ($prefix, $cmd, $chan, $who, $msg);
}
__END__
--><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML><HEAD><TITLE> channel/mode/oper/set.plm </TITLE></HEAD><BODY>
$B%*%s%i%$%s%I%-%e%a%s%H(B
<HR><H3> $BL>A0(B </H3>
channel/mode/oper/set.plm - $BFCDj$N?M$r%A%c%s%M%k%*%Z%l!<%?$K$9$k(B
<HR><H3> $B@bL@(B </H3>
$B%A%c%s%M%k$KF~$C$F$-$??M$,;XDj$5$l$??M$J$i!"(B
$B$=$N?M$r%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
$B<B:]$K$O%A%c%s%M%k$KF~$C$F$-$?$H$-$K$9$0$K%A%c%s%M%k%*%Z%l!<%?(B
$B$K$9$k$o$1$G$O$J$/!"0lDj;~4VBT$C$F$+$i%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
<HR><H3> $B%W%m%Q%F%#(B </H3>
<DL>
<DT> channel.mode.oper.set.delay $BBT$A;~4V(B
<DD> $B%A%c%s%M%k%*%Z%l!<%?$K$9$k$^$G$NBT$A;~4V$G$9!#(B
$BC/$+$,%A%c%s%M%k$KF~$C$F$/$k$H!"(B
$B$3$3$G;XDj$5$l$?$N?t$@$1FbIt$G%+%&%s%H$7!"(B
$B$=$N8e$G$=$N?M$r%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
$B%G%U%)%k%H$G$O(B20$B$H$J$C$F$$$^$9!#(B
<DT> channel.mode.oper.set.not* $B%f!<%6%^%9%/(B
<DD> $B%A%c%s%M%k$KF~$C$F$-$??M$,$3$3$G;XDj$5$l$?$b$N$K%^%C%A$7$?$i!"(B
$B$=$N?M$O%A%c%s%M%k%*%Z%l!<%?$K$7$^$;$s!#(B
$B$3$N;XDj$O!V(Bchannel.mode.oper.set.user$B!W$h$jM%@h$5$l$^$9!#(B
<DT> channel.mode.oper.set.user* $B%f!<%6%^%9%/(B
<DD> $B%A%c%s%M%k$KF~$C$F$-$??M$,$3$3$G;XDj$5$l$?$b$N$K%^%C%A$7$?$i!"(B
$B$=$N?M$r%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
</DL>
<HR><H3> $B@_DjNc(B </H3>
<PRE>
+ channel/mode/oper/set.plm
channel.mode.oper.set.user: pupu_j!*@*
channel.mode.oper.set.user: pupu_d!*@*
</PRE>
$B%A%c%s%M%k$KF~$C$F$-$??M$,!V(Bpupu_j!*@*$B!W$+!V(Bpupu_d!*@*$B!W$K%^%C%A$9$k$H!"(B
$B$=$N?M$r%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
<PRE>
+ channel/mode/oper/set.plm
channel.mode.oper.set.delay: 0
channel.mode.oper.set.not: *!*@*.com
channel.mode.oper.set.user: *!*@*
</PRE>
$B%A%c%s%M%k$KF~$C$F$-$??M$,!V(B*!*@*.com$B!W$K%^%C%A$7$J$1$l$P!"(B
$B$9$0$K$=$N?M$r%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
</BODY></HTML>