示例#1
0
 /// <summary>
 /// Loads a specific object from storage
 /// </summary>
 /// <param name="prim">The object to load</param>
 public void PrimFromStorage(PrimData prim)
 {
     try
     {
         if (prim.LocalID >= this._primCount)
         {
             _primCount = prim.LocalID + 1;
         }
         OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId " + prim.LocalID + " ) from storage");
         Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
         nPrim.CreateFromStorage(prim);
         this.Entities.Add(nPrim.uuid, nPrim);
     }
     catch (Exception e)
     {
         OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Failed with exception " + e.ToString());
     }
 }
        public bool RezObject(SimClient simClient, Packet packet)
        {
            RezObjectPacket rezPacket = (RezObjectPacket)packet;
            AgentInventory  inven     = this._inventoryCache.GetAgentsInventory(simClient.AgentID);

            if (inven != null)
            {
                if (inven.InventoryItems.ContainsKey(rezPacket.InventoryData.ItemID))
                {
                    AssetBase asset = this._assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID);
                    if (asset != null)
                    {
                        PrimData  primd = new PrimData(asset.Data);
                        Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
                        nPrim.CreateFromStorage(primd, rezPacket.RezData.RayEnd, this._primCount, true);
                        this.Entities.Add(nPrim.uuid, nPrim);
                        this._primCount++;
                        this._inventoryCache.DeleteInventoryItem(simClient, rezPacket.InventoryData.ItemID);
                    }
                }
            }
            return(true);
        }
示例#3
0
 /// <summary>
 /// Loads a specific object from storage
 /// </summary>
 /// <param name="prim">The object to load</param>
 public void PrimFromStorage(PrimData prim)
 {
     try
     {
         if (prim.LocalID >= this._primCount)
         {
             _primCount = prim.LocalID + 1;
         }
         OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId " + prim.LocalID + " ) from storage");
         Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
         nPrim.CreateFromStorage(prim);
         this.Entities.Add(nPrim.uuid, nPrim);
     }
     catch (Exception e)
     {
         OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Failed with exception " + e.ToString());
     }
 }
 public bool RezObject(SimClient simClient, Packet packet)
 {
     RezObjectPacket rezPacket = (RezObjectPacket)packet;
     AgentInventory inven = this._inventoryCache.GetAgentsInventory(simClient.AgentID);
     if (inven != null)
     {
         if (inven.InventoryItems.ContainsKey(rezPacket.InventoryData.ItemID))
         {
             AssetBase asset = this._assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID);
             if (asset != null)
             {
                 PrimData primd = new PrimData(asset.Data);
                 Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
                 nPrim.CreateFromStorage(primd, rezPacket.RezData.RayEnd, this._primCount, true);
                 this.Entities.Add(nPrim.uuid, nPrim);
                 this._primCount++;
                 this._inventoryCache.DeleteInventoryItem(simClient, rezPacket.InventoryData.ItemID);
             }
         }
     }
     return true;
 }