Ejemplo n.º 1
0
    public void JoinLobbyChannel(string channelName)
    {
        Debug.Log("Attempting to join: " + channelName);
        if (_currentChannel != null)
        {
            return;
        }

        _currentChannel = channelName;
        var lobbychannel = _vivoxVoiceManager.ActiveChannels.FirstOrDefault(ac => ac.Channel.Name == _vivoxNetworkManager.LobbyChannelName);

        if ((_vivoxVoiceManager && _vivoxVoiceManager.ActiveChannels.Count == 0) ||
            lobbychannel == null)
        {
            Debug.Log("I'm in");
            _vivoxVoiceManager.OnParticipantAddedEvent += VivoxVoiceManager_OnParticipantAddedEvent;
            _vivoxVoiceManager.JoinChannel(channelName, ChannelType.NonPositional, VivoxVoiceManager.ChatCapability.TextAndAudio);
        }
        else
        {
            Debug.Log("Elsed");
            if (lobbychannel.AudioState == ConnectionState.Disconnected)
            {
                Debug.Log("Elsed2");
                // Ask for hosts since we're already in the channel and part added won't be triggered.
                _vivoxNetworkManager.SendLobbyUpdate(VivoxNetworkManager.MatchStatus.Seeking);

                lobbychannel.BeginSetAudioConnected(true, true, ar =>
                {
                    Debug.Log("Now transmitting into lobby channel");
                });
            }
        }
        // Do nothing, participant added will take care of this
    }
Ejemplo n.º 2
0
 private void JoinChannel(string channelName)
 {
     if (currentChannelSession != null)
     {
         StartCoroutine(this.DisconnectChannel(this.currentChannelSession));
     }
     currentChannelSession = vivoxVoiceManager.JoinChannel(channelName, ChannelType.NonPositional, VivoxVoiceManager.ChatCapability.TextAndAudio);
 }
 public void JoinChannel()
 {
     if (!string.IsNullOrEmpty(channelName))
     {
         print($"Joining channel: {channelName}");
         _vivox.JoinChannel(channelName, ChannelType.NonPositional, VivoxVoiceManager.ChatCapability.AudioOnly);
         //assign channelName.text = inputChannelName.text;
     }
 }
    private IEnumerator AwaitLobbyRejoin()
    {
        IChannelSession lobbyChannel = m_vivoxVoiceManager.ActiveChannels.FirstOrDefault(ac => ac.Channel.Name == LobbyChannelName);

        // Lets wait until we have left the lobby channel before tyring to join it.
        yield return(new WaitUntil(() => lobbyChannel == null ||
                                   (lobbyChannel.AudioState != ConnectionState.Connected && lobbyChannel.TextState != ConnectionState.Connected)));

        // Always send if hosting, since we could have missed a request.
        m_vivoxVoiceManager.JoinChannel(LobbyChannelName, ChannelType.NonPositional, VivoxVoiceManager.ChatCapability.TextOnly, false);
    }
Ejemplo n.º 5
0
 public void JoinChannel()
 {
     if (string.IsNullOrEmpty(channelInputField.text))
     {
         return;
     }
     lobbyChannelName = channelInputField.text;
     vivox.JoinChannel(lobbyChannelName, ChannelType.NonPositional, VivoxVoiceManager.ChatCapability.TextOnly);
     channelId = vivox.ActiveChannels.FirstOrDefault(ac => ac.Channel.Name == lobbyChannelName).Key;
     Debug.Log(string.Format($"<color=red>{channelId}</color>"));
     joinChannelPanel.SetActive(false);
     vivox.OnTextMessageLogReceivedEvent += onTextMessageLogRecivedEvent;
 }
Ejemplo n.º 6
0
    public override void OnStartLocalPlayer()
    {
        base.OnStartLocalPlayer();
        CmdSetPlayerName(VivoxVoiceManager.Instance.LoginSession.Key.Name, VivoxVoiceManager.Instance.LoginSession.Key.DisplayName);

        // Local player will join the positional channel
        if (isLocalPlayer)
        {
            m_gameManager.localTank = gameObject;
            ConversationalDistance  = 2;
            AudibleDistance         = 38;
            var ChannelProperties = new Channel3DProperties(AudibleDistance, ConversationalDistance, AudioFadeIntensityByDistance, AudioFadeModel);
            // We want to know when we have been added to the channel
            m_vivoxVoiceManager.OnParticipantAddedEvent += VivoxVoiceManager_OnParticipantAddedEvent;

            m_vivoxVoiceManager.JoinChannel(m_vivoxNetworkManager.PositionalChannelName, ChannelType.Positional,
                                            VivoxVoiceManager.ChatCapability.TextAndAudio, true, ChannelProperties);
        }
    }
Ejemplo n.º 7
0
 private void JoinLobbyChannel()
 {
     // Do nothing, participant added will take care of this
     _vivoxVoiceManager.OnParticipantAddedEvent += VivoxVoiceManager_OnParticipantAddedEvent;
     _vivoxVoiceManager.JoinChannel(LobbyChannelName, ChannelType.NonPositional, VivoxVoiceManager.ChatCapability.TextAndAudio);
 }
Ejemplo n.º 8
0
 private void JoinLobbyChannel()
 {
     vivoxVoiceManager.OnParticipantAddedEvent += OnParticipantAdded;
     vivoxVoiceManager.JoinChannel(vivoxNetworkManager.LobbyChannelName, ChannelType.NonPositional, VivoxVoiceManager.ChatCapability.TextAndAudio);
 }