rubocop -A

This commit is contained in:
ChillerDragon 2024-01-20 22:37:18 +08:00
parent f9819565e4
commit 0dcb85a0e3
8 changed files with 8 additions and 8 deletions

View file

@ -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

View file

@ -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

View file

@ -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}"

View file

@ -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 ...'

View file

@ -25,7 +25,7 @@ class NetObj
end
def validate
@fields.select(&:nil?).empty?
@fields.none?(&:nil?)
end
def init_unpacker(u)

View file

@ -22,7 +22,7 @@ class SnapItemBase
end
def validate
@fields.select(&:nil?).empty?
@fields.none?(&:nil?)
end
def init_unpacker(u)

View file

@ -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

View file

@ -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:)