Merge pull request #62651 from akien-mga/webrtc-register-peerconntectionjs

Register missing WebRTCDataChannelJS type
This commit is contained in:
Fabio Alessandrelli 2022-07-03 01:59:17 +02:00 committed by GitHub
commit e16242b73b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -57,7 +57,7 @@ void WebRTCPeerConnectionJS::_on_error(void *p_obj) {
void WebRTCPeerConnectionJS::_on_data_channel(void *p_obj, int p_id) { void WebRTCPeerConnectionJS::_on_data_channel(void *p_obj, int p_id) {
WebRTCPeerConnectionJS *peer = static_cast<WebRTCPeerConnectionJS *>(p_obj); WebRTCPeerConnectionJS *peer = static_cast<WebRTCPeerConnectionJS *>(p_obj);
peer->emit_signal(SNAME("data_channel_received"), Ref<WebRTCDataChannelJS>(new WebRTCDataChannelJS(p_id))); peer->emit_signal(SNAME("data_channel_received"), Ref<WebRTCDataChannel>(memnew(WebRTCDataChannelJS(p_id))));
} }
void WebRTCPeerConnectionJS::close() { void WebRTCPeerConnectionJS::close() {

View File

@ -52,6 +52,8 @@ extern int godot_js_rtc_pc_datachannel_create(int p_id, const char *p_label, con
} }
class WebRTCPeerConnectionJS : public WebRTCPeerConnection { class WebRTCPeerConnectionJS : public WebRTCPeerConnection {
GDCLASS(WebRTCPeerConnectionJS, WebRTCPeerConnection);
private: private:
int _js_id; int _js_id;
ConnectionState _conn_state; ConnectionState _conn_state;