internal RadioChannelMember(RadioChannel radioChannel, VoiceClient voiceClient, bool isPrimary) { this.RadioChannel = radioChannel; this.VoiceClient = voiceClient; this.IsPrimary = isPrimary; this.IsSpeakerEnabled = voiceClient.IsRadioSpeakerEnabled; }
public void LeaveRadioChannel(VoiceClient voiceClient, RadioChannel radioChannel) { radioChannel.RemoveMember(voiceClient); if (radioChannel.Members.Length == 0) { lock (this._radioChannels) { this._radioChannels.Remove(radioChannel); } } }
public void JoinRadioChannel(VoiceClient voiceClient, string radioChannelName, bool isPrimary) { foreach (RadioChannel channel in this.RadioChannels) { if (channel.Members.Any(v => v.VoiceClient == voiceClient && v.IsPrimary == isPrimary)) { return; } } RadioChannel radioChannel = this.GetRadioChannel(radioChannelName, true); radioChannel.AddMember(voiceClient, isPrimary); }
private void OnSendingOnRadio([FromSource] Player player, string radioChannelName, bool isSending) { if (!this._voiceClients.TryGetValue(player, out VoiceClient voiceClient)) { return; } RadioChannel radioChannel = this.GetRadioChannel(radioChannelName, false); if (radioChannel == null || !radioChannel.IsMember(voiceClient)) { return; } radioChannel.Send(voiceClient, isSending); }
public void SendingOnRadio(IPlayer player, string radioChannelName, bool isSending) { if (!this.TryGetVoiceClient(player, out VoiceClient voiceClient)) { return; } RadioChannel radioChannel = this.GetRadioChannel(radioChannelName, false); if (radioChannel == null || !radioChannel.IsMember(voiceClient)) { return; } radioChannel.Send(voiceClient, isSending); }
public static void SendingOnRadio(GTANetworkAPI.Client player, string radioChannelName, bool isSending) { if (!VoiceManager.TryGetVoiceClient(player, out VoiceClient voiceClient)) { return; } RadioChannel radioChannel = VoiceManager.GetRadioChannel(radioChannelName, false); if (radioChannel == null || !radioChannel.IsMember(voiceClient)) { return; } radioChannel.Send(voiceClient, isSending); }
public RadioChannel GetRadioChannel(string name, bool create) { RadioChannel radioChannel; lock (this._radioChannels) { radioChannel = this.RadioChannels.FirstOrDefault(r => r.Name == name); if (radioChannel == null && create) { radioChannel = new RadioChannel(name); this._radioChannels.Add(radioChannel); } } return(radioChannel); }
public static RadioChannel GetRadioChannel(string name, bool create) { RadioChannel radioChannel; lock (VoiceManager._radioChannels) { radioChannel = VoiceManager.RadioChannels.FirstOrDefault(r => r.Name == name); if (radioChannel == null && create) { radioChannel = new RadioChannel(name); VoiceManager._radioChannels.Add(radioChannel); } } return(radioChannel); }
public void LeaveRadioChannel(IPlayer player, string radioChannelName) { if (!this.TryGetVoiceClient(player, out VoiceClient voiceClient)) { return; } RadioChannel radioChannel = this.GetRadioChannel(radioChannelName, false); if (radioChannel != null) { radioChannel.RemoveMember(voiceClient); if (radioChannel.Members.Length == 0) { this._radioChannels.Remove(radioChannel); } } }
public void JoinRadioChannel(IPlayer player, string radioChannelName) { if (!this.TryGetVoiceClient(player, out VoiceClient voiceClient)) { return; } foreach (RadioChannel channel in this.RadioChannels) { if (channel.IsMember(voiceClient)) { return; } } RadioChannel radioChannel = this.GetRadioChannel(radioChannelName, true); radioChannel.AddMember(voiceClient); }
public static void LeaveRadioChannel(Player player, string radioChannelName) { if (!VoiceManager._voiceClients.TryGetValue(player, out VoiceClient voiceClient)) { return; } RadioChannel radioChannel = VoiceManager.GetRadioChannel(radioChannelName, false); if (radioChannel != null) { radioChannel.RemoveMember(voiceClient); if (radioChannel.Members.Length == 0) { VoiceManager._radioChannels.Remove(radioChannel); } } }
public static void JoinRadioChannel(Player player, string radioChannelName, bool isPrimary) { if (!VoiceManager._voiceClients.TryGetValue(player, out VoiceClient voiceClient)) { return; } foreach (RadioChannel channel in VoiceManager.RadioChannels) { if (channel.Members.Any(v => v.VoiceClient == voiceClient && v.IsPrimary == isPrimary)) { return; } } RadioChannel radioChannel = VoiceManager.GetRadioChannel(radioChannelName, true); radioChannel.AddMember(voiceClient, isPrimary); }
public static void JoinRadioChannel(GTANetworkAPI.Client player, string radioChannelName) { if (!VoiceManager.TryGetVoiceClient(player, out VoiceClient voiceClient)) { return; } foreach (RadioChannel channel in VoiceManager.RadioChannels) { if (channel.IsMember(voiceClient)) { return; } } RadioChannel radioChannel = VoiceManager.GetRadioChannel(radioChannelName, true); radioChannel.AddMember(voiceClient); }
internal RadioChannelMember(RadioChannel radioChannel, VoiceClient voiceClient, bool isPrimary) { this.RadioChannel = radioChannel; this.VoiceClient = voiceClient; this.IsPrimary = isPrimary; }
internal RadioChannelMember(RadioChannel radioChannel, VoiceClient voiceClient) { this.RadioChannel = radioChannel; this.VoiceClient = voiceClient; }