classref: Sync with current master branch (c64afeb)

This commit is contained in:
Godot Organization
2023-05-13 03:19:02 +00:00
parent 0757559a3a
commit 6febc8ee06
274 changed files with 16684 additions and 4675 deletions

View File

@@ -43,7 +43,7 @@ Below a small example of how it can be used:
func _process(delta):
server.poll() # Important!
if server.is_connection_available():
var peer : PacketPeerUDP = server.take_connection()
var peer: PacketPeerUDP = server.take_connection()
var packet = peer.get_packet()
print("Accepted peer: %s:%s" % [peer.get_packet_ip(), peer.get_packet_port()])
print("Received data: %s" % [packet.get_string_from_utf8()])
@@ -112,7 +112,7 @@ Below a small example of how it can be used:
func _process(delta):
if !connected:
# Try to contact server
udp.put_packet("The answer is... 42!".to_utf8())
udp.put_packet("The answer is... 42!".to_utf8_buffer())
if udp.get_available_packet_count() > 0:
print("Connected: %s" % udp.get_packet().get_string_from_utf8())
connected = true
@@ -137,7 +137,7 @@ Below a small example of how it can be used:
if (!_connected)
{
// Try to contact server
_udp.PutPacket("The Answer Is..42!".ToUtf8());
_udp.PutPacket("The Answer Is..42!".ToUtf8Buffer());
}
if (_udp.GetAvailablePacketCount() > 0)
{