57
|
0 |
0 |
$$self{'parse'} ||= {'Supports', sub {
$self->supports_parse($_[0], $$self{'peer_supports'});
}
, 'Key', sub {
}
, 'ValidateNick', sub {
$$self{'peer_nick'} = $_[0];
$$self{'NickList'}{$$self{'peer_nick'}} = $$self{'peer_supports'};
$$self{'status'} = 'connected';
$self->cmd('Hello');
}
, 'Version', sub {
$$self{'NickList'}{$$self{'peer_nick'}}{'Version'} = $_[0];
}
, 'GetNickList', sub {
$self->cmd('NickList');
$self->cmd('OpList');
}
, 'MyINFO', sub {
my($nick, $info) = $_[0] =~ /\S+\s+(\S+)\s+(.*)/;
return if $nick ne $$self{'peer_nick'};
$$self{'NickList'}{$nick}{'Nick'} = $nick;
$self->info_parse($info, $$self{'NickList'}{$nick});
$$self{'NickList'}{$nick}{'online'} = 1;
}
, 'GetINFO', sub {
my $to = shift();
}
, 'chatline', sub {
$$self{'parent'}->rcmd('chatline', @_);
}
} |
89
|
0 |
0 |
$$self{'cmd'} ||= {'Lock', sub {
$self->sendcmd('Lock', $$self{'Lock'});
}
, 'HubName', sub {
$self->sendcmd('HubName', $$self{'HubName'});
}
, 'ValidateDenide', sub {
$self->sendcmd('ValidateDenide');
}
, 'Hello', sub {
$self->sendcmd('Hello', $$self{'peer_nick'});
}
, 'NickList', sub {
$self->sendcmd('NickList', join('$$', grep({not $$self{'NickList'}{$_}{'oper'};} keys %{$$self{'NickList'};})));
}
, 'OpList', sub {
$self->sendcmd('OpList', join('$$', grep({$$self{'NickList'}{$_}{'oper'};} keys %{$$self{'NickList'};})));
}
, 'chatline_from', sub {
my $from = shift();
foreach $_ (@_) {
return unless $$self{'socket'};
$self->log('dcdmp', "($$self{'number'}) we send [", "<$from> $_|", ']:', $$self{'socket'}->send("<$from> $_|"), $!);
};
}
, 'chatline', sub {
my($nick, $text) = $_[0] =~ /^<([^>]+)> (.+)$/;
$self->log('dbg', "[$$self{'number'}]", 'chatline Rstart');
$self->log('dbg', "[$$self{'number'}] to", $$_{'number'}), $_->cmd('chatline_from', $$self{'peer_nick'}, $text) foreach (grep {$_ ne $self if $_;} values %{$$self{'parent'}{'clients'};});
}
} |