public virtual void SendFrame(ArraySegment <byte> data, FrameFlags flags, byte evNumber, byte voiceId, int channelId, int targetPlayerId, bool reliable, LocalVoice localVoice)
        {
            object[] content = protocol.buildFrameMessage(voiceId, evNumber, data, flags);

            var sendOpt = new SendOptions()
            {
                Reliability = reliable,
                Channel     = photonChannelForCodec(localVoice.Info.Codec),
                Encrypt     = localVoice.Encrypt
            };

            var opt = new RaiseEventOptions();

            if (targetPlayerId == -1)
            {
                opt.TargetActors = new int[] { this.LocalPlayer.ActorNumber };
            }
            else if (targetPlayerId != 0)
            {
                opt.TargetActors = new int[] { targetPlayerId };
            }
            if (localVoice.DebugEchoMode)
            {
                opt.Receivers = ReceiverGroup.All;
            }
            opt.InterestGroup = localVoice.InterestGroup;
            lock (sendLock)
            {
                this.OpRaiseEvent(VoiceEvent.Code, content, opt, sendOpt);
            }
            this.LoadBalancingPeer.SendOutgoingCommands();
        }
Exemple #2
0
        public void SendFrame(ArraySegment <byte> data, byte evNumber, byte voiceId, int channelId, LocalVoice localVoice)
        {
            object[] content = protocol.buildFrameMessage(voiceId, evNumber, data);

            var sendOpt = new SendOptions()
            {
                Reliability = localVoice.Reliable,
                Channel     = photonChannelForCodec(localVoice.info.Codec),
                Encrypt     = localVoice.Encrypt
            };

            var opt = new RaiseEventOptions();

            if (localVoice.DebugEchoMode)
            {
                opt.Receivers = ReceiverGroup.All;
            }
            opt.InterestGroup = localVoice.InterestGroup;
            lock (sendLock)
            {
                this.OpRaiseEvent(VoiceEvent.Code, content, opt, sendOpt);
            }
            this.LoadBalancingPeer.SendOutgoingCommands();
        }