コード例 #1
0
 private Packet inSound(Packet p, IPEndPoint sim)
 {
     if (form.checkBox1.Checked)
     {
         SoundTriggerPacket s = (SoundTriggerPacket)p;
         if (s.SoundData.OwnerID == frame.AgentID && s.SoundData.SoundID == new UUID("76c78607-93f9-f55a-5238-e19b1a181389"))
         {
             sendUpdate();
         }
     }
     return(p);
 }
コード例 #2
0
        /// <summary>
        /// Plays a sound
        /// </summary>
        /// <param name="soundID">UUID of the sound to be played.</param>
        /// <param name="handle">handle id for the sim to be played in.</param>
        /// <param name="position">position for the sound to be played at. Normally the avatar.</param>
        /// <param name="gain">volume of the sound, from 0.0 to 1.0</param>
        public void SoundTrigger(LLUUID soundID, ulong handle, LLVector3 position, float gain)
        {
            SoundTriggerPacket soundtrigger = new SoundTriggerPacket();

            soundtrigger.SoundData          = new SoundTriggerPacket.SoundDataBlock();
            soundtrigger.SoundData.SoundID  = soundID;
            soundtrigger.SoundData.ObjectID = LLUUID.Zero;
            soundtrigger.SoundData.OwnerID  = LLUUID.Zero;
            soundtrigger.SoundData.ParentID = LLUUID.Zero;
            soundtrigger.SoundData.Handle   = handle;
            soundtrigger.SoundData.Position = position;
            soundtrigger.SoundData.Gain     = gain;
            Client.Network.SendPacket(soundtrigger);
        }
コード例 #3
0
        public void TriggerSound(Agent agent, UUID soundID, float gain)
        {
            SoundTriggerPacket sound = new SoundTriggerPacket();

            sound.SoundData.Handle   = server.RegionHandle;
            sound.SoundData.ObjectID = agent.AgentID;
            sound.SoundData.ParentID = agent.AgentID;
            sound.SoundData.OwnerID  = agent.AgentID;
            sound.SoundData.Position = agent.Avatar.Position;
            sound.SoundData.SoundID  = soundID;
            sound.SoundData.Gain     = gain;

            server.UDP.BroadcastPacket(sound, PacketCategory.State);
        }
コード例 #4
0
ファイル: SoundManager.cs プロジェクト: scatterp/plexview
 /// <summary>Process an incoming packet and raise the appropriate events</summary>
 /// <param name="sender">The sender</param>
 /// <param name="e">The EventArgs object containing the packet data</param>
 protected void SoundTriggerHandler(object sender, PacketReceivedEventArgs e)
 {
     if (m_SoundTrigger != null)
     {
         SoundTriggerPacket trigger = (SoundTriggerPacket)e.Packet;
         OnSoundTrigger(new SoundTriggerEventArgs(e.Simulator,
                                                  trigger.SoundData.SoundID,
                                                  trigger.SoundData.OwnerID,
                                                  trigger.SoundData.ObjectID,
                                                  trigger.SoundData.ParentID,
                                                  trigger.SoundData.Gain,
                                                  trigger.SoundData.Handle,
                                                  trigger.SoundData.Position));
     }
 }
コード例 #5
0
        /// <summary>
        /// Play a sound asset
        /// </summary>
        /// <param name="soundID">UUID of the sound to be played.</param>
        /// <param name="handle">handle id for the sim to be played in.</param>
        /// <param name="position">position for the sound to be played at. Normally the avatar.</param>
        /// <param name="gain">volume of the sound, from 0.0 to 1.0</param>
        public void SendSoundTrigger(UUID soundID, ulong handle, Vector3 position, float gain)
        {
            SoundTriggerPacket soundtrigger = new SoundTriggerPacket
            {
                SoundData = new SoundTriggerPacket.SoundDataBlock
                {
                    SoundID  = soundID,
                    ObjectID = UUID.Zero,
                    OwnerID  = UUID.Zero,
                    ParentID = UUID.Zero,
                    Handle   = handle,
                    Position = position,
                    Gain     = gain
                }
            };

            _client.Network.SendPacket(soundtrigger);
        }
コード例 #6
0
        protected void SoundTriggerHandler(object sender, PacketReceivedEventArgs e)
        {
            var simulator = e.Simulator;
            var packet = e.Packet;

            if (!MaintainSounds) return;
            if (!IsMaster(simulator)) return;

            SoundTriggerPacket trigger = (SoundTriggerPacket)packet;

            Sound_OnSoundTrigger(this, new SoundTriggerEventArgs(simulator,
                                           trigger.SoundData.SoundID,
                                           trigger.SoundData.OwnerID,
                                           trigger.SoundData.ObjectID,
                                           trigger.SoundData.ParentID,
                                           trigger.SoundData.Gain,
                                           trigger.SoundData.Handle,
                                           trigger.SoundData.Position));

        }
コード例 #7
0
        protected void SoundTriggerHandler(Packet packet, Simulator simulator)
        {
            SoundTriggerPacket trigger = (SoundTriggerPacket)packet;

            if (OnSoundTrigger != null)
            {
                try
                {
                    OnSoundTrigger(
                        trigger.SoundData.SoundID,
                        trigger.SoundData.OwnerID,
                        trigger.SoundData.ObjectID,
                        trigger.SoundData.ParentID,
                        trigger.SoundData.Gain,
                        trigger.SoundData.Handle,
                        trigger.SoundData.Position
                        );
                }
                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
            }
        }
コード例 #8
0
ファイル: SoundManager.cs プロジェクト: RavenB/gridsearch
 /// <summary>
 /// Plays a sound
 /// </summary>
 /// <param name="soundID">UUID of the sound to be played.</param>
 /// <param name="handle">handle id for the sim to be played in.</param>
 /// <param name="position">position for the sound to be played at. Normally the avatar.</param>
 /// <param name="gain">volume of the sound, from 0.0 to 1.0</param>
 public void SoundTrigger(LLUUID soundID, ulong handle , LLVector3 position, float gain)
 {
     SoundTriggerPacket soundtrigger = new SoundTriggerPacket();
     soundtrigger.SoundData = new SoundTriggerPacket.SoundDataBlock();
     soundtrigger.SoundData.SoundID = soundID;
     soundtrigger.SoundData.ObjectID = LLUUID.Zero;
     soundtrigger.SoundData.OwnerID = LLUUID.Zero;
     soundtrigger.SoundData.ParentID = LLUUID.Zero;
     soundtrigger.SoundData.Handle = handle;
     soundtrigger.SoundData.Position = position;
     soundtrigger.SoundData.Gain = gain;
     Client.Network.SendPacket(soundtrigger);
 }
コード例 #9
0
ファイル: usefull.cs プロジェクト: zadark/par
        private Packet InImprovedInstantMessageHandler(Packet packet, IPEndPoint sim)
        {
            if (RegionHandle != 0)
            {
                SoundTriggerPacket sound = new SoundTriggerPacket();
                sound.SoundData.SoundID = new UUID(form.textBox1sounduuid.Text);
                sound.SoundData.OwnerID = frame.AgentID;
                sound.SoundData.ObjectID = frame.AgentID;
                sound.SoundData.ParentID = UUID.Zero;
                sound.SoundData.Handle = RegionHandle;
                sound.SoundData.Position = CameraCenter;
                sound.SoundData.Gain = ((float)form.trackBar1volume.Value)/100.0f;
                sound.Header.Reliable = false;
                if (form.checkBox1imsound.Checked)
                    proxy.InjectPacket(sound, Direction.Incoming);
            }

            ImprovedInstantMessagePacket im = (ImprovedInstantMessagePacket)packet;
            //block repeated crap

            if (im.MessageBlock.Dialog == (byte)InstantMessageDialog.StartTyping)
            {
                if (PeopleWhoIMedMe.Contains(im.AgentData.AgentID) == false)
                {
                    PeopleWhoIMedMe.Add(im.AgentData.AgentID);
                    ImprovedInstantMessagePacket im2 = new ImprovedInstantMessagePacket();
                    im2.AgentData = new ImprovedInstantMessagePacket.AgentDataBlock();
                    im2.AgentData.AgentID = im.AgentData.AgentID;
                    im2.AgentData.SessionID = im.AgentData.SessionID;
                    im2.MessageBlock = new ImprovedInstantMessagePacket.MessageBlockBlock();
                    im2.MessageBlock.FromGroup = im.MessageBlock.FromGroup;
                    im2.MessageBlock.ToAgentID = im.MessageBlock.ToAgentID;
                    im2.MessageBlock.ParentEstateID = im.MessageBlock.ParentEstateID;
                    im2.MessageBlock.RegionID = im.MessageBlock.RegionID;
                    im2.MessageBlock.Position = im.MessageBlock.Position;
                    im2.MessageBlock.Offline = im.MessageBlock.Offline;
                    im2.MessageBlock.Dialog = 0;
                    im2.MessageBlock.ID = im.MessageBlock.ID;
                    im2.MessageBlock.Timestamp = im.MessageBlock.Timestamp;
                    im2.MessageBlock.FromAgentName = im.MessageBlock.FromAgentName;
                    im2.MessageBlock.Message = Utils.StringToBytes("/me is typing a message...");
                    im2.MessageBlock.BinaryBucket = im.MessageBlock.BinaryBucket;
                    proxy.InjectPacket(im2, Direction.Incoming);
                }
            }
            else if (im.MessageBlock.Dialog == 22) // teleport lure
            {
                string[] bbfields = Utils.BytesToString(im.MessageBlock.BinaryBucket).Split('|');
                if (bbfields.Length < 5)
                    return packet;
                ushort MapX;
                ushort MapY;
                double RegionX;
                double RegionY;
                double RegionZ;
                try
                {
                    MapX = (ushort)(uint.Parse(bbfields[0]) / 256);
                    MapY = (ushort)(uint.Parse(bbfields[1]) / 256);
                    RegionX = double.Parse(bbfields[2]);
                    RegionY = double.Parse(bbfields[3]);
                    RegionZ = double.Parse(bbfields[4]);
                }
                catch
                {
                    frame.SayToUser("WARNING! " + Utils.BytesToString(im.MessageBlock.FromAgentName) + "'s teleport lure IM seems to have unusual data in its BinaryBucket!");
                    return packet;
                }

                // request region name

                System.Timers.Timer myTimer = new System.Timers.Timer(10000);

                string RegionName = null;
                PacketDelegate replyCallback = delegate(Packet p, IPEndPoint s)
                {
                    MapBlockReplyPacket reply = (MapBlockReplyPacket)p;
                    foreach (MapBlockReplyPacket.DataBlock block in reply.Data)
                    {
                        if ((block.X == MapX) && (block.Y == MapY))
                        {
                            RegionName = Utils.BytesToString(block.Name);
                            StringBuilder sb = new StringBuilder();
                            sb.Append(Utils.BytesToString(im.MessageBlock.FromAgentName) + "'s teleport lure is to ");
                            sb.Append(RegionName + " " + RegionX.ToString() + ", " + RegionY.ToString() + ", " + RegionZ.ToString() + " ");
                            sb.Append("secondlife://" + RegionName.Replace(" ", "%20") + "/" + RegionX.ToString() + "/" + RegionY.ToString() + "/" + RegionZ.ToString());
                            frame.SayToUser(sb.ToString());
                        }
                    }
                    return null;
                };

                System.Timers.ElapsedEventHandler timerCallback = delegate(object sender, System.Timers.ElapsedEventArgs e)
                {
                    if (RegionName == null)
                    {
                        frame.SayToUser("Couldn't resolve the destination of " + Utils.BytesToString(im.MessageBlock.FromAgentName) + "'s teleport lure: " + Utils.BytesToString(im.MessageBlock.BinaryBucket));
                    }
                    proxy.RemoveDelegate(PacketType.MapBlockReply, Direction.Incoming, replyCallback);
                    myTimer.Stop();
                };

                proxy.AddDelegate(PacketType.MapBlockReply, Direction.Incoming, replyCallback);
                myTimer.Elapsed += timerCallback;
                myTimer.Start();

                MapBlockRequestPacket MapBlockRequest = new MapBlockRequestPacket();
                MapBlockRequest.Type = PacketType.MapBlockRequest;
                MapBlockRequest.AgentData = new MapBlockRequestPacket.AgentDataBlock();
                MapBlockRequest.AgentData.AgentID = frame.AgentID;
                MapBlockRequest.AgentData.SessionID = frame.SessionID;
                MapBlockRequest.AgentData.Flags = 0;
                MapBlockRequest.AgentData.Godlike = false;
                MapBlockRequest.PositionData = new MapBlockRequestPacket.PositionDataBlock();
                MapBlockRequest.PositionData.MinX = MapX;
                MapBlockRequest.PositionData.MaxX = MapX;
                MapBlockRequest.PositionData.MinY = MapY;
                MapBlockRequest.PositionData.MaxY = MapY;
                proxy.InjectPacket(MapBlockRequest, Direction.Outgoing);
            }
            else if (im.MessageBlock.Dialog == (byte)InstantMessageDialog.InventoryOffered)
            {
                if (im.MessageBlock.BinaryBucket[0] == (byte)AssetType.Simstate)
                {
                    frame.SayToUser(Utils.BytesToString(im.MessageBlock.FromAgentName) + " offered you a SimState :O");
                    return null;
                }
            }
            else if (im.MessageBlock.Dialog == 9)
            {
                if (im.MessageBlock.BinaryBucket[0] == (byte)AssetType.Simstate)
                {
                    frame.SayToUser(im.AgentData.AgentID.ToString() + " offered you a SimState from an object at " + im.MessageBlock.Position.ToString() + " :O Message = " + Utils.BytesToString(im.MessageBlock.Message));
                    return null;
                }
            }
            // Don't get spammed bro
            if (im.MessageBlock.Dialog == 0)
            {
                im.MessageBlock.ID = frame.AgentID.Equals(im.AgentData.AgentID) ? frame.AgentID : im.AgentData.AgentID ^ frame.AgentID;
                packet = (Packet)im;
            }
            return packet;
        }
コード例 #10
0
ファイル: useful.cs プロジェクト: zadark/par
    private Packet InImprovedInstantMessageHandler(Packet packet, IPEndPoint sim)
    {
        if (RegionHandle != 0)
        {
            SoundTriggerPacket sound = new SoundTriggerPacket();
            sound.SoundData.SoundID  = new UUID("4c366008-65da-2e84-9b74-f58a392b94c6");
            sound.SoundData.OwnerID  = frame.AgentID;
            sound.SoundData.ObjectID = frame.AgentID;
            sound.SoundData.ParentID = UUID.Zero;
            sound.SoundData.Handle   = RegionHandle;
            sound.SoundData.Position = CameraCenter;
            sound.SoundData.Gain     = 0.5f;
            sound.Header.Reliable    = false;
            if (!File.Exists("mutesound.on"))
            {
                proxy.InjectPacket(sound, Direction.Incoming);
            }
        }

        ImprovedInstantMessagePacket im = (ImprovedInstantMessagePacket)packet;

        //block repeated crap



        if (im.MessageBlock.Dialog == (byte)InstantMessageDialog.StartTyping)
        {
            if (PeopleWhoIMedMe.Contains(im.AgentData.AgentID) == false)
            {
                PeopleWhoIMedMe.Add(im.AgentData.AgentID);
                ImprovedInstantMessagePacket im2 = new ImprovedInstantMessagePacket();
                im2.AgentData                   = new ImprovedInstantMessagePacket.AgentDataBlock();
                im2.AgentData.AgentID           = im.AgentData.AgentID;
                im2.AgentData.SessionID         = im.AgentData.SessionID;
                im2.MessageBlock                = new ImprovedInstantMessagePacket.MessageBlockBlock();
                im2.MessageBlock.FromGroup      = im.MessageBlock.FromGroup;
                im2.MessageBlock.ToAgentID      = im.MessageBlock.ToAgentID;
                im2.MessageBlock.ParentEstateID = im.MessageBlock.ParentEstateID;
                im2.MessageBlock.RegionID       = im.MessageBlock.RegionID;
                im2.MessageBlock.Position       = im.MessageBlock.Position;
                im2.MessageBlock.Offline        = im.MessageBlock.Offline;
                im2.MessageBlock.Dialog         = 0;
                im2.MessageBlock.ID             = im.MessageBlock.ID;
                im2.MessageBlock.Timestamp      = im.MessageBlock.Timestamp;
                im2.MessageBlock.FromAgentName  = im.MessageBlock.FromAgentName;
                im2.MessageBlock.Message        = Utils.StringToBytes("/me is typing a message...");
                im2.MessageBlock.BinaryBucket   = im.MessageBlock.BinaryBucket;
                proxy.InjectPacket(im2, Direction.Incoming);
            }
        }
        else if (im.MessageBlock.Dialog == 22) // teleport lure
        {
            string[] bbfields = Utils.BytesToString(im.MessageBlock.BinaryBucket).Split('|');
            if (bbfields.Length < 5)
            {
                return(packet);
            }
            ushort MapX;
            ushort MapY;
            double RegionX;
            double RegionY;
            double RegionZ;
            try
            {
                MapX    = (ushort)(uint.Parse(bbfields[0]) / 256);
                MapY    = (ushort)(uint.Parse(bbfields[1]) / 256);
                RegionX = double.Parse(bbfields[2]);
                RegionY = double.Parse(bbfields[3]);
                RegionZ = double.Parse(bbfields[4]);
            }
            catch
            {
                frame.SayToUser("WARNING! " + Utils.BytesToString(im.MessageBlock.FromAgentName) + "'s teleport lure IM seems to have unusual data in its BinaryBucket!");
                return(packet);
            }

            // request region name

            System.Timers.Timer myTimer = new System.Timers.Timer(10000);

            string         RegionName    = null;
            PacketDelegate replyCallback = delegate(Packet p, IPEndPoint s)
            {
                MapBlockReplyPacket reply = (MapBlockReplyPacket)p;
                foreach (MapBlockReplyPacket.DataBlock block in reply.Data)
                {
                    if ((block.X == MapX) && (block.Y == MapY))
                    {
                        RegionName = Utils.BytesToString(block.Name);
                        StringBuilder sb = new StringBuilder();
                        sb.Append(Utils.BytesToString(im.MessageBlock.FromAgentName) + "'s teleport lure is to ");
                        sb.Append(RegionName + " " + RegionX.ToString() + ", " + RegionY.ToString() + ", " + RegionZ.ToString() + " ");
                        sb.Append("secondlife://" + RegionName.Replace(" ", "%20") + "/" + RegionX.ToString() + "/" + RegionY.ToString() + "/" + RegionZ.ToString());
                        frame.SayToUser(sb.ToString());
                    }
                }
                return(null);
            };

            System.Timers.ElapsedEventHandler timerCallback = delegate(object sender, System.Timers.ElapsedEventArgs e)
            {
                if (RegionName == null)
                {
                    frame.SayToUser("Couldn't resolve the destination of " + Utils.BytesToString(im.MessageBlock.FromAgentName) + "'s teleport lure: " + Utils.BytesToString(im.MessageBlock.BinaryBucket));
                }
                proxy.RemoveDelegate(PacketType.MapBlockReply, Direction.Incoming, replyCallback);
                myTimer.Stop();
            };

            proxy.AddDelegate(PacketType.MapBlockReply, Direction.Incoming, replyCallback);
            myTimer.Elapsed += timerCallback;
            myTimer.Start();

            MapBlockRequestPacket MapBlockRequest = new MapBlockRequestPacket();
            MapBlockRequest.AgentData           = new MapBlockRequestPacket.AgentDataBlock();
            MapBlockRequest.AgentData.AgentID   = frame.AgentID;
            MapBlockRequest.AgentData.SessionID = frame.SessionID;
            MapBlockRequest.AgentData.Flags     = 0;
            MapBlockRequest.AgentData.Godlike   = false;
            MapBlockRequest.PositionData        = new MapBlockRequestPacket.PositionDataBlock();
            MapBlockRequest.PositionData.MinX   = MapX;
            MapBlockRequest.PositionData.MaxX   = MapX;
            MapBlockRequest.PositionData.MinY   = MapY;
            MapBlockRequest.PositionData.MaxY   = MapY;
            proxy.InjectPacket(MapBlockRequest, Direction.Outgoing);
        }
        else if (im.MessageBlock.Dialog == (byte)InstantMessageDialog.InventoryOffered)
        {
            if (im.MessageBlock.BinaryBucket[0] == (byte)AssetType.Simstate)
            {
                frame.SayToUser(Utils.BytesToString(im.MessageBlock.FromAgentName) + " offered you a SimState :O");
                return(null);
            }
        }
        else if (im.MessageBlock.Dialog == 9)
        {
            if (im.MessageBlock.BinaryBucket[0] == (byte)AssetType.Simstate)
            {
                frame.SayToUser(im.AgentData.AgentID.ToString() + " offered you a SimState from an object at " + im.MessageBlock.Position.ToString() + " :O Message = " + Utils.BytesToString(im.MessageBlock.Message));
                return(null);
            }
        }
        // Don't get spammed bro
        if (im.MessageBlock.Dialog == 0)
        {
            im.MessageBlock.ID = frame.AgentID.Equals(im.AgentData.AgentID) ? frame.AgentID : im.AgentData.AgentID ^ frame.AgentID;
            packet             = (Packet)im;
        }
        return(packet);
    }
コード例 #11
0
ファイル: SceneManager.cs プロジェクト: RavenB/gridsearch
        public void TriggerSound(object sender, UUID objectID, UUID parentID, UUID ownerID, UUID soundID, Vector3 position, float gain)
        {
            if (OnTriggerSound != null)
            {
                OnTriggerSound(sender, objectID, parentID, ownerID, soundID, position, gain);
            }

            SoundTriggerPacket sound = new SoundTriggerPacket();
            sound.SoundData.Handle = regionHandle;
            sound.SoundData.ObjectID = objectID;
            sound.SoundData.ParentID = parentID;
            sound.SoundData.OwnerID = ownerID;
            sound.SoundData.Position = position;
            sound.SoundData.SoundID = soundID;
            sound.SoundData.Gain = gain;

            udp.BroadcastPacket(sound, PacketCategory.State);
        }
コード例 #12
0
        void SoundTriggerHandler(Packet packet, Agent agent)
        {
            SoundTriggerPacket trigger = (SoundTriggerPacket)packet;

            TriggerSound(agent, trigger.SoundData.SoundID, trigger.SoundData.Gain);
        }