예제 #1
0
 void onVoiceSetup(VoicePaketSetup args, NetPeer peer)
 {
     try
     {
         VoicePlugin.Log("VoiceSetup {0}", args);
         _connectionInfo = args;
         var con = VoicePlugin.GetConnection(args.ServerGUID);
         if ((con != null) && con.IsInitialized && con.IsConnected)
         {
             if (!VoicePlugin_ConnectionEstablished(con))
             {
                 VoicePlugin.Log("Disconnecting Peer (TS Server not ready)");
                 Disconnect();
             }
         }
         else
         {
             VoicePlugin.Log("Disconnecting Peer (TS Server not connected)");
             Disconnect();
         }
     }
     catch (Exception ex)
     {
         VoicePlugin.Log(ex.ToString());
     }
 }
예제 #2
0
        public void OnPeerConnected(NetPeer peer)
        {
            Logger.Debug("Client connected: {0}", peer.EndPoint);
            _connectedPeers[peer.ConnectId] = peer;

            var setupPaket = new VoicePaketSetup()
            {
                DefaultChannel         = _defaultChannel,
                IngameChannel          = _ingameChannel,
                IngameChannelPassword  = _ingameChannelPassword,
                ServerGUID             = _serverGUID,
                EnableLipSync          = _enableLipSync,
                AllowedOutGameChannels = _AllowedOutGameChannels.ToArray()
            };

            _netPacketProcessor.Send(peer, setupPaket, DeliveryMethod.ReliableOrdered);
        }