Godot 3:
I'm trying to use this method here: https://github.com/godotengine/godot/blob/master/modules/enet/networked_multiplayer_enet.cpp#L403
but I get error expected 1 arguments.
What is happening is that you are probably calling the "PacketPeer" class method instead of the "put_packet()" virtual method of the "NetworkedMultiplayerENet" class.
I realize that the method is not being called here:
https://github.com/godotengine/godot/blob/master/modules/enet/networked_multiplayer_enet.cpp#L654
I do not know if he should or should not, because if he should, I do not understand why he is not then.
Steps to reproduce:
Create a project with the script below on a node and run:
extends Node
const SERVER_IP = "127.0.0.1"
const SERVER_PORT = 1510
var socketUDP = NetworkedMultiplayerENet.new()
function _ready():
start_client()
send_bytes()
function start_client():
socketUDP.create_client(SERVER_IP, SERVER_PORT)
get_tree().set_network_peer(socketUDP)
socketUDP.set_transfer_mode(socketUDP.TRANSFER_MODE_RELIABLE)
function send_bytes():
var stg = "hello"
var pac = stg.to_utf8()
socketUDP.put_packet(pac, pac.size())