261 |
$tags_data->{ $tag } = join('', @{ $tag_data_block->{$tag} }); |
$tags_data->{ $tag } = join('', @{ $tag_data_block->{$tag} }); |
262 |
|
|
263 |
my $item_type_nr = ord(substr( $tags_data->{$tag}, 3, 1 )); |
my $item_type_nr = ord(substr( $tags_data->{$tag}, 3, 1 )); |
264 |
print "DATA $tag ",dump( $tags_data ), " item type: ", ( $item_type->{ $item_type_nr } || "UNKWOWN '$item_type_nr' in " . dump( $item_type ) ), "\n"; |
print "DATA $tag ",dump( $tags_data ), " item type: ", ( $item_type->{ $item_type_nr } || "UNKWOWN '$item_type_nr'" ), "\n"; |
265 |
|
|
266 |
return $last_block; |
return $last_block + 1; |
267 |
} |
} |
268 |
|
|
269 |
sub read_tag { |
sub read_tag { |
451 |
sub assert { |
sub assert { |
452 |
my ( $from, $to ) = @_; |
my ( $from, $to ) = @_; |
453 |
|
|
|
return unless $assert->{expect}; |
|
|
|
|
454 |
$from ||= 0; |
$from ||= 0; |
455 |
$to = length( $assert->{expect} ) if ! defined $to; |
$to = length( $assert->{expect} ) if ! defined $to; |
456 |
|
|
528 |
} sort { length($a) <=> length($b) } keys %$dispatch; |
} sort { length($a) <=> length($b) } keys %$dispatch; |
529 |
warn "?? payload dispatch to ",dump( $payload, $dispatch, $to ) if $debug; |
warn "?? payload dispatch to ",dump( $payload, $dispatch, $to ) if $debug; |
530 |
|
|
531 |
if ( defined $to && $payload ) { |
if ( defined $to ) { |
532 |
my $rest = substr( $payload, length($to) ); |
my $rest = substr( $payload, length($to) ) if length($to) < length($payload); |
533 |
warn "## DISPATCH payload to with rest", dump( $payload, $to, $rest ) if $debug; |
warn "## DISPATCH payload to with rest", dump( $payload, $to, $rest ) if $debug; |
534 |
$dispatch->{ $to }->( $rest ); |
$dispatch->{ $to }->( $rest ); |
535 |
} else { |
} else { |