Improved reconnect flow

This commit is contained in:
2024-01-29 23:16:06 +01:00
parent bf08205c7d
commit b22d0b1367
25 changed files with 212 additions and 99 deletions

View File

@ -13,7 +13,7 @@ func get_handler(index: int) -> PacketHandler:
func set_handler(index: int, node: PacketHandler):
handlers[index] = node
func handle_packet(packet: PackedByteArray, peer: PacketPeer):
func handle_packet(packet: PackedByteArray):
var type := packet.decode_u8(0)
var handler := get_handler(type)
@ -21,5 +21,5 @@ func handle_packet(packet: PackedByteArray, peer: PacketPeer):
push_warning("Unknown packet type %d" % type)
return
handler.handle_packet(packet.slice(1), peer)
handler.handle_packet(packet.slice(1))
download += packet.size()