13 lines
288 B
GDScript3
Raw Normal View History

2024-01-20 21:18:58 +00:00
extends PacketHandler
func _ready():
%Server.set_handler(Packet.PING, self)
func handle_packet(data: PackedByteArray, peer: PacketPeer):
var buffer := StreamPeerBuffer.new()
buffer.put_8(Packet.PING)
if data.size() > 0:
buffer.put_8(data[0])
2024-01-23 23:09:50 +00:00
peer.put_packet(buffer.data_array)