Exemple #1
0
        internal void RemoveMember(VoiceClient voiceClient)
        {
            lock (this._members)
            {
                RadioChannelMember member = this._members.FirstOrDefault(m => m.VoiceClient == voiceClient);

                if (member != null)
                {
                    if (member.IsSending)
                    {
                        if (member.VoiceClient.RadioSpeaker)
                        {
                            foreach (VoiceClient client in VoiceManager.VoiceClients)
                            {
                                client.Player.Emit(Event.SaltyChat_IsSendingRelayed, voiceClient.Player.Id, false, true, false, "{}");
                            }
                        }
                        else
                        {
                            foreach (RadioChannelMember channelMember in this._members)
                            {
                                channelMember.VoiceClient.Player.Emit(Event.SaltyChat_IsSending, voiceClient.Player.Id, false);
                            }
                        }
                    }

                    this._members.Remove(member);
                    voiceClient.Player.Emit(Event.SaltyChat_SetRadioChannel, "");

                    foreach (RadioChannelMember channelMember in this._members.Where(m => m.IsSending))
                    {
                        voiceClient.Player.Emit(Event.SaltyChat_IsSending, channelMember.VoiceClient.Player.Id, false);
                    }
                }
            }
        }
Exemple #2
0
        internal bool TryGetMember(VoiceClient voiceClient, out RadioChannelMember radioChannelMember)
        {
            radioChannelMember = this.Members.FirstOrDefault(m => m.VoiceClient == voiceClient);

            return(radioChannelMember != null);
        }