+1 vote

I'm using a custom multiplayer in multiple projects, here's how i've done it:

var network = NetworkedMultiplayerENet.new()
var multiplayer_api = MultiplayerAPI.new()

func _ready():
  if network.get_connection_status() != network.CONNECTION_DISCONNECTED:
    network.close_connection()

  network.create_server(6060, 15)
  set_custom_multiplayer(multiplayer_api)
  custom_multiplayer.set_root_node(self)
  custom_multiplayer.set_network_peer(network)


func _process():
  if get_custom_multiplayer() == null:
    return
  if not custom_multiplayer.has_network_peer():
    return
  custom_multiplayer.poll()

Everything works, expect sometimes it doesn't. I get these two errors regularly (I always get 2 errors at a time):
_process_get_node: Invalid packet received. Unabled to find requested cached node.
_process_packet: Invalid packet received. Requested node was not found.

They're caused by the custom_multiplayer.poll() function and i have no idea why this happens.

Godot version 3.3
in Engine by (272 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.