// Token: 0x0600C6AA RID: 50858 RVA: 0x0037041C File Offset: 0x0036E61C private void AddDataToOutputBuffer(PlayerVoiceHandleThread.VoicePacket packet) { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_AddDataToOutputBufferVoicePacket_hotfix != null) { this.m_AddDataToOutputBufferVoicePacket_hotfix.call(new object[] { this, packet }); return; } BJLuaObjHelper.IsSkipLuaHotfix = false; Monitor.Enter(this.m_seclock); if (this.m_outputQueue != null) { this.m_outputQueue.Enqueue(packet); } Monitor.Exit(this.m_seclock); }
// Token: 0x0600C6A9 RID: 50857 RVA: 0x00370370 File Offset: 0x0036E570 private PlayerVoiceHandleThread.VoicePacket GetInputBufferData() { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetInputBufferData_hotfix != null) { return((PlayerVoiceHandleThread.VoicePacket) this.m_GetInputBufferData_hotfix.call(new object[] { this })); } BJLuaObjHelper.IsSkipLuaHotfix = false; PlayerVoiceHandleThread.VoicePacket result = null; Monitor.Enter(this.m_lock); if (this.m_inputQueue != null && this.m_inputQueue.Count != 0) { result = this.m_inputQueue.Dequeue(); } Monitor.Exit(this.m_lock); return(result); }
// Token: 0x0600C6A5 RID: 50853 RVA: 0x003700C0 File Offset: 0x0036E2C0 private void AddDataToInputBuffer(PlayerVoiceHandleThread.VoicePacket packet) { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_AddDataToInputBufferVoicePacket_hotfix != null) { this.m_AddDataToInputBufferVoicePacket_hotfix.call(new object[] { this, packet }); return; } BJLuaObjHelper.IsSkipLuaHotfix = false; Monitor.Enter(this.m_lock); if (this.m_inputQueue != null) { if (packet != null) { if (packet.m_srcData != null) { Debug.Log(string.Concat(new object[] { "PlayerVoiceHandleThread.AddDataToInputBuffer ", packet.m_srcData.Length, " ", packet.m_type })); } else { Debug.Log("PlayerVoiceHandleThread.AddDataToInputBuffer srcData = null type=" + packet.m_type); } } this.m_inputQueue.Enqueue(packet); } Monitor.Exit(this.m_lock); }
// Token: 0x0600C6C3 RID: 50883 RVA: 0x00370C44 File Offset: 0x0036EE44 public void AddDataToOutputBuffer(PlayerVoiceHandleThread.VoicePacket packet) { this.m_owner.AddDataToOutputBuffer(packet); }
// Token: 0x0600C6AD RID: 50861 RVA: 0x003705F8 File Offset: 0x0036E7F8 private void VoiceThreadProc() { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_VoiceThreadProc_hotfix != null) { this.m_VoiceThreadProc_hotfix.call(new object[] { this }); return; } BJLuaObjHelper.IsSkipLuaHotfix = false; List <byte[]> list = new List <byte[]>(); while (this.m_startHandle) { DateTime now = DateTime.Now; int tickTime = this.GetTickTime(); PlayerVoiceHandleThread.VoicePacket inputBufferData = this.GetInputBufferData(); if (inputBufferData != null) { if (inputBufferData.m_type == DataType.Head) { list.Clear(); } if (inputBufferData.m_srcData != null) { byte[] array = VoiceChatCompression.Instance.Compress(inputBufferData.m_srcData, VoiceChatCompressionType.Speex); if (array != null) { list.Add(array); } } if (inputBufferData.m_type == DataType.End) { if (inputBufferData.m_srcData != null) { Debug.Log(string.Concat(new object[] { "PlayerVoiceHandleThread.VoiceThreadProc srcData.Len=", inputBufferData.m_srcData.Length, " data.count=", list.Count, " isValid=", inputBufferData.m_isValid })); } else { Debug.LogError("PlayerVoiceHandleThread.VoiceThreadProc srcData is null"); } if (inputBufferData.m_isValid) { if (list.Count != 0) { inputBufferData.m_isCompressed = true; inputBufferData.m_chatInfo.m_voiceBytes = this.ByteArrayListToByteArray(list); list.Clear(); this.AddDataToOutputBuffer(inputBufferData); } else { inputBufferData.m_chatInfo = null; this.AddDataToOutputBuffer(inputBufferData); } } else { list.Clear(); } } } int num = (int)(now.AddMilliseconds((double)tickTime) - DateTime.Now).TotalMilliseconds; if (num > 0) { Thread.Sleep(num); } } }