public void LeavePhoneCall(VoiceClient voiceClient, string identifier) { PhoneCall phoneCall = this.GetPhoneCall(identifier, false); if (phoneCall != null) { this.LeavePhoneCall(voiceClient, phoneCall); } }
public void LeavePhoneCall(VoiceClient voiceClient, PhoneCall phoneCall) { phoneCall.RemoveMember(voiceClient); if (phoneCall.Members.Length == 0) { lock (this._phoneCalls) { this._phoneCalls.Remove(phoneCall); } } }
private void AddPlayersToCall(string identifier, List <dynamic> players) { PhoneCall phoneCall = this.GetPhoneCall(identifier, true); foreach (int playerHandle in players) { VoiceClient voiceClient = this.VoiceClients.FirstOrDefault(c => c.Player.GetServerId() == playerHandle); if (voiceClient == null) { continue; } this.JoinPhoneCall(voiceClient, phoneCall); } }
public PhoneCall GetPhoneCall(string identifier, bool create) { PhoneCall phoneCall; lock (this._phoneCalls) { phoneCall = this.PhoneCalls.FirstOrDefault(r => r.Identifier == identifier); if (phoneCall == null && create) { phoneCall = new PhoneCall(identifier); this._phoneCalls.Add(phoneCall); } } return(phoneCall); }
private void RemovePlayersFromCall(string identifier, List <dynamic> players) { PhoneCall phoneCall = this.GetPhoneCall(identifier, false); if (phoneCall == null) { return; } foreach (int playerHandle in players) { VoiceClient voiceClient = this.VoiceClients.FirstOrDefault(c => c.Player.GetServerId() == playerHandle); if (voiceClient == null) { continue; } this.LeavePhoneCall(voiceClient, phoneCall); } }
public void JoinPhoneCall(VoiceClient voiceClient, PhoneCall phoneCall) { phoneCall.AddMember(voiceClient); }
public void JoinPhoneCall(VoiceClient voiceClient, string identifier) { PhoneCall phoneCall = this.GetPhoneCall(identifier, true); this.JoinPhoneCall(voiceClient, phoneCall); }
internal PhoneCallMember(PhoneCall phoneCall, VoiceClient voiceClient) { this.PhoneCall = phoneCall; this.VoiceClient = voiceClient; this.IsSpeakerEnabled = false; }