HolePuncher
HolePuncher copied to clipboard
Make it work with Godot 4.2.2
Hi there! We've been adapting the script to make it work properly on Godot 4.2.2. Here are the changes we had to introduce to make it work for us.
- Fixed the
SERVER_INFO
packet parsing (it was just picking the port and ignoring address and peer name). - Changed remaining calls from
listen
(not present anymore in Godot 4.2.2) tobind
. - Closed sockets before signaling
hole_punched
, so if a new socket starts immediately afterwards, there won't be any problems with the port being in use. - Made sure that both
server_udp
andpeer_udp
are closed before emittinghole_punched
.
Hope this is useful!