So I have created a Standalone ENet server in C++, which seems to be working okay, but I am having issues sending data to it from Godot. When I run my client, it seems to be able to connect to the server without issue, but fails to send any data.
I've checked with Wireshark and there is no packets containing my test data.
My server code is just priting info about any ENet event.
My Client Code:
var network : NetworkedMultiplayerENet
network = NetworkedMultiplayerENet.new()
print("Create client: " + str(network.create_client(SERVER_HOST, SERVER_PORT)))
print("Send Packet: " + str(network.put_packet("TEST".to_ascii())))
print("Multiplayer Packet:" + str(get_tree().multiplayer.network_peer.put_packet("TEST2".to_ascii())))
My client output:
Create client: 0
Send Packet: 3
Starting game server...
Started server console...
A new client connected from ______.
Things I've tried:
gettree().multiplayer.networkpeer = network
after creating the network, and it didn't seem to have an effect.
print("Send Packet: " + str(network.putpacket("TEST".toascii())))
print("Multiplayer Packet:" + str(gettree().multiplayer.networkpeer.putpacket("TEST2".toascii())))
on button press instead which changed output to
Send Packet: 0
Multiplayer Packet: 0
But I did not see any data in Wireshark