예제 #1
0
 public void UpdateTeamspeak()
 {
     using (var threadSafeList = new AltVPlayerList())
     {
         threadSafeList.AllPlayers.ForEach(p => { try { UpdateTeamspeakForUser(p, threadSafeList.AllPlayers); } catch (Exception ex) { OnVoiceLogging(LogLevel.Error, ex.ToString()); } });
     }
 }
예제 #2
0
 private void _voiceServer_VoiceClientOutdated(string clientGUID, Version hisVersion, Version ourVersion)
 {
     using (var threadSafeList = new AltVPlayerList())
     {
         var p = threadSafeList.AllPlayers.FirstOrDefault(c => c.HardwareIdHash.ToString() == clientGUID);
         if (p != null)
         {
             p.Kick("Please update your TS3 PureVoice Plugin.");
         }
     }
 }
예제 #3
0
 private void _voiceServer_VoiceClientMicrophoneStatusChanged(long connectionId, bool isMuted)
 {
     using (var threadSafeList = new AltVPlayerList())
     {
         var p = GetPlayerByConnectionId(threadSafeList.AllPlayers, connectionId);
         if (p != null)
         {
             OnVoiceLogging?.Invoke(LogLevel.Debug, $"{p.Name} Mic muted {isMuted}");
             Alt.Emit("PUREVOICE_CLIENT_MICROPHONESTATUS", p, isMuted);
         }
     }
 }
예제 #4
0
 private void _voiceServer_VoiceClientConnected(string clientGUID, string teamspeakID, ushort teamspeakClientID, long connectionID, string clientName, bool micMuted, bool speakersMuted)
 {
     using (var threadSafeList = new AltVPlayerList())
     {
         var p = threadSafeList.AllPlayers.FirstOrDefault(c => c.HardwareIdHash.ToString() == clientGUID);
         if (p != null)
         {
             OnVoiceLogging?.Invoke(LogLevel.Debug, String.Format("VoiceConnect {0} {1} {2} {3}", p.Name, teamspeakID, teamspeakClientID, connectionID));
             _voiceServer.ConfigureClient(connectionID, p.Name, false);
             p.SetData("VOICE_ID", connectionID);
             p.SetData("VOICE_TS_ID", teamspeakClientID);
             p.SetData("VOICE_TEAMSPEAK_IDENT", teamspeakID);
             Alt.Emit("PUREVOICE_CLIENT_CONNECTED", p, micMuted, speakersMuted);
         }
     }
 }
예제 #5
0
 private void _voiceServer_VoiceClientDisconnected(long connectionId)
 {
     using (var threadSafeList = new AltVPlayerList())
     {
         var p = GetPlayerByConnectionId(threadSafeList.AllPlayers, connectionId);
         if (p != null)
         {
             p.DeleteData("VOICE_ID");
             p.DeleteData("VOICE_TS_ID");
             p.DeleteData("VOICE_TEAMSPEAK_IDENT");
             if (VoiceForceVoice)
             {
                 p.SetData("VOICE_TIMEOUT", DateTime.Now.AddMinutes(1));
             }
             Alt.Emit("PUREVOICE_CLIENT_DISCONNECTED", p);
         }
     }
 }
예제 #6
0
 // LipSync
 private void _voiceServer_VoiceClientTalking(long connectionId, bool isTalking)
 {
     using (var threadSafeList = new AltVPlayerList())
     {
         var p = GetPlayerByConnectionId(threadSafeList.AllPlayers, connectionId);
         if (p != null)
         {
             var pPos = p.Position;
             var pls  = threadSafeList.AllPlayers.Where(c => c.Position.Distance(pPos) < 20).ToList();
             if (isTalking)
             {
                 pls.ForEach(pt => pt.Emit("LIPSYNC", p, "mp_facial", "mic_chatter", true));
             }
             else
             {
                 pls.ForEach(pt => pt.Emit("LIPSYNC", p, "facials@gen_male@variations@normal", "mood_normal_1", true));
             }
         }
     }
 }