+1 vote

So I have a server and client project and they can connect successfully, and in the client code it matches up two clients to each other, but I need to tell the clients that they are matched up from the server, however, it needs to go back to only the two specific clients that are matched up. Does anyone know how to send info from the server to a specific client, probably based on that clients id? Thanks

Godot version 3.2.1
in Engine by (538 points)

1 Answer

0 votes
Best answer

If you are not already storing all connected peers on the server you can use get_network_connected_peers() to get the IDs and use

rpc_id(<peer_id>,"function_name", <optional_args>)

Or

rpc_unreliable_id(<peer_id>, "function_name", <optional_args>)

It is all very well documented here

by (4,308 points)
selected by

You can even use rset and rconfig to change variables of specific peers

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.