Ejemplo n.º 1
0
        void LogoutRequestHandler(Packet packet, Agent agent)
        {
            LogoutRequestPacket request = (LogoutRequestPacket)packet;

            LogoutReplyPacket reply = new LogoutReplyPacket();
            reply.AgentData.AgentID = agent.AgentID;
            reply.AgentData.SessionID = agent.SessionID;
            reply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
            reply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
            reply.InventoryData[0].ItemID = UUID.Zero;

            lock (server.Agents)
            {
                if (server.Agents.ContainsKey(agent.Address))
                {
                    KillObjectPacket kill = new KillObjectPacket();
                    kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
                    kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
                    kill.ObjectData[0].ID = agent.Avatar.LocalID;

                    server.Agents.Remove(agent.Address);

                    foreach (Agent recipient in server.Agents.Values)
                        recipient.SendPacket(kill);
                }
            }
        }
Ejemplo n.º 2
0
        public void KillClient()
        {
            KillObjectPacket kill = new KillObjectPacket();

            kill.ObjectData       = new KillObjectPacket.ObjectDataBlock[1];
            kill.ObjectData[0]    = new KillObjectPacket.ObjectDataBlock();
            kill.ObjectData[0].ID = this.ClientAvatar.localid;
            foreach (SimClient client in m_clientThreads.Values)
            {
                client.OutPacket(kill);
            }
            if (this.m_userServer != null)
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
            }
            else
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, null);
            }

            m_world.RemoveViewerAgent(this);

            m_clientThreads.Remove(this.CircuitCode);
            m_application.RemoveClientCircuit(this.CircuitCode);
            this.ClientThread.Abort();
        }
Ejemplo n.º 3
0
        void ObjectDuplicateHandler(Packet packet, Agent agent)
        {
            ObjectDuplicatePacket duplicate = (ObjectDuplicatePacket)packet;

            PrimFlags flags  = (PrimFlags)duplicate.SharedData.DuplicateFlags;
            Vector3   offset = duplicate.SharedData.Offset;

            for (int i = 0; i < duplicate.ObjectData.Length; i++)
            {
                uint dupeID = duplicate.ObjectData[i].ObjectLocalID;

                SimulationObject obj;
                if (server.Scene.TryGetObject(dupeID, out obj))
                {
                    SimulationObject newObj = new SimulationObject(obj);
                    newObj.Prim.Position += offset;
                    newObj.Prim.ID        = UUID.Random();

                    server.Scene.ObjectAdd(this, agent, newObj, flags);
                }
                else
                {
                    Logger.Log("ObjectDuplicate sent for missing object " + dupeID,
                               Helpers.LogLevel.Warning);

                    KillObjectPacket kill = new KillObjectPacket();
                    kill.ObjectData       = new KillObjectPacket.ObjectDataBlock[1];
                    kill.ObjectData[0]    = new KillObjectPacket.ObjectDataBlock();
                    kill.ObjectData[0].ID = dupeID;
                    server.UDP.SendPacket(agent.AgentID, kill, PacketCategory.State);
                }
            }
        }
Ejemplo n.º 4
0
        void MultipleObjectUpdateHandler(Packet packet, Agent agent)
        {
            MultipleObjectUpdatePacket update = (MultipleObjectUpdatePacket)packet;

            for (int i = 0; i < update.ObjectData.Length; i++)
            {
                MultipleObjectUpdatePacket.ObjectDataBlock block = update.ObjectData[i];

                SimulationObject obj;
                if (server.Scene.TryGetObject(block.ObjectLocalID, out obj))
                {
                    UpdateType type     = (UpdateType)block.Type;
                    bool       linked   = ((type & UpdateType.Linked) != 0);
                    int        pos      = 0;
                    Vector3    position = obj.Prim.Position;
                    Quaternion rotation = obj.Prim.Rotation;
                    Vector3    scale    = obj.Prim.Scale;

                    if ((type & UpdateType.Position) != 0)
                    {
                        position = new Vector3(block.Data, pos);
                        pos     += 12;
                    }
                    if ((type & UpdateType.Rotation) != 0)
                    {
                        rotation = new Quaternion(block.Data, pos, true);
                        pos     += 12;
                    }
                    if ((type & UpdateType.Scale) != 0)
                    {
                        scale = new Vector3(block.Data, pos);
                        pos  += 12;

                        // FIXME: Use this in linksets
                        bool uniform = ((type & UpdateType.Uniform) != 0);
                    }

                    // Although the object has already been modified, we need
                    // to inform the scene manager of the changes so they are
                    // sent to clients and propagated to other extensions
                    server.Scene.ObjectTransform(this, obj, position, rotation,
                                                 obj.Prim.Velocity, obj.Prim.Acceleration, obj.Prim.AngularVelocity,
                                                 scale);
                }
                else
                {
                    // Ghosted prim, send a kill message to this agent
                    // FIXME: Handle children
                    KillObjectPacket kill = new KillObjectPacket();
                    kill.ObjectData       = new KillObjectPacket.ObjectDataBlock[1];
                    kill.ObjectData[0]    = new KillObjectPacket.ObjectDataBlock();
                    kill.ObjectData[0].ID = block.ObjectLocalID;
                    server.UDP.SendPacket(agent.AgentID, kill, PacketCategory.State);
                }
            }
        }
Ejemplo n.º 5
0
        void ObjectSelectHandler(Packet packet, Agent agent)
        {
            ObjectSelectPacket select = (ObjectSelectPacket)packet;

            for (int i = 0; i < select.ObjectData.Length; i++)
            {
                ObjectPropertiesPacket properties = new ObjectPropertiesPacket();
                properties.ObjectData    = new ObjectPropertiesPacket.ObjectDataBlock[1];
                properties.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();

                SimulationObject obj;
                if (server.Scene.TryGetObject(select.ObjectData[i].ObjectLocalID, out obj))
                {
                    //Logger.DebugLog("Selecting object " + obj.Prim.LocalID);

                    properties.ObjectData[0].BaseMask      = (uint)obj.Prim.Properties.Permissions.BaseMask;
                    properties.ObjectData[0].CreationDate  = Utils.DateTimeToUnixTime(obj.Prim.Properties.CreationDate);
                    properties.ObjectData[0].CreatorID     = obj.Prim.Properties.CreatorID;
                    properties.ObjectData[0].Description   = Utils.StringToBytes(obj.Prim.Properties.Description);
                    properties.ObjectData[0].EveryoneMask  = (uint)obj.Prim.Properties.Permissions.EveryoneMask;
                    properties.ObjectData[0].GroupID       = obj.Prim.Properties.GroupID;
                    properties.ObjectData[0].GroupMask     = (uint)obj.Prim.Properties.Permissions.GroupMask;
                    properties.ObjectData[0].LastOwnerID   = obj.Prim.Properties.LastOwnerID;
                    properties.ObjectData[0].Name          = Utils.StringToBytes(obj.Prim.Properties.Name);
                    properties.ObjectData[0].NextOwnerMask = (uint)obj.Prim.Properties.Permissions.NextOwnerMask;
                    properties.ObjectData[0].ObjectID      = obj.Prim.ID;
                    properties.ObjectData[0].OwnerID       = obj.Prim.Properties.OwnerID;
                    properties.ObjectData[0].OwnerMask     = (uint)obj.Prim.Properties.Permissions.OwnerMask;
                    properties.ObjectData[0].OwnershipCost = obj.Prim.Properties.OwnershipCost;
                    properties.ObjectData[0].SalePrice     = obj.Prim.Properties.SalePrice;
                    properties.ObjectData[0].SaleType      = (byte)obj.Prim.Properties.SaleType;
                    properties.ObjectData[0].SitName       = new byte[0];
                    properties.ObjectData[0].TextureID     = new byte[0];
                    properties.ObjectData[0].TouchName     = new byte[0];

                    server.UDP.SendPacket(agent.AgentID, properties, PacketCategory.Transaction);
                }
                else
                {
                    Logger.Log("ObjectSelect sent for missing object " + select.ObjectData[i].ObjectLocalID,
                               Helpers.LogLevel.Warning);

                    properties.ObjectData[0].Description = new byte[0];
                    properties.ObjectData[0].Name        = new byte[0];
                    properties.ObjectData[0].SitName     = new byte[0];
                    properties.ObjectData[0].TextureID   = new byte[0];
                    properties.ObjectData[0].TouchName   = new byte[0];

                    KillObjectPacket kill = new KillObjectPacket();
                    kill.ObjectData       = new KillObjectPacket.ObjectDataBlock[1];
                    kill.ObjectData[0]    = new KillObjectPacket.ObjectDataBlock();
                    kill.ObjectData[0].ID = select.ObjectData[i].ObjectLocalID;
                    server.UDP.SendPacket(agent.AgentID, kill, PacketCategory.State);
                }
            }
        }
Ejemplo n.º 6
0
        private Packet InKillObjectHandler(Packet packet, IPEndPoint sim)
        {
            KillObjectPacket KillObject  = (KillObjectPacket)packet;
            List <UUID>      ToBeRemoved = new List <UUID>();

            foreach (KillObjectPacket.ObjectDataBlock block in KillObject.ObjectData)
            {
                if (local2global.ContainsKey(block.ID))
                {
                    avclients.Remove(local2global[block.ID]);
                }
            }
            return(packet);
        }
Ejemplo n.º 7
0
        protected virtual bool Logout(SimClient simClient, Packet packet)
        {
            OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got a logout request");
            //send reply to let the client logout
            LogoutReplyPacket logReply = new LogoutReplyPacket();

            logReply.AgentData.AgentID       = this.AgentID;
            logReply.AgentData.SessionID     = this.SessionID;
            logReply.InventoryData           = new LogoutReplyPacket.InventoryDataBlock[1];
            logReply.InventoryData[0]        = new LogoutReplyPacket.InventoryDataBlock();
            logReply.InventoryData[0].ItemID = LLUUID.Zero;
            OutPacket(logReply);
            //tell all clients to kill our object
            KillObjectPacket kill = new KillObjectPacket();

            kill.ObjectData       = new KillObjectPacket.ObjectDataBlock[1];
            kill.ObjectData[0]    = new KillObjectPacket.ObjectDataBlock();
            kill.ObjectData[0].ID = this.ClientAvatar.localid;
            foreach (SimClient client in m_clientThreads.Values)
            {
                client.OutPacket(kill);
            }
            if (this.m_userServer != null)
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
            }
            else
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, null);
            }

            m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);

            /*lock (m_world.Entities)
             * {
             *  m_world.Entities.Remove(this.AgentID);
             * }*/
            m_world.RemoveViewerAgent(this);
            //need to do other cleaning up here too
            m_clientThreads.Remove(this.CircuitCode);
            m_application.RemoveClientCircuit(this.CircuitCode);
            this.ClientThread.Abort();
            return(true);
        }
Ejemplo n.º 8
0
        public bool ObjectRemove(object sender, SimulationObject obj)
        {
            if (OnObjectRemove != null)
            {
                OnObjectRemove(sender, obj);
            }

            sceneObjects.Remove(obj.Prim.LocalID, obj.Prim.ID);

            KillObjectPacket kill = new KillObjectPacket();

            kill.ObjectData       = new KillObjectPacket.ObjectDataBlock[1];
            kill.ObjectData[0]    = new KillObjectPacket.ObjectDataBlock();
            kill.ObjectData[0].ID = obj.Prim.LocalID;

            server.UDP.BroadcastPacket(kill, PacketCategory.State);

            return(true);
        }
Ejemplo n.º 9
0
        // Processes kill object packets (Avatars and Objects leaving the drawing distance)
        private Packet ProcessKillObject(Packet packet, IPEndPoint endpoint)
        {
            KillObjectPacket kill = (KillObjectPacket)packet;

            for (int i = 0; i < kill.ObjectData.Length; i++)
            {
                if (AvatarIDtoUUID.ContainsKey(kill.ObjectData[i].ID))     // it's a known avatar
                {
                    UUID who = AvatarIDtoUUID[kill.ObjectData[i].ID];

                    // Clear some of the translation dictionaries
                    lock (AvatarNameToUUID) AvatarNameToUUID.Remove(AvatarUUIDToName[who]);
                    lock (AvatarUUIDToName) AvatarUUIDToName.Remove(who);
                    lock (AvatarUUIDtoID) AvatarUUIDtoID.Remove(who);
                    lock (AvatarIDtoUUID) AvatarIDtoUUID.Remove(kill.ObjectData[i].ID);
                    // Out of sight, out of mind
                    lock (Appearances) Appearances.Remove(who);
                    lock (Avatars) Avatars.Remove(kill.ObjectData[i].ID);
                }
            }
            return(packet);
        }
Ejemplo n.º 10
0
        private Packet InKillObjectHandler(Packet packet, IPEndPoint sim)
        {
            string simIP = sim.ToString();

            if (SharedInfo.Aux_Simulators.ContainsKey(simIP))
            {
                KillObjectPacket KillObject  = (KillObjectPacket)packet;
                List <UUID>      ToBeRemoved = new List <UUID>();
                foreach (KillObjectPacket.ObjectDataBlock block in KillObject.ObjectData)
                {
                    PubComb.Aux_Avatar avatar = SharedInfo.Aux_Simulators[simIP].AvatarByLocalID(block.ID);
                    if (avatar != null)
                    {
                        form.RemoveAvatar(avatar);
                        ToBeRemoved.Add(avatar.UUID);
                    }
                }
                foreach (UUID uuid in ToBeRemoved)
                {
                    SharedInfo.Aux_Simulators[simIP].Avatars.Remove(uuid);
                }
            }
            return(packet);
        }
        public bool DeRezObject(SimClient simClient, Packet packet)
        {
            DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)packet;

            //Needs to delete object from physics at a later date
            if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero)
            {
                //currently following code not used (or don't know of any case of destination being zero
                libsecondlife.LLUUID[] DeRezEnts;
                DeRezEnts = new libsecondlife.LLUUID[DeRezPacket.ObjectData.Length];
                int i = 0;
                foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
                {

                    //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
                    foreach (Entity ent in this.Entities.Values)
                    {
                        if (ent.localid == Data.ObjectLocalID)
                        {
                            DeRezEnts[i++] = ent.uuid;
                            this.localStorage.RemovePrim(ent.uuid);
                            KillObjectPacket kill = new KillObjectPacket();
                            kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
                            kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
                            kill.ObjectData[0].ID = ent.localid;
                            foreach (SimClient client in m_clientThreads.Values)
                            {
                                client.OutPacket(kill);
                            }
                            //Uncommenting this means an old UUID will be re-used, thus crashing the asset server
                            //Uncomment when prim/object UUIDs are random or such
                            //2007-03-22 - Randomskk
                            //this._primCount--;
                            OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Deleted UUID " + ent.uuid);
                        }
                    }
                }
                foreach (libsecondlife.LLUUID uuid in DeRezEnts)
                {
                    lock (Entities)
                    {
                        Entities.Remove(uuid);
                    }
                }
            }
            else
            {
                foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
                {
                    Entity selectedEnt = null;
                    //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
                    foreach (Entity ent in this.Entities.Values)
                    {
                        if (ent.localid == Data.ObjectLocalID)
                        {
                            AssetBase primAsset = new AssetBase();
                            primAsset.FullID = LLUUID.Random();//DeRezPacket.AgentBlock.TransactionID.Combine(LLUUID.Zero); //should be combining with securesessionid
                            primAsset.InvType = 6;
                            primAsset.Type = 6;
                            primAsset.Name = "Prim";
                            primAsset.Description = "";
                            primAsset.Data = ((Primitive)ent).GetByteArray();
                            this._assetCache.AddAsset(primAsset);
                            this._inventoryCache.AddNewInventoryItem(simClient, DeRezPacket.AgentBlock.DestinationID, primAsset);
                            selectedEnt = ent;
                            break;
                        }
                    }
                    if (selectedEnt != null)
                    {
                        this.localStorage.RemovePrim(selectedEnt.uuid);
                        KillObjectPacket kill = new KillObjectPacket();
                        kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
                        kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
                        kill.ObjectData[0].ID = selectedEnt.localid;
                        foreach (SimClient client in m_clientThreads.Values)
                        {
                            client.OutPacket(kill);
                        }
                        lock (Entities)
                        {
                            Entities.Remove(selectedEnt.uuid);
                        }
                    }
                }
            }
            return true;
        }
        public bool DeRezObject(SimClient simClient, Packet packet)
        {
            DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)packet;

            //Needs to delete object from physics at a later date
            if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero)
            {
                //currently following code not used (or don't know of any case of destination being zero
                libsecondlife.LLUUID[] DeRezEnts;
                DeRezEnts = new libsecondlife.LLUUID[DeRezPacket.ObjectData.Length];
                int i = 0;
                foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
                {
                    //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
                    foreach (Entity ent in this.Entities.Values)
                    {
                        if (ent.localid == Data.ObjectLocalID)
                        {
                            DeRezEnts[i++] = ent.uuid;
                            this.localStorage.RemovePrim(ent.uuid);
                            KillObjectPacket kill = new KillObjectPacket();
                            kill.ObjectData       = new KillObjectPacket.ObjectDataBlock[1];
                            kill.ObjectData[0]    = new KillObjectPacket.ObjectDataBlock();
                            kill.ObjectData[0].ID = ent.localid;
                            foreach (SimClient client in m_clientThreads.Values)
                            {
                                client.OutPacket(kill);
                            }
                            //Uncommenting this means an old UUID will be re-used, thus crashing the asset server
                            //Uncomment when prim/object UUIDs are random or such
                            //2007-03-22 - Randomskk
                            //this._primCount--;
                            OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Deleted UUID " + ent.uuid);
                        }
                    }
                }
                foreach (libsecondlife.LLUUID uuid in DeRezEnts)
                {
                    lock (Entities)
                    {
                        Entities.Remove(uuid);
                    }
                }
            }
            else
            {
                foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
                {
                    Entity selectedEnt = null;
                    //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
                    foreach (Entity ent in this.Entities.Values)
                    {
                        if (ent.localid == Data.ObjectLocalID)
                        {
                            AssetBase primAsset = new AssetBase();
                            primAsset.FullID      = LLUUID.Random();//DeRezPacket.AgentBlock.TransactionID.Combine(LLUUID.Zero); //should be combining with securesessionid
                            primAsset.InvType     = 6;
                            primAsset.Type        = 6;
                            primAsset.Name        = "Prim";
                            primAsset.Description = "";
                            primAsset.Data        = ((Primitive)ent).GetByteArray();
                            this._assetCache.AddAsset(primAsset);
                            this._inventoryCache.AddNewInventoryItem(simClient, DeRezPacket.AgentBlock.DestinationID, primAsset);
                            selectedEnt = ent;
                            break;
                        }
                    }
                    if (selectedEnt != null)
                    {
                        this.localStorage.RemovePrim(selectedEnt.uuid);
                        KillObjectPacket kill = new KillObjectPacket();
                        kill.ObjectData       = new KillObjectPacket.ObjectDataBlock[1];
                        kill.ObjectData[0]    = new KillObjectPacket.ObjectDataBlock();
                        kill.ObjectData[0].ID = selectedEnt.localid;
                        foreach (SimClient client in m_clientThreads.Values)
                        {
                            client.OutPacket(kill);
                        }
                        lock (Entities)
                        {
                            Entities.Remove(selectedEnt.uuid);
                        }
                    }
                }
            }
            return(true);
        }
Ejemplo n.º 13
0
        protected virtual bool Logout(SimClient simClient, Packet packet)
        {
            OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got a logout request");
            //send reply to let the client logout
            LogoutReplyPacket logReply = new LogoutReplyPacket();
            logReply.AgentData.AgentID = this.AgentID;
            logReply.AgentData.SessionID = this.SessionID;
            logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
            logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
            logReply.InventoryData[0].ItemID = LLUUID.Zero;
            OutPacket(logReply);
            //tell all clients to kill our object
            KillObjectPacket kill = new KillObjectPacket();
            kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
            kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
            kill.ObjectData[0].ID = this.ClientAvatar.localid;
            foreach (SimClient client in m_clientThreads.Values)
            {
                client.OutPacket(kill);
            }
            if (this.m_userServer != null)
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
            }
            else
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, null);
            }

            m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
            /*lock (m_world.Entities)
            {
                m_world.Entities.Remove(this.AgentID);
            }*/
            m_world.RemoveViewerAgent(this);
            //need to do other cleaning up here too
            m_clientThreads.Remove(this.CircuitCode);
            m_application.RemoveClientCircuit(this.CircuitCode);
            this.ClientThread.Abort();
            return true;
        }
Ejemplo n.º 14
0
        public void KillClient()
        {
            KillObjectPacket kill = new KillObjectPacket();
            kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
            kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
            kill.ObjectData[0].ID = this.ClientAvatar.localid;
            foreach (SimClient client in m_clientThreads.Values)
            {
                client.OutPacket(kill);
            }
            if (this.m_userServer != null)
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
            }
            else
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, null);
            }

            m_world.RemoveViewerAgent(this);

            m_clientThreads.Remove(this.CircuitCode);
            m_application.RemoveClientCircuit(this.CircuitCode);
            this.ClientThread.Abort();
        }
Ejemplo n.º 15
0
        void RemoveObject(object sender, SimulationObject obj)
        {
            // If this object has an agent associated with it, remove the agent from the scene as well
            Agent agent;
            if (sceneAgents.TryGetValue(obj.Prim.ID, out agent))
                AgentRemove(sender, agent);

            // Remove the agent from the scene
            sceneObjects.Remove(obj.Prim.LocalID, obj.Prim.ID);

            // Fire the callback
            if (OnObjectRemove != null)
                OnObjectRemove(sender, obj);

            // If this object has a cached task inventory asset, delete it now
            if (obj.Inventory.InventorySerial > 0)
                taskInventory.RemoveTaskFile(obj.Inventory.GetInventoryFilename());

            // Broadcast the kill message
            KillObjectPacket kill = new KillObjectPacket();
            kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
            kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
            kill.ObjectData[0].ID = obj.Prim.LocalID;

            udp.BroadcastPacket(kill, PacketCategory.State);
        }
Ejemplo n.º 16
0
        private void SendKillPacket(QueuedInterestListEvent[] eventDatas, IScenePresence presence)
        {
            if (!(presence is LLAgent) || presence.InterestList == null)
                return;
            LLAgent agent = (LLAgent)presence;

            KillObjectPacket kill = new KillObjectPacket();
            kill.ObjectData = new KillObjectPacket.ObjectDataBlock[eventDatas.Length];

            for (int i = 0; i < eventDatas.Length; i++)
            {
                kill.ObjectData[i] = new KillObjectPacket.ObjectDataBlock();
                kill.ObjectData[i].ID = (uint)eventDatas[i].Event.State;
            }

            m_udp.SendPacket(agent, kill, ThrottleCategory.Task, true);
        }
Ejemplo n.º 17
0
        private void SendSingleKillPacket(LLAgent agent, uint localID)
        {
            KillObjectPacket kill = new KillObjectPacket();
            kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
            kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
            kill.ObjectData[0].ID = localID;

            m_udp.SendPacket(agent, kill, ThrottleCategory.Task, true);
        }