Fix ugly rubocop if and silent disconnect
This commit is contained in:
parent
ddef46991b
commit
940cc4269f
|
@ -79,7 +79,7 @@ class GameClient
|
|||
chunk:,
|
||||
client_id:,
|
||||
reason: reason == '' ? nil : reason,
|
||||
silent:
|
||||
silent: silent != 0
|
||||
)
|
||||
if @client.hooks[:client_drop]
|
||||
@client.hooks[:client_drop].call(context)
|
||||
|
|
|
@ -83,11 +83,7 @@ class Unpacker
|
|||
str = ''
|
||||
@data.each_with_index do |byte, index|
|
||||
if byte == 0x00
|
||||
@data = if index == @data.length - 1
|
||||
nil
|
||||
else
|
||||
@data[(index + 1)..]
|
||||
end
|
||||
@data = index == @data.length - 1 ? nil : @data[(index + 1)..]
|
||||
return str
|
||||
end
|
||||
str += byte.chr
|
||||
|
|
Loading…
Reference in a new issue