Server "NetworkedMultiplayerNet" Not Listening Properly

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By PerduGames
:warning: Old Version Published before Godot 3 was released.

Still trying with the class “NetworkedMultiplayerENet”. I’m not getting the packages on the server. My server will not be using godot, I just want to test on a server in godot, and also because I will need to know how to listen for when the client listens for server messages.

When I send it to my external server, the message is coming like this " ���who am I?" instead of “who am I?”, so I wanted to test on a godot server to better understand what’s going on. But I am not even able to receive the packages, by the way never enter this block “if host.get_available_packet_count () > 0:”, although if I send a small message like this " " I get the error on the server:

ERROR: _network_process_packet: Condition 'p_packet_len <5' is true.
At: scene / main / scene_tree.cpp: 1906.

The server code:

extends Node

var host = NetworkedMultiplayerENet.new()
const SERVER_IP = "127.0.0.1"
const SERVER_PORT = 1507

func _ready():
     get_tree().connect("network_peer_connected", self, "_player_connected")
     host.create_server(SERVER_PORT, 4)
     get_tree().set_network_peer(host)

func _process(delta):
     if host.get_available_packet_count() > 0:
          var array_bytes = host.get_packet()
          printt("msg: " + array_bytes.get_string_from_utf8())

func _player_connected(id):
     printt("_player_connected" + str(id))

Note: I get printt from the connected client console, as well as from the connected server client. So I believe the two are connected.

I realized that the error is probably coming from here https://github.com/godotengine/godot/blob/master/modules/enet/networked_multiplayer_enet.cpp#L275 and if that is it, the package has the size smaller than 12bytes, then something is happening while submitting that it would not be sending right here https://github.com/godotengine/godot/blob/master/modules/enet/networked_multiplayer_enet.cpp#L438. but I would not know why it is coming to the outer server, even though it is arriving like this " ���who am I?" . I have no idea.

PerduGames | 2017-11-22 21:59