Fix reconnect crash

This commit is contained in:
ChillerDragon 2023-09-17 18:22:38 +02:00
parent 42ab29bbfe
commit a739190383
2 changed files with 6 additions and 1 deletions

View file

@ -63,6 +63,10 @@ class NetBase
# // TTTTTTTT
# // TTTTTTTT
# // TTTTTTTT
if @s.nil?
puts "Error: no active socket"
return
end
flags_bits = PacketFlags.new(opts).bits
ack = @ack
ip = @ip

View file

@ -191,8 +191,9 @@ class TeeworldsClient
def disconnect
puts 'disconnecting.'
send_ctrl_close
send_ctrl_close unless @s.nil?
@s&.close
@s = nil
@signal_disconnect = true
end