rubocop -A
This commit is contained in:
parent
f9819565e4
commit
0dcb85a0e3
|
@ -68,7 +68,7 @@ class Gui < Gosu::Window
|
|||
own_tee = @tees[@client.local_client_id]
|
||||
own_tee = @tees.first.last if own_tee.nil?
|
||||
offset = center_around_tee(own_tee)
|
||||
@tees.each do |_id, tee|
|
||||
@tees.each_value do |tee|
|
||||
@tee_image.draw(tee.x + offset.x, tee.y + offset.y)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -22,7 +22,7 @@ class Array
|
|||
group = []
|
||||
end
|
||||
end
|
||||
groups.push(group) unless group.size.zero?
|
||||
groups.push(group) unless group.empty?
|
||||
groups
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ class Context
|
|||
end
|
||||
|
||||
def verify
|
||||
@data.each do |key, _value|
|
||||
@data.each_key do |key|
|
||||
next if @old_data.key? key
|
||||
|
||||
raise "Error: invalid data key '#{key}'\n valid keys: #{@old_data.keys}"
|
||||
|
|
|
@ -149,7 +149,7 @@ class GameServer
|
|||
return if call_hook(:shutdown, Context.new(nil)).nil?
|
||||
|
||||
puts '[gameserver] disconnecting all clients ...'
|
||||
@server.clients.each do |_id, client|
|
||||
@server.clients.each_value do |client|
|
||||
@server.send_ctrl_close(client, @server.shutdown_reason)
|
||||
end
|
||||
puts '[gameserver] shutting down ...'
|
||||
|
|
|
@ -25,7 +25,7 @@ class NetObj
|
|||
end
|
||||
|
||||
def validate
|
||||
@fields.select(&:nil?).empty?
|
||||
@fields.none?(&:nil?)
|
||||
end
|
||||
|
||||
def init_unpacker(u)
|
||||
|
|
|
@ -22,7 +22,7 @@ class SnapItemBase
|
|||
end
|
||||
|
||||
def validate
|
||||
@fields.select(&:nil?).empty?
|
||||
@fields.none?(&:nil?)
|
||||
end
|
||||
|
||||
def init_unpacker(u)
|
||||
|
|
|
@ -438,7 +438,7 @@ class TeeworldsClient
|
|||
|
||||
def process_server_packet(packet)
|
||||
data = packet.payload
|
||||
if data.size.zero?
|
||||
if data.empty?
|
||||
puts 'Error: packet payload is empty'
|
||||
puts packet
|
||||
return
|
||||
|
|
|
@ -380,7 +380,7 @@ class TeeworldsServer
|
|||
# msg_snap_single = NetChunk.create_header(vital: false, size: data.size + 1) +
|
||||
# [pack_msg_id(NETMSG_SNAPSINGLE, system: true)] +
|
||||
# data
|
||||
@clients.each do |_id, client|
|
||||
@clients.each_value do |client|
|
||||
next unless client.in_game?
|
||||
|
||||
@netbase.send_packet(msg_snap_empty, chunks: 1, client:)
|
||||
|
|
Loading…
Reference in a new issue