godotengine / webrtc-native

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

Can't establish a communication in NakamaWebRTC project #114

Closed mason-stafford closed 1 year ago

mason-stafford commented 1 year ago

Godot version

4.1, 4.1.1

Plugin version

webrtc-native v1.0.1, NakamaAPI v3.3.1

System information

Widows 10

Issue description

Hi to all, Tried to make https://gitlab.com/snopek-games/godot-nakama-webrtc David Snopek's Nakama WebRTC project on Godot4, But Unfortunately Peers won't connect not even on local LAN, and getting this error: OnlineMatch.gd:586 @ _webrtc_connect_peer(): Condition "network_mode == MODE_NONE" is true. Returning: ERR_UNCONFIGURED. Asked @dsnopek himself for help and also decided to share it here too. After many hours of debugging found an only one condition which establishes connection: 1.run two instances of project we're gonna call them 1 and 2 2.create a match in 1 and try to join with 2 which 1 and 2 won't get connected. 3.don't quit the instances and press the X button on 1 which will force both instances to get back to "MatchScreen". 4.this time without quitting, create a match with 2 and try to join with 1 which in result both instances will get connected.

Steps to reproduce

1.Download the project from GitLab from given link in the description. 2.Replace the webrtc-native module proper version. 3.run your nakama server (has to be 3.15 version or lower ones, unless with latest version (3.16) project will crash). 4.start at least two instances and try to create a match with one and join with other one. it will stuck an connecting.

Minimal reproduction project

https://drive.google.com/file/d/1L9sv9q5HEmAzrHRvdrKb4yXow1W0THSw/view?usp=sharing

dsnopek commented 1 year ago

FYI, this was a bug in my addon - should be fixed in this commit:

https://gitlab.com/snopek-games/godot-nakama-webrtc/-/commit/90d2bd9c4e16331ca4aadd650652d84d45b0f6a6