Operating system or device - Godot version:
Windows 10, Godot 2.2 alpha compiled with VS2015
Issue description:
rpc_id( 1, "receive_input", event)
should call receive_input(event) on server but event change from source to destination.
example:
original InputEvent sent:
Device 0 ID 279 Event: Key Unicode: Scan: 16777231 Echo: True PressedTrue
InputEvent received:
Device 0 ID 0 Event: Key Unicode: Scan: 16777231 Echo: False PressedFalse
Steps to reproduce:
-Open the project in two instances
-Click on server in one instance
-Click on client in the other.
-Perform inputs on client window
-Look console outputs
Link to minimal example project:
input_event_issue.zip
This is and is not a bug.
It is a bug because the binary serializer (unlike the text one) can't handle objects. this needs to be added.
At the same time, sending serialized objects via network (In 3.0, InputEvent is an object) is super dangerous, as they can contain scripts. This will probably disabled by default.
I suggest these are converted to dictionaries before sending.
@reduz Maybe we should disallow sending and receiving of objects containing scripts, and issue a warning when attempting to send such?
Aside from prevent to send objects due to security issues, it's not so uncommon sending input from clients to server. I think that having to write a wrapper every time you need to send what is an object (not a script) it's a futile effort. If it's possible to block scripts (or nodes in general) from being sent over network it'll be better. (IMHO of course)
Maybe blocking scripts would be possible.. I am not sure..
On Jul 1, 2017 12:14 PM, "Lorenzo Beccaro" notifications@github.com wrote:
Aside from prevent to send objects due to security issues, it's not so
uncommon sending input from clients to server. I think that having to write
a wrapper every time you need to send what is an object (not a script) it's
a futile effort. If it's possible to block scripts (or nodes in general)
from being sent over network it'll be better. (IMHO of course)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/9456#issuecomment-312437560,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z25Whavp4828N3bj3vLG8hOeE_ZJeks5sJmJmgaJpZM4OK3oV
.
First of all thank you for your report and sorry for the delay.
We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.
We still have hundreds of issues whose relevance/reproducibility needs to be checked against the 3.0.2 (https://godotengine.org/download), and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about its current status here?
For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.
Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.
Thanks in advance.
Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.
Just checked. Now InputEvent is received properly. Can't say when this was fixed though.
InputEvent objects get sent as EncodedObjectAsID in Godot 3.1. I'm not sure when this change happened, but that the new behaviour. Just in case someone gets to this page looking for the same thing.
Perhaps EncodedObjectAsID is the default for all objects sent over RPC but it doesn't make sense for an InputEvent, because that object would only exist on the machine that received it.