adrenak / univoice

Voice chat/VoIP solution for unity.
http://www.vatsalambastha.com/univoice
MIT License
363 stars 36 forks source link

Is it for players who are only under one network? #33

Open miladxandi opened 7 months ago

miladxandi commented 7 months ago

Hello, For me when I run a build on the same networks it`s okay but outside of a network for example using WiFi for one device and cellular for another one, the sample app is not working! why?

miladxandi commented 7 months ago
miladxandi commented 7 months ago

We need to host a call on the server but you wrote on Reddit: There is no server, the server just establishes a direct connection between the peers and then gets out of the way.

Does that mean we cannot let users connect from everywhere? Does that mean for any call it should be one traffic host? how can we resolve it? we want the server handles the traffic

adrenak commented 7 months ago

Hey @miladxandi the reddit post is pretty old and from UniVoice v1. It used airpeer, a webrtc library where I was hosting the signalling server

Now univoice is network agnostic, whereas the airpeer based webrtc network implementation is no longer recommended due to the following reasons:

Unity has its com.unity.webrtc package that might be a better fit for peer to peer.

Univoice works with any underlying network as long as you make a IChatroomNetwork implementation of it. Currently the ones that work best are mirror and telepathy based ones that you can look into. Note that this would require you to host your own server that can create chatrooms.

Next gen of univoice (v4) is on the way with several improvements, which you can wait for. Otherwise DM be on Discord adrenak#1934 where I can help you out more.

miladxandi commented 7 months ago

I mean I couldn`t connect two devices from different networks! what is the reason for it? your sample project is based on Telepathy only? Are that sample project and its signaling server supported by an open network connection? even outside of the local network?

adrenak commented 7 months ago

I'm not renting a server for the sample app. In that, one user creates a server locally on the wifi and the other joins it. Since the server user is on WLAN, the client user also must be on WLAN. There's no signalling server in Telepathy. It just has a client-server with IP address "localhost"

If you host a Telepathy app on a server and get users to connect to it via its IP address, they would connect regardless of their them being on wifi or cellular and should be able to connect from anywhere globally. But that's Telepathy specific stuff, univoice doesn't have anything to do with it, it just needs an IP address to connect to. The telepathy docs have some tutorials you can refer to. You'd have to make a server build (windows or linux depending on your servers OS) that the clients can connect to.