private void OnVoicePacketReceived(VoicePacket obj)
        {
            var handler = VoicePacketReceived;

            if (handler != null)
            {
                handler(obj);
            }
        }
Example #2
0
        void IClient.OnVoicePacketReceived(VoicePacket obj)
        {
            // ReSharper disable once ConditionIsAlwaysTrueOrFalse (Justification: Sanity check against broken network integration implementations)
            if (obj.SenderPlayerId == null)
            {
                Log.Warn(Log.PossibleBugMessage("Attempted to enqueue a voice-packet-received event for a null player ID", "75885733-1D01-47A4-9A45-1D6A0F225131"));
                return;
            }

            lock (_queuedEvents)
                _queuedEvents.Add(new NetworkEvent {
                    Type = EventType.VoiceData, VoicePacket = obj
                });
        }