вот выдержки из send\bRO.pm:
Код: Выделить всё
sub new {
my ($class) = @_;
my $self = $class->SUPER::new(@_);
my %packets = (
'0437' => ['move','a4', [qw(coordString)]],
);
$self->{packet_list}{$_} = $packets{$_} for keys %packets;
my %handlers = qw(
move 0437
);
$self->{packet_lut}{$_} = $handlers{$_} for keys %handlers;
return $self;
}
sub sendMove {
my ($self, $x, $y) = @_;
$self->sendToServer($self->reconstruct({
switch => 'move',
coordString => getCoordString(int $x, int $y, 1),
}));
debug "Sent move to: $x, $y\n", "sendPacket", 2;
}
Код: Выделить всё
sub new {
my ($class) = @_;
my $self = $class->SUPER::new(@_);
my %handlers = qw(
);
$self->{packet_lut}{$_} = $handlers{$_} for keys %handlers;
return $self;
}
sub sendMove {
my $self = shift;
my $x = int scalar shift;
my $y = int scalar shift;
my $msg;
$msg = pack("C*", 0x5F, 0x03) . getCoordString($x, $y, 1);
$self->sendToServer($msg);
debug "Sent move to: $x, $y\n", "sendPacket", 2;
}
во втором случае пакет move никуда не записан, сразу идёт функция sub sendMove
хде правда?