home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.madoka.org
/
2014.12.ftp.madoka.org.tar
/
ftp.madoka.org
/
pub
/
plum
/
2.x
/
plum2_32_1.lzh
/
module
/
channel
/
join
/
connect.plm
next >
Wrap
Text File
|
1999-02-20
|
5KB
|
157 lines
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- $_ if 0; # -*- perl -*-
# $Id: connect.plm,v 2.14 1999/01/20 14:49:20 hasegawa Exp $
# copyright (c)1998-1999 Yoshinori Hasegawa <hasegawa@madoka.org>
package channel_join_connect;
$_ = 'channel_join_connect';
sub server_open {
local($serverno) = @_;
local($userno, $i, $chan, $key, @chan, @key, $name, $keylist);
$userno = $'userno[$serverno];
if (!defined($joinlist[$userno])) {
$joinlist[$userno] = '';
$keylist = '';
foreach $channel (&'property($userno, 'channel')) {
($chan, $key) = split(/\s+/, $channel, 2);
@chan = split(/\,/, $chan);
@key = split(/\,/, $key || '');
for ($i = 0; $i < @chan; $i++) {
$name = &'real($chan[$i]);
next unless $name;
$joinlist[$userno] = &'add($joinlist[$userno], $name);
if ($key[$i] && !$keyword{$userno, $name}) {
$keyword{$userno, $name} = $key[$i];
}
$keylist = &'add($keylist, $keyword{$userno, $name} || '');
}
}
}
if ($joinlist[$userno]) {
&'s_print($serverno, '', 'JOIN', join(',', &'array($joinlist[$userno])), join(',', &'array($keylist)));
}
}
sub module_disable {
local($userno) = @_;
local($no, $chan);
undef($joinlist[$userno]);
foreach $key (keys(%keyword)) {
($no, $chan) = split(/$;/, $key, 2);
next unless $no == $userno;
delete $keyword{$key};
}
}
sub ss_join {
local($serverno, $prefix, $cmd, @params) = @_;
local($name, $mode);
($name, $mode) = (split(/\cG/, $params[0]), '');
$joinlist[$'userno[$serverno]] = &'add($joinlist[$'userno[$serverno]], $name) if &'prefix($prefix) eq $'nick[$serverno];
return ($prefix, $cmd, @params);
}
sub ss_kick {
local($serverno, $prefix, $cmd, @params) = @_;
$joinlist[$'userno[$serverno]] = &'remove($joinlist[$'userno[$serverno]], $params[0]) if $params[1] eq $'nick[$serverno];
return ($prefix, $cmd, @params);
}
sub ss_part {
local($serverno, $prefix, $cmd, @params) = @_;
$joinlist[$'userno[$serverno]] = &'remove($joinlist[$'userno[$serverno]], $params[0]) if &'prefix($prefix) eq $'nick[$serverno];
return ($prefix, $cmd, @params);
}
sub ss_mode {
local($serverno, $prefix, $cmd, @params) = @_;
local($chan, $mode, @modes, $char, $flag, $name, $i);
($chan, $mode, @modes) = @params;
if (&'channel($chan)) {
for ($i = 0; $i < length($mode); $i++) {
$char = substr($mode, $i, 1);
if ($char eq '+' || $char eq '-') {
$flag = $char;
} elsif ($char eq 'b') {
shift(@modes);
} elsif ($char eq 'e') {
shift(@modes);
} elsif ($char eq 'I') {
shift(@modes);
} elsif ($char eq 'k') {
if ($flag eq '+') {
$keyword{$'userno[$serverno], $chan} = shift(@modes);
} else {
delete $keyword{$'userno[$serverno], $chan};
shift(@modes);
}
} elsif ($char eq 'l') {
if ($flag eq '+') {
shift(@modes);
}
} elsif ($char eq 'O') {
shift(@modes);
} elsif ($char eq 'o') {
shift(@modes);
} elsif ($char eq 'v') {
shift(@modes);
}
}
}
return ($prefix, $cmd, @params);
}
__END__
--><HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-2022-JP">
<LINK REV="made" HREF="mailto:hasegawa@madoka.org">
<TITLE>channel/join/connect.plm</TITLE></HEAD><BODY>
$B%*%s%i%$%s%I%-%e%a%s%H(B
<HR><H3>$BL>A0(B</H3>
channel/join/connect.plm - $B%5!<%P$K@\B3$7$?$H$-$K;XDj$7$?%A%c%s%M%k$KF~$k(B
<HR><H3>$B@bL@(B</H3>
$B%5!<%P$K@\B3$7$?$H$-$K!";XDj$7$?%A%c%s%M%k$KF~$j$^$9!#(B
$B%5!<%P$H$N@\B3$,@Z$l$F:F$S@\B3$7D>$7$?$H$-$O!"(B
$B;XDj$7$?%A%c%s%M%k$H$O4X78$J$/!"(B
$B@\B3$,@Z$l$kA0$KF~$C$F$$$?%A%c%s%M%k$KF~$j$^$9!#(B
<HR><H3>$B%W%m%Q%F%#(B</H3>
<DL>
<DT> channel.join.connect.channel* ($B%A%c%s%M%k(B) ($B%-!<(B)
</DT>
<DD> $B%5!<%P$K@\B3$7$?$H$-$KF~$k%A%c%s%M%k$r;XDj$7$^$9!#(B
$B%A%c%s%M%k$N%-!<$,;XDj$5$l$F$$$k$H$-$O!"$=$N%-!<$r;H$$$^$9!#(B
</DD>
</DL>
<HR><H3>$B@_DjNc(B</H3>
<PRE>
+ channel/join/connect.plm
channel.join.connect.channel: #$B$^$I$+(B mdk
</PRE>
$B%5!<%P$K@\B3$7$?$H$-$K!"!V(B#$B$^$I$+!W$K!V(Bmdk$B!W$H$$$&%-!<$GF~$j$^$9!#(B
<PRE>
+ channel/join/connect.plm
channel.join.connect.channel: #$B$^$I$+(B:*.jp,#$B$W$i$`(B:*.jp
channel.join.connect.channel: #$B$W$i$`(B
</PRE>
$B%5!<%P$K@\B3$7$?$H$-$K!"!V(B#$B$^$I$+(B:*.jp$B!W!"!V(B#$B$W$i$`(B:*.jp$B!W!"(B
$B!V(B#$B$W$i$`!W$N(B3$B$D$N%A%c%s%M%k$KF~$j$^$9!#(B
</BODY></HTML>