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