-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More safety checking in RPCs #16733
Comments
I should note that how it currently works is probably fine if you want to play with a group of friends that trust each other not to cheat. These are mainly issues where you might want to play with untrusted clients. |
Did you test it? Last time I checked with my "cheating demo" it was working fine. |
This is a good point, but something we can't really fix unless/until we introduce typing in GDScript. Documenting it will be nice though. |
@Faless I thought that the |
@raymoo you are right, I exchanged the two keywords, my bad. I updated my comment. |
@Faless I thought that the server routed As for EDIT: Oh, I guess that would mean the server still routes messages, but clients will only accept a |
That is correct, though the original sender is preserved, so the client which receives it knows that the caller is not the server itself but another peer (and which one).
I see your point here, but can't come up with a solution. |
@Faless Makes sense to me. |
This may soon be possible to handle on the networking side once we got type hints with @vnen's GDScript type improvements :) |
Nice, I would add that I just realized that the `sync` keyword do not
perform the checks on who's the network master, but I think it should. I'll
make a PR for that, so we can discuss it in further details.
…On Sun, May 13, 2018, 02:05 Max Hilbrunner ***@***.***> wrote:
Peers could send RPCs with arguments of the wrong type
This may soon be possible to handle on the networking side once we got
type hints with @vnen <https://github.com/vnen>'s GDScript type
improvements :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16733 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABnBbgM1W_Yl8dLXsLxa78de6E3obqFoks5tx3jmgaJpZM4SHyNJ>
.
|
Adding reference to #19264 |
Type checking is now enforced if you use typed GDScript: E.g.: In the multiplayer bomber # gamestate.gd
func _connected_ok():
# [...]
# Sending a number instead of the player name
rpc("register_player", get_tree().get_network_unique_id(), 42)
# [...]
remote func register_player(id, new_player_name : String): # Setting string type
if get_tree().is_network_server():
# [...] Will result in the server not calling the function and displaying the following error instead.
|
Is it possible to detect programatically when such an error happens? (For example so a client program can display a message to the user and quit when it receives bad data from a server) |
No 😢 . We plan to add support to programmatically handle MultiplayerAPI's errors after |
Godot version:
3.0
Issue description:
RPCs have some issues right now that make them annoying to secure:
slave
RPC, even if they aren't the server. This means every RPC that is meant to come from the server needs to include a check at the beginning to ensure it actually is the server. I suggest that in addition to theremote
,sync
,master
, andslave
keywords that specify the recipients of an RPC call, there should also be a keyword to specify that a message is meant to only be sent by the server.EDIT: Any peer can send a
master
RPC as well, which is a problem for similar reasons toslave
RPCs.The text was updated successfully, but these errors were encountered: