Thoughts about ctrl close

This commit is contained in:
ChillerDragon 2022-11-12 12:08:25 +01:00
parent e914ec3fa2
commit e3292deb15

View file

@ -127,9 +127,15 @@ class TeeworldsClient
end end
end end
# TODO: this is same in client and server
# move to NetBase???
def send_ctrl_close
@netbase&.send_packet([NET_CTRLMSG_CLOSE], 0, control: true)
end
def disconnect def disconnect
puts 'disconnecting.' puts 'disconnecting.'
@netbase&.send_packet([NET_CTRLMSG_CLOSE], 0, control: true) send_ctrl_close
@s&.close @s&.close
@signal_disconnect = true @signal_disconnect = true
end end