making client output more useful/accurate
This commit is contained in:
parent
5a30febc65
commit
0b509b19f0
@ -52,11 +52,13 @@ def run_client(options)
|
|||||||
when :read
|
when :read
|
||||||
sock.send("marco #{client_name}\n", 0)
|
sock.send("marco #{client_name}\n", 0)
|
||||||
location = sock.recv(100).to_s.split[2,4].map(&:to_i)
|
location = sock.recv(100).to_s.split[2,4].map(&:to_i)
|
||||||
puts "#{location.first} #{location.last}"
|
puts "marco #{client_name} -> #{location.first} #{location.last}"
|
||||||
when :write
|
when :write
|
||||||
sock.send("polo #{client_name} #{nextloc.first} #{nextloc.last}\n", 0)
|
sock.send("polo #{client_name} #{nextloc.first} #{nextloc.last}\n", 0)
|
||||||
nextloc = sock.recv(100).to_s.split.map(&:to_i)
|
recv_loc = sock.recv(100).to_s.split.map(&:to_i)
|
||||||
puts "sent location '#{nextloc.first} #{nextloc.last}'"
|
puts "polo #{client_name} #{nextloc.first} #{nextloc.last} " <<
|
||||||
|
"-> #{recv_loc.first} #{recv_loc.last}"
|
||||||
|
nextloc = recv_loc
|
||||||
end
|
end
|
||||||
sock.close
|
sock.close
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user