Detect disconnection and exit the script

This commit is contained in:
2021-03-04 21:39:51 +00:00
parent e4b51aa2d6
commit f35c7a4e51
3 changed files with 20 additions and 1 deletions

View File

@@ -447,3 +447,14 @@ class SelectTradePacket(Packet):
definition = [
{'selected_slot': VarInt},
]
class DisconnectPacket(Packet):
# Sent by the server before it disconnects a client
# https://wiki.vg/Protocol#Disconnect_.28play.29
id = 0x19
packet_name = 'disconnect'
definition = [
{'reason': String},
]