0 votes
network.create_server(port, max_players)
set_custom_multiplayer(gateway_api)
custom_multiplayer.set_root_node(self)
custom_multiplayer.set_network_peer(network)
print("Gateway server started")

network.connect("peer_connected", self, "on_peer_connect")
network.connect("peer_disconnected", self, "on_peer_disconnect")

Above is the code on the server,

network = NetworkedMultiplayerENet.new()
gateway_api = MultiplayerAPI.new()

username = _username
password = _password

network.create_client(ip, port)
set_custom_multiplayer(gateway_api)
custom_multiplayer.set_root_node(self)
custom_multiplayer.set_network_peer(network)

network.connect("connection_succeeded", self, "on_connection_success")
network.connect("connection_failed", self, "on_connection_fail")

And this is the code on the client.

When I run the code on the client I get no errors, but I never receive the connection failed or connection succeeded signals. I also have the server run custom_multiplayer.poll() in _process().

Does anyone know the reason for this?

Godot version 3.3.3
in Engine by (12 points)

Yes it is different because that guide doesn't use custom_multiplayer, which I require.

I figured out what was wrong though. I forgot to tell the client to run custom_multiplayer.poll() every frame.

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.