diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-04-21 04:57:53 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-05-16 10:32:51 +0200 |
commit | 3e64a42b1492e38bf033041c0eb1212542728cbd (patch) | |
tree | d187f873ecfdace0d127c6bc340ed295edcaa2f1 /src/init.cpp | |
parent | f2cf2e5340c1aa20516aea4863b8f7a46f317bb6 (diff) | |
download | fork-godot-webrtc-native-3e64a42b1492e38bf033041c0eb1212542728cbd.tar.gz fork-godot-webrtc-native-3e64a42b1492e38bf033041c0eb1212542728cbd.tar.bz2 fork-godot-webrtc-native-3e64a42b1492e38bf033041c0eb1212542728cbd.zip |
Update to new DataChannel API.
New WebRTCLibDataChannel class act as PacketPeer.
Old WebRTCPeer (now WebRTCPeerConnection) now allows you to set
configuration (STUN/TURN) and creating multiple data channels.
Fixed many bugs and implemented most of the missing API.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/init.cpp b/src/init.cpp index 9b02bd9..75a89e9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1,5 +1,6 @@ -#include "WebRTCLibPeer.hpp" -#include "net/WebRTCPeerNative.hpp" +#include "WebRTCLibDataChannel.hpp" +#include "WebRTCLibPeerConnection.hpp" +#include "net/WebRTCPeerConnectionNative.hpp" #include <gdnative_api_struct.gen.h> /* Godot export stuff */ @@ -16,7 +17,7 @@ extern "C" void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options *o) { break; if (net_api->next->version.major == 3 && net_api->next->version.minor == 2) { - WebRTCPeerNative::_net_api = (const godot_gdnative_ext_net_3_2_api_struct *)net_api->next; + WebRTCPeerConnectionNative::_net_api = (const godot_gdnative_ext_net_3_2_api_struct *)net_api->next; } } @@ -30,5 +31,6 @@ extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_opt extern "C" void GDN_EXPORT godot_nativescript_init(void *handle) { godot::Godot::nativescript_init(handle); - godot::register_class<godot_webrtc::WebRTCLibPeer>(); + godot::register_class<godot_webrtc::WebRTCLibPeerConnection>(); + godot::register_class<godot_webrtc::WebRTCLibDataChannel>(); } |