Search Unity

Unet Voice Chat With Lobby Support Implement

Discussion in 'UNet' started by Eiseno, Jan 6, 2017.

  1. Eiseno

    Eiseno

    Joined:
    Nov 1, 2015
    Posts:
    86
    Hi,
    I tested this lib. with unet and its working.Now i am trying to implement it to my game.When the game start i try to active voice chat with this code but it doesnt work.Anyone have suggessions how can i solve this ?
    The issue is OnProxyRequested is not called on client.
    Code (CSharp):
    1.  public override void OnClientSceneChanged(NetworkConnection conn)
    2.     {
    3.  
    4.  
    5.         if (SceneManager.GetActiveScene().name != "Main_VR")
    6.         {
    7.          
    8.             VoiceChatNetworkProxy.OnManagerStartClient(client);
    9.  
    10.             VoiceChatNetworkProxy.OnManagerClientConnect(conn);
    11.  
    12.         }
    13.         base.OnClientSceneChanged(conn);
    14.     }
    15.     public override void OnServerSceneChanged(string sceneName)
    16.     {
    17.  
    18.  
    19.         if (sceneName != "Main_VR")
    20.         {
    21.               VoiceChatNetworkProxy.OnManagerStartServer();
    22.         }
    23.         else
    24.         {
    25.               VoiceChatNetworkProxy.OnManagerStopServer();
    26.         }
    27.         base.OnServerSceneChanged(sceneName);
    28.     }
    Github: https://github.com/alkamegames/unit...Scripts/Demo/HLAPI/VoiceChatNetworkManager.cs

    OnProxyRequested

    https://github.com/alkamegames/unit...t/Scripts/Networking/VoiceChatNetworkProxy.cs
     
    Last edited: Jan 6, 2017
    TCROC likes this.
  2. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    230
    Hey @Eiseno. I would also like to implement voice chat into my game. I found this forum through the NAT Traversal forum. Am I correct to assume that you are also using NAT Traversal? If so, it will make working together to try to figure this out much easier.
     
    thegreatzebadiah likes this.
  3. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    230
    @Eiseno Also. Could upload your project with the voice chat working with UNET? It would solving this issue much easier as I would not have to go back and solve what you already have solved.
     
  4. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    230
    @Eiseno I just got done integrating voice chat with NAT Traversal! It is pretty late for me right now so I will put together a small example project and upload it to this forum for people to check out tomorrow. I will not include the NAT Traversal asset inside the project. The only things that will be included will be the scripts and the voice chat asset. You will have to import NAT Traversal separately.

    The asset by default comes working with UNET, but if you would like NAT Traversal so you can have direct connections, here is the link to the NAT Traversal forum.
    https://forum.unity3d.com/threads/r...ort-forwarding-punch-through-and-more.395835/

    Here's the link if anyone wants to check out where I got the voice chat asset. (Credit to @Eiseno for discovering the asset).
    https://github.com/alkamegames/unityassets
     
  5. Eiseno

    Eiseno

    Joined:
    Nov 1, 2015
    Posts:
    86
    Hi @TCROC
    Yes i am using Nat traversal but cant figure how to use.If you share sample project it will be really good.I spend 1 week and cant figure anything :)
     
  6. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    230
    @Eiseno Here is the example project of NAT Traversal compatibility with voice chat. This project does not contain the NAT Traversal asset. You will have to import it separately. It only contains scripts that work with NAT Traversal and the voice chat asset. I hope this comes of good use to people :)
    https://drive.google.com/file/d/0B6F8g8piEivTOVlQdlotclZIM00/view?usp=sharing

    The asset by default comes working with UNET, but if you would like NAT Traversal so you can have direct connections, here is the link to the NAT Traversal forum.
    https://forum.unity3d.com/threads/r...ort-forwarding-punch-through-and-more.395835/

    Here's the link if anyone wants to check out where I got the voice chat asset. (Credit to @Eiseno for discovering the asset).
    https://github.com/alkamegames/unityassets
     
    Eiseno likes this.