feat: updated engine version to 4.4-rc1

This commit is contained in:
Sara 2025-02-23 14:38:14 +01:00
parent ee00efde1f
commit 21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions

View file

@ -4,7 +4,32 @@
UDP packet peer.
</brief_description>
<description>
UDP packet peer. Can be used to send raw UDP packets as well as [Variant]s.
UDP packet peer. Can be used to send and receive raw UDP packets as well as [Variant]s.
[b]Example:[/b] Send a packet:
[codeblock]
var peer = PacketPeerUDP.new()
# Optionally, you can select the local port used to send the packet.
peer.bind(4444)
peer.set_dest_address("1.1.1.1", 4433)
peer.put_packet("hello".to_utf8_buffer())
[/codeblock]
[b]Example:[/b] Listen for packets:
[codeblock]
var peer
func _ready():
peer = PacketPeerUDP.new()
peer.bind(4433)
func _process(_delta):
if peer.get_available_packet_count() &gt; 0:
var array_bytes = peer.get_packet()
var packet_string = array_bytes.get_string_from_ascii()
print("Received message: ", packet_string)
[/codeblock]
[b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.
</description>
<tutorials>