godotengine / webrtc-native

The official GDNative WebRTC implementation for non-html exports.
MIT License
207 stars 30 forks source link

0.3 Plugin error: 'WebRTCDataChannel' is not a valid type in Win 10 Godot Engine v3.1.1.stable #5

Closed tomoprime closed 4 years ago

tomoprime commented 4 years ago

After importing plugin zip into an empty project folder WebRTCNativeDemo I get error:

Godot Engine v3.1.1.stable.official (c) 2007-2019 Juan Linietsky, Ariel Manzur & Godot Contributors. res://scripts/SimplePeer.gd:42 - Parse Error: Identifier 'WebRTCDataChannel' is not a valid type (not a script or class), or could not be found on base 'self'. modules/gdscript/gdscript.cpp:580 - Method/Function Failed, returning: ERR_PARSE_ERROR Switch Scene Tab

Am I missing something? Sorry I'm new to using Godot 3.1.1 let alone to using GDNative. Will I even need the WebRTC plugin if switching to Godot 3.2 Alpha 2 then?

tomoprime commented 4 years ago

Update: running the above project in Godot 3.2 Alpha 2 has no issues as expected.

Faless commented 4 years ago

Webrtc is simply not supported in 3.1 . It's a new feature in 3.2.

On Fri, Oct 18, 2019, 01:42 Tom notifications@github.com wrote:

Update: running the above project in Godot 3.2 Alpha 2 has no issues as expected.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/webrtc-native/issues/5?email_source=notifications&email_token=AAM4C3RDN7AHSAA6B2IC3C3QPD2ABA5CNFSM4JCAG6Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBR4XAI#issuecomment-543411073, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM4C3VOYM46JZYVASNSB7TQPD2ABANCNFSM4JCAG6QQ .

tomoprime commented 4 years ago

it is strange. I started up a nodejs instance on a mac. https://github.com/godotengine/godot-demo-projects/tree/master/networking/webrtc_signaling/server_node

Then on Windows I connected to it with Godot 3.2 for the webrtc_signaling demo using the address of the mac. Without adding this GDNative plugin to the webrtc_signaling demo project folder.

But after adding this plug as required. The webrtc_signaling demo cannot make a connection to the Mac that is running the nodejs server code.

ERROR: _get_socket_error: Socket error: 10022 At: drivers/unix/net_socket_posix.cpp:198 ERROR: connect_to_host: Connection to remote host failed! At: drivers/unix/net_socket_posix.cpp:425 Signaling server disconnected: 1000 - Unknown Disconnected: 1000: Unknown

Update: However if I go into Project Settings -> GDNative, and disable both webrtc.tres and webrtc_debug.tres I am then able to connect to the remote nodejs server.

Signaling server connected with ID: 1 Joined lobby HceN79Uj26F820i3

Faless commented 4 years ago

That error does not seem related to this plugin. It happens during the connection to the signaling server (websocket) and the error (10022) is usually a windows or network problem. Double check your connection to the Mac, the IP/port, try disabling firewall, antivirus, etc.

On Fri, Oct 18, 2019, 03:33 Tom notifications@github.com wrote:

it is strange. I started up a nodejs instance on a mac.

https://github.com/godotengine/godot-demo-projects/tree/master/networking/webrtc_signaling/server_node

Then on Windows I connected to it with Godot 3.2 for the webrtc_signaling demo using the address of the mac. But I was only able to see each peer listed separately. Without the adding this GDNative plugin to the webrtc_signaling demo project folder.

After adding this plug as required. The webrtc_signaling demo cannot make a connection to the Mac that is running the nodejs server code.

ERROR: _get_socket_error: Socket error: 10022 At: drivers/unix/net_socket_posix.cpp:198 ERROR: connect_to_host: Connection to remote host failed! At: drivers/unix/net_socket_posix.cpp:425 Signaling server disconnected: 1000 - Unknown Disconnected: 1000: Unknown

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/godotengine/webrtc-native/issues/5?email_source=notifications&email_token=AAM4C3TSCD22LTODWZGBMA3QPEG6TA5CNFSM4JCAG6Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBSEFNA#issuecomment-543441588, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM4C3VMURLKZLQ2PTGXAY3QPEG6TANCNFSM4JCAG6QQ .

tomoprime commented 4 years ago

All I know is that the remote WebRTC signaling demo works once I disable the plugin. It even worked before installing plugin. No changes were made to my network. I can replicate it on demand by toggling on/off webrtc.tres inside of a Project Settings->GDNative.

Faless commented 4 years ago

I see... you are using 3.2 alpha 2 right? I'll make a build for that alpha specifically and post the link to test potentially binary compatibility issues. Still, there should be no issue, so it's really weird. You are using the latest release of the plugin right? 0.3

On Fri, Oct 18, 2019, 22:16 Tom notifications@github.com wrote:

All I know is that the remote WebRTC signaling demo works once I disable the plugin. It even worked before installing plugin. No changes were made to my network. I can replicate it on demand by toggling on/off webrtc.tres inside of a Project Settings->GDNative.

On Oct 18, 2019, at 5:18 AM, Fabio Alessandrelli notifications@github.com wrote:

That error does not seem related to this plugin. It happens during the connection to the signaling server (websocket) and the error (10022) is usually a windows or network problem. Double check your connection to the Mac, the IP/port, try disabling firewall, antivirus, etc.

On Fri, Oct 18, 2019, 03:33 Tom notifications@github.com wrote:

it is strange. I started up a nodejs instance on a mac.

https://github.com/godotengine/godot-demo-projects/tree/master/networking/webrtc_signaling/server_node

Then on Windows I connected to it with Godot 3.2 for the webrtc_signaling demo using the address of the mac. But I was only able to see each peer listed separately. Without the adding this GDNative plugin to the webrtc_signaling demo project folder.

After adding this plug as required. The webrtc_signaling demo cannot make a connection to the Mac that is running the nodejs server code.

ERROR: _get_socket_error: Socket error: 10022 At: drivers/unix/net_socket_posix.cpp:198 ERROR: connect_to_host: Connection to remote host failed! At: drivers/unix/net_socket_posix.cpp:425 Signaling server disconnected: 1000 - Unknown Disconnected: 1000: Unknown

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/godotengine/webrtc-native/issues/5?email_source=notifications&email_token=AAM4C3TSCD22LTODWZGBMA3QPEG6TA5CNFSM4JCAG6Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBSEFNA#issuecomment-543441588 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAM4C3VMURLKZLQ2PTGXAY3QPEG6TANCNFSM4JCAG6QQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/godotengine/webrtc-native/issues/5?email_source=notifications&email_token=AAM4C3W26S3WIE3YX35TYF3QPIKQ7A5CNFSM4JCAG6Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBVZO2Q#issuecomment-543922026, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM4C3WZ77BC6CUUZSTOYYTQPIKQ7ANCNFSM4JCAG6QQ .

tomoprime commented 4 years ago

Yes to both using latest binaries for Windows 10. I did not compile from source.

I played the demo in Godot in Windows 10 after running a: npm install node server.js

On another machine (macOS)

Signaling Demo: https://github.com/godotengine/godot-demo-projects/tree/master/networking/webrtc_signaling

tomoprime commented 4 years ago

Sorry just wanted to note I had used the 64bit build of Windows with the 0.3 Plugin release. https://downloads.tuxfamily.org/godotengine/3.2/alpha2/Godot_v3.2-alpha2_win64.exe.zip

tomoprime commented 4 years ago

Sorry if this appears as a duplicate msg as my last post was lost somehow. Just wanted to point out I had used the Win64 binary of Godot 3.2 Alpha 2 with the prebuilt v0.3 WebRTC plugin.

tomoprime commented 4 years ago

Note I had only tested Signaling in that example. I just checked out your bomber-rtc demo to gain some more clarity on what works...

When I: Enable the webrtc-native plugin:

Disable the webrtc-native plugin:

dryw commented 4 years ago

I can confirm the above behaviour both in 3.2 Alpha 1 and Alpha 2. bomber-rtc works as expected in linux but on windows I get the following errors when using a remote signalling server:

webrtc-native plugin disabled:

webrtc-native plugin enabled:

Changing the port to a lower value, such as 567 eliminates the socket error but then produces: thirdparty\mbedtls\library\ssl_tls.c:4064: unknown record type thirdparty\mbedtls\library\ssl_tls.c:4344: ssl_get_next_record() returned -29184 (-0x7200) thirdparty\mbedtls\library\ssl_cli.c:1506: mbedtls_ssl_read_record() returned -29184 (-0x7200) ERROR: StreamPeerMbedTLS::_do_handshake: TLS handshake error: -29184 At: modules\mbedtls\stream_peer_mbedtls.cpp:91 mbedtls error: returned -0x7200

This seems to be the case for both 32/64 bit windows.

If I connect to a local signalling server, everything appears to work.

Will look into rebuilding the plugin against the latest headers. Let me know if there's any specific debugging information that would be helpful!

tomoprime commented 4 years ago

@dryw Thank you for testing my Windows case as well. It's good to know Linux is ok. I was trying to build the plugin for MacOS but the native code reference for the webrtc_ios target was pushing over 10GB to download on my machine and I ran out of disk space. They say you need under 6GB but my sync grew much larger.

Btw I tested a different port when trying the bomber example on Heroku which might work on linux, e.g.: ws://bomber-rtc.herokuapp.com

Heroku sets it's own ports so you must update line 6 in server.js to load by ENV: const PORT = process.env.PORT || 9080;

Note: @Faless it may be ideal to create an external bomber-rtc app on free Heroku to test remote Signaling code changes for godot. The URL given above isn't set up as I reserved a different name to test so not to take over ownership.

Faless commented 4 years ago

Discussion moved to a separate issue (#6). Clsoing.