public void SendFrame(ArraySegment <byte> data, byte evNumber, byte voiceId, int channelId, LocalVoice localVoice) { object[] content = new object[] { voiceId, evNumber, data }; var sendOpt = new SendOptions() { Reliability = localVoice.Reliable, Channel = (byte)channelId, Encrypt = localVoice.Encrypt }; var opt = new LoadBalancing.RaiseEventOptions(); if (localVoice.DebugEchoMode) { opt.Receivers = LoadBalancing.ReceiverGroup.All; } opt.InterestGroup = localVoice.Group; lock (sendLock) { this.OpRaiseEvent((byte)VoiceEventCode.GetCode(channelId), content, opt, sendOpt); } this.LoadBalancingPeer.SendOutgoingCommands(); }
public void SendVoiceRemove(LocalVoice voice, int channelId, int targetPlayerId) { object content = voiceClient.buildVoiceRemoveMessage(voice); var sendOpt = new SendOptions() { Reliability = true, Channel = (byte)channelId }; var opt = new LoadBalancing.RaiseEventOptions(); if (targetPlayerId != 0) { opt.TargetActors = new int[] { targetPlayerId }; } lock (sendLock) { if (voice.DebugEchoMode) { opt.Receivers = ReceiverGroup.All; } this.OpRaiseEvent(VoiceEventCode.GetCode(channelId), content, opt, sendOpt); } }