rubocop fixes
Some checks failed
Runtime tests / syntax (push) Has been cancelled
Runtime tests / unit-tests (push) Has been cancelled
Runtime tests / hooks (push) Has been cancelled
Runtime tests / doc-index (push) Has been cancelled
Integration tests / connect-to-server (push) Has been cancelled
Integration tests / srv-chat (push) Has been cancelled
Static analysis / check (push) Has been cancelled
Style / lint (push) Has been cancelled
Some checks failed
Runtime tests / syntax (push) Has been cancelled
Runtime tests / unit-tests (push) Has been cancelled
Runtime tests / hooks (push) Has been cancelled
Runtime tests / doc-index (push) Has been cancelled
Integration tests / connect-to-server (push) Has been cancelled
Integration tests / srv-chat (push) Has been cancelled
Static analysis / check (push) Has been cancelled
Style / lint (push) Has been cancelled
This commit is contained in:
parent
af7367be0c
commit
10ca8238a8
|
@ -55,10 +55,9 @@ class Packer
|
||||||
first = "1#{sign}#{num_bits[-6..]}"
|
first = "1#{sign}#{num_bits[-6..]}"
|
||||||
|
|
||||||
num_bits = num_bits[0..-7]
|
num_bits = num_bits[0..-7]
|
||||||
bytes = []
|
bytes = num_bits.chars.groups_of(7).map do |seven_bits|
|
||||||
num_bits.chars.groups_of(7).each do |seven_bits|
|
|
||||||
# mark all as extended
|
# mark all as extended
|
||||||
bytes << "1#{seven_bits.join.rjust(7, '0')}"
|
"1#{seven_bits.join.rjust(7, '0')}"
|
||||||
end
|
end
|
||||||
# least significant first
|
# least significant first
|
||||||
bytes = bytes.reverse
|
bytes = bytes.reverse
|
||||||
|
|
|
@ -451,7 +451,8 @@ class TeeworldsClient
|
||||||
# in sequence
|
# in sequence
|
||||||
@netbase.ack = (@netbase.ack + 1) % NET_MAX_SEQUENCE
|
@netbase.ack = (@netbase.ack + 1) % NET_MAX_SEQUENCE
|
||||||
else
|
else
|
||||||
puts "warning: got chunk out of sequence! seq=#{chunk.seq} expected_seq=#{(@netbase.ack + 1) % NET_MAX_SEQUENCE}"
|
puts 'warning: got chunk out of sequence! ' \
|
||||||
|
"seq=#{chunk.seq} expected_seq=#{(@netbase.ack + 1) % NET_MAX_SEQUENCE}"
|
||||||
if seq_in_backroom?(chunk.seq, @netbase.ack)
|
if seq_in_backroom?(chunk.seq, @netbase.ack)
|
||||||
puts ' dropping known chunk ...'
|
puts ' dropping known chunk ...'
|
||||||
next
|
next
|
||||||
|
|
Loading…
Reference in a new issue