I've built a simple godot server running on MultiplayerENet using RPC for client-server communication. My client-and server are separate projects. I've exported my server to a Linux .pck file and I use the Linux server runtime from the Godot site to run the server but I get the following errors when connecting with my client:
ERROR: _process_get_node: Condition "!F" is true. Returned: __null
At: core/io/multiplayer_api.cpp:265.
ERROR: _process_packet: Condition "node == __null" is true.
At: core/io/multiplayer_api.cpp:204.
ERROR: _process_get_node: Condition "!F" is true. Returned: __null
At: core/io/multiplayer_api.cpp:265.
ERROR: _process_packet: Condition "node == __null" is true.
At: core/io/multiplayer_api.cpp:204.
ERROR: _process_get_node: Condition "!F" is true. Returned: __null
At: core/io/multiplayer_api.cpp:265.
ERROR: _process_packet: Condition "node == __null" is true.
At: core/io/multiplayer_api.cpp:204.
This does not happen when I run the client-and server in-editor. does anyone have any clue what could the be underlying issue here? I looked up the source code for line 265 which is:
ERR_FAIL_COND_V_MSG(!F, NULL, "Invalid packet received. Unabled to find requested cached node.");
And line 204:
ERR_FAIL_COND_MSG(node == NULL, "Invalid packet received. Requested node was not found.");
My networking code runs inside of a plugin that I built myself. This includes the RPC calls.
This problem only occurs when I use the Linux Server runtime downloaded from https://godotengine.org/download/server. it works fine if i use the normal runtime. However, I intend to containerize my server applications so I can't rely on the normal runtime. I need the server runtime that doesn't include all the graphics and audio.
I've built my application with Godot 3.2.
Update: Hereby I am including sample code to reproduce the problem:
Server:
extends Node
func _ready():
var peer = NetworkedMultiplayerENet.new()
peer.create_server(43594, 16)
get_tree().set_network_peer(peer)
remote func hello_world():
print("Hello World!")
rpc_id(get_tree().get_rpc_sender_id(), "reply")
Client:
extends Node
func _ready():
get_tree().connect("connected_to_server", self, "_connected_to_host_ok")
get_tree().connect("connection_failed", self, "_failed_to_connect_to_host")
var peer = NetworkedMultiplayerENet.new()
peer.create_client("localhost", 43594)
get_tree().set_network_peer(peer)
func _connected_to_host_ok():
print("Telling server to print Hello World!")
rpc_id(1, "hello_world")
remote func reply():
print("Received a reply from the server to also print Hello World!")
Export the server project to a .pck file, rename it to be the same as the Linux server runtime file and run it in CLI as for example: ./sample-server.64