Ejemplo n.º 1
0
 public virtual void RegisterClientPacketHandlers()
 {
     if (this._localWorld != null)
     {
         SimClient.AddPacketHandler(PacketType.ModifyLand, _localWorld.ModifyTerrain);
         SimClient.AddPacketHandler(PacketType.ChatFromViewer, _localWorld.SimChat);
         SimClient.AddPacketHandler(PacketType.RezObject, _localWorld.RezObject);
         SimClient.AddPacketHandler(PacketType.DeRezObject, _localWorld.DeRezObject);
         SimClient.AddPacketHandler(PacketType.UUIDNameRequest, this.RequestUUIDName);
     }
 }
Ejemplo n.º 2
0
        public LLUUID AddNewInventoryItem(SimClient remoteClient, LLUUID folderID, OpenSim.Framework.Types.AssetBase asset)
        {
            LLUUID newItem = null;
            if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
            {
                newItem = this._agentsInventory[remoteClient.AgentID].AddToInventory(folderID, asset);
                if (newItem != null)
                {
                    InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[newItem];
                    this.SendItemUpdateCreate(remoteClient, Item);
                }
            }

            return newItem;
        }
Ejemplo n.º 3
0
        protected virtual void AddNewClient(Packet packet)
        {
            UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet;

            this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
            bool isChildAgent = false;

            SimClient newuser = new SimClient(epSender, useCircuit, LocalWorld, _packetServer.ClientThreads, AssetCache, GridServers.GridServer, this, InventoryCache, m_sandbox, isChildAgent, this.regionData);

            if ((this.GridServers.UserServer != null) && (user_accounts))
            {
                newuser.UserServer = this.GridServers.UserServer;
            }
            //OpenSimRoot.Instance.ClientThreads.Add(epSender, newuser);
            this._packetServer.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
        }
Ejemplo n.º 4
0
        public bool RequestUUIDName(SimClient simClient, Packet packet)
        {
            System.Text.Encoding enc = System.Text.Encoding.ASCII;
            Console.WriteLine(packet.ToString());
            UUIDNameRequestPacket nameRequest = (UUIDNameRequestPacket)packet;
            UUIDNameReplyPacket nameReply = new UUIDNameReplyPacket();
            nameReply.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[nameRequest.UUIDNameBlock.Length];

            for (int i = 0; i < nameRequest.UUIDNameBlock.Length; i++)
            {
                nameReply.UUIDNameBlock[i] = new UUIDNameReplyPacket.UUIDNameBlockBlock();
                nameReply.UUIDNameBlock[i].ID = nameRequest.UUIDNameBlock[i].ID;
                nameReply.UUIDNameBlock[i].FirstName = enc.GetBytes("Who\0");  //for now send any name
                nameReply.UUIDNameBlock[i].LastName = enc.GetBytes("Knows\0");	   //in future need to look it up
            }
            simClient.OutPacket(nameReply);
            return true;
        }
Ejemplo n.º 5
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.º 6
0
        protected bool MultipleObjUpdate(SimClient simClient, Packet packet)
        {
            MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;

            for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
            {
                if (multipleupdate.ObjectData[i].Type == 9) //change position
                {
                    libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
                    foreach (Entity ent in m_world.Entities.Values)
                    {
                        if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
                        {
                            ((OpenSim.world.Primitive)ent).UpdatePosition(pos);
                        }
                    }
                    //should update stored position of the prim
                }
                else if (multipleupdate.ObjectData[i].Type == 10)//rotation
                {
                    libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
                    foreach (Entity ent in m_world.Entities.Values)
                    {
                        if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
                        {
                            ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
                            ((OpenSim.world.Primitive)ent).UpdateFlag = true;
                        }
                    }
                }
                else if (multipleupdate.ObjectData[i].Type == 13)//scale
                {
                    libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
                    foreach (Entity ent in m_world.Entities.Values)
                    {
                        if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
                        {
                            ((OpenSim.world.Primitive)ent).Scale = scale;
                        }
                    }
                }
            }
            return(true);
        }
Ejemplo n.º 7
0
        public bool RequestUUIDName(SimClient simClient, Packet packet)
        {
            System.Text.Encoding enc = System.Text.Encoding.ASCII;
            Console.WriteLine(packet.ToString());
            UUIDNameRequestPacket nameRequest = (UUIDNameRequestPacket)packet;
            UUIDNameReplyPacket   nameReply   = new UUIDNameReplyPacket();

            nameReply.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[nameRequest.UUIDNameBlock.Length];

            for (int i = 0; i < nameRequest.UUIDNameBlock.Length; i++)
            {
                nameReply.UUIDNameBlock[i]           = new UUIDNameReplyPacket.UUIDNameBlockBlock();
                nameReply.UUIDNameBlock[i].ID        = nameRequest.UUIDNameBlock[i].ID;
                nameReply.UUIDNameBlock[i].FirstName = enc.GetBytes("Who\0");   //for now send any name
                nameReply.UUIDNameBlock[i].LastName  = enc.GetBytes("Knows\0"); //in future need to look it up
            }
            simClient.OutPacket(nameReply);
            return(true);
        }
Ejemplo n.º 8
0
        protected bool AgentTextureCached(SimClient simclient, Packet packet)
        {
            // Console.WriteLine(packet.ToString());
            AgentCachedTexturePacket         chechedtex = (AgentCachedTexturePacket)packet;
            AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket();

            cachedresp.AgentData.AgentID   = this.AgentID;
            cachedresp.AgentData.SessionID = this.SessionID;
            cachedresp.AgentData.SerialNum = this.cachedtextureserial;
            this.cachedtextureserial++;
            cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[chechedtex.WearableData.Length];
            for (int i = 0; i < chechedtex.WearableData.Length; i++)
            {
                cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
                cachedresp.WearableData[i].TextureIndex = chechedtex.WearableData[i].TextureIndex;
                cachedresp.WearableData[i].TextureID    = LLUUID.Zero;
                cachedresp.WearableData[i].HostName     = new byte[0];
            }
            this.OutPacket(cachedresp);
            return(true);
        }
Ejemplo n.º 9
0
        public void FetchInventory(SimClient userInfo, FetchInventoryPacket FetchItems)
        {
            if (this._agentsInventory.ContainsKey(userInfo.AgentID))
            {
                AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID];

                for (int i = 0; i < FetchItems.InventoryData.Length; i++)
                {
                    if (agentInventory.InventoryItems.ContainsKey(FetchItems.InventoryData[i].ItemID))
                    {
                        InventoryItem Item = agentInventory.InventoryItems[FetchItems.InventoryData[i].ItemID];
                        FetchInventoryReplyPacket InventoryReply = new FetchInventoryReplyPacket();
                        InventoryReply.AgentData.AgentID = userInfo.AgentID;
                        InventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1];
                        InventoryReply.InventoryData[0] = new FetchInventoryReplyPacket.InventoryDataBlock();
                        InventoryReply.InventoryData[0].ItemID = Item.ItemID;
                        InventoryReply.InventoryData[0].AssetID = Item.AssetID;
                        InventoryReply.InventoryData[0].CreatorID = Item.CreatorID;
                        InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS;
                        InventoryReply.InventoryData[0].CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
                        InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0");
                        InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
                        InventoryReply.InventoryData[0].Flags = 0;
                        InventoryReply.InventoryData[0].FolderID = Item.FolderID;
                        InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
                        InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
                        InventoryReply.InventoryData[0].InvType = Item.InvType;
                        InventoryReply.InventoryData[0].Name = _enc.GetBytes(Item.Name + "\0");
                        InventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS;
                        InventoryReply.InventoryData[0].OwnerID = Item.OwnerID;
                        InventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS;
                        InventoryReply.InventoryData[0].SalePrice = 100;
                        InventoryReply.InventoryData[0].SaleType = 0;
                        InventoryReply.InventoryData[0].Type = Item.Type;
                        InventoryReply.InventoryData[0].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
                        userInfo.OutPacket(InventoryReply);
                    }
                }
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="userInfo"></param>
        /// <param name="transferRequest"></param>
        public void AddAssetRequest(SimClient userInfo, TransferRequestPacket transferRequest)
        {
            LLUUID requestID = new LLUUID(transferRequest.TransferInfo.Params, 0);
            //check to see if asset is in local cache, if not we need to request it from asset server.
            if (!this.Assets.ContainsKey(requestID))
            {
                //not found asset
                // so request from asset server
                if (!this.RequestedAssets.ContainsKey(requestID))
                {
                    AssetRequest request = new AssetRequest();
                    request.RequestUser = userInfo;
                    request.RequestAssetID = requestID;
                    request.TransferRequestID = transferRequest.TransferInfo.TransferID;
                    this.RequestedAssets.Add(requestID, request);
                    this._assetServer.RequestAsset(requestID, false);
                }
                return;
            }
            //it is in our cache
             AssetInfo asset = this.Assets[requestID];

            //work out how many packets it  should be sent in
            // and add to the AssetRequests list
            AssetRequest req = new AssetRequest();
            req.RequestUser = userInfo;
            req.RequestAssetID = requestID;
            req.TransferRequestID = transferRequest.TransferInfo.TransferID;
            req.AssetInf = asset;

            if (asset.Data.LongLength > 600)
            {
                //over 600 bytes so split up file
                req.NumPackets = 1 + (int)(asset.Data.Length - 600 + 999) / 1000;
            }
            else
            {
                req.NumPackets = 1;
            }

            this.AssetRequests.Add(req);
        }
Ejemplo n.º 11
0
 public AgentAssetUpload(SimClient client, AssetCache assetCache, InventoryCache inventoryCache)
 {
     this.ourClient   = client;
     m_assetCache     = assetCache;
     m_inventoryCache = inventoryCache;
 }
Ejemplo n.º 12
0
        protected bool MultipleObjUpdate(SimClient simClient, Packet packet)
        {
            MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
            for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
            {
                if (multipleupdate.ObjectData[i].Type == 9) //change position
                {
                    libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
                    foreach (Entity ent in m_world.Entities.Values)
                    {
                        if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
                        {
                            ((OpenSim.world.Primitive)ent).UpdatePosition(pos);

                        }
                    }
                    //should update stored position of the prim
                }
                else if (multipleupdate.ObjectData[i].Type == 10)//rotation
                {
                    libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
                    foreach (Entity ent in m_world.Entities.Values)
                    {
                        if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
                        {
                            ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
                            ((OpenSim.world.Primitive)ent).UpdateFlag = true;
                        }
                    }
                }
                else if (multipleupdate.ObjectData[i].Type == 13)//scale
                {

                    libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
                    foreach (Entity ent in m_world.Entities.Values)
                    {
                        if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
                        {
                            ((OpenSim.world.Primitive)ent).Scale = scale;
                        }
                    }
                }
            }
            return true;
        }
Ejemplo n.º 13
0
 public AgentAssetUpload(SimClient client, AssetCache assetCache, InventoryCache inventoryCache)
 {
     this.ourClient = client;
     m_assetCache = assetCache;
     m_inventoryCache = inventoryCache;
 }
Ejemplo n.º 14
0
 protected bool AgentTextureCached(SimClient simclient, Packet packet)
 {
     // Console.WriteLine(packet.ToString());
     AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet;
     AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket();
     cachedresp.AgentData.AgentID = this.AgentID;
     cachedresp.AgentData.SessionID = this.SessionID;
     cachedresp.AgentData.SerialNum = this.cachedtextureserial;
     this.cachedtextureserial++;
     cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[chechedtex.WearableData.Length];
     for (int i = 0; i < chechedtex.WearableData.Length; i++)
     {
         cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
         cachedresp.WearableData[i].TextureIndex = chechedtex.WearableData[i].TextureIndex;
         cachedresp.WearableData[i].TextureID = LLUUID.Zero;
         cachedresp.WearableData[i].HostName = new byte[0];
     }
     this.OutPacket(cachedresp);
     return true;
 }
Ejemplo n.º 15
0
        public bool DeleteInventoryItem(SimClient remoteClient, LLUUID itemID)
        {
            bool res = false;
            if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
            {
                res = this._agentsInventory[remoteClient.AgentID].DeleteFromInventory(itemID);
                if (res)
                {
                    RemoveInventoryItemPacket remove = new RemoveInventoryItemPacket();
                    remove.AgentData.AgentID = remoteClient.AgentID;
                    remove.AgentData.SessionID = remoteClient.SessionID;
                    remove.InventoryData = new RemoveInventoryItemPacket.InventoryDataBlock[1];
                    remove.InventoryData[0] = new RemoveInventoryItemPacket.InventoryDataBlock();
                    remove.InventoryData[0].ItemID = itemID;
                    remoteClient.OutPacket(remove);
                }
            }

            return res;
        }
Ejemplo n.º 16
0
 public bool CreateNewInventoryFolder(SimClient remoteClient, LLUUID folderID, ushort type, string folderName, LLUUID parent)
 {
     bool res = false;
     if (folderID != LLUUID.Zero)  //don't create a folder with a zero id
     {
         if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
         {
             res = this._agentsInventory[remoteClient.AgentID].CreateNewFolder(folderID, type, folderName, parent);
         }
     }
     return res;
 }
Ejemplo n.º 17
0
 public bool CreateNewInventoryFolder(SimClient remoteClient, LLUUID folderID)
 {
     return this.CreateNewInventoryFolder(remoteClient, folderID, 0);
 }
Ejemplo n.º 18
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="userInfo"></param>
        /// <param name="imageID"></param>
        public void AddTextureRequest(SimClient userInfo, LLUUID imageID)
        {
            //check to see if texture is in local cache, if not request from asset server
            if (!this.Textures.ContainsKey(imageID))
            {
                if (!this.RequestedTextures.ContainsKey(imageID))
                {
                    //not is cache so request from asset server
                    AssetRequest request = new AssetRequest();
                    request.RequestUser = userInfo;
                    request.RequestAssetID = imageID;
                    request.IsTextureRequest = true;
                    this.RequestedTextures.Add(imageID, request);
                    this._assetServer.RequestAsset(imageID, true);
                }
                return;
            }

            TextureImage imag = this.Textures[imageID];
            AssetRequest req = new AssetRequest();
            req.RequestUser = userInfo;
            req.RequestAssetID = imageID;
            req.IsTextureRequest = true;
            req.ImageInfo = imag;

            if (imag.Data.LongLength > 600)
            {
                //over 600 bytes so split up file
                req.NumPackets = 1 + (int)(imag.Data.Length - 600 + 999) / 1000;
            }
            else
            {
                req.NumPackets = 1;
            }
            this.TextureRequests.Add(req);
        }
Ejemplo n.º 19
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.º 20
0
        public void FetchInventoryDescendents(SimClient userInfo, FetchInventoryDescendentsPacket FetchDescend)
        {
            if (this._agentsInventory.ContainsKey(userInfo.AgentID))
            {
                AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID];
                if (FetchDescend.InventoryData.FetchItems)
                {
                    if (agentInventory.InventoryFolders.ContainsKey(FetchDescend.InventoryData.FolderID))
                    {
                        InventoryFolder Folder = agentInventory.InventoryFolders[FetchDescend.InventoryData.FolderID];
                        InventoryDescendentsPacket Descend = new InventoryDescendentsPacket();
                        Descend.AgentData.AgentID = userInfo.AgentID;
                        Descend.AgentData.OwnerID = Folder.OwnerID;
                        Descend.AgentData.FolderID = FetchDescend.InventoryData.FolderID;
                        Descend.AgentData.Descendents = Folder.Items.Count;
                        Descend.AgentData.Version = Folder.Items.Count;

                        Descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[Folder.Items.Count];
                        for (int i = 0; i < Folder.Items.Count; i++)
                        {

                            InventoryItem Item = Folder.Items[i];
                            Descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock();
                            Descend.ItemData[i].ItemID = Item.ItemID;
                            Descend.ItemData[i].AssetID = Item.AssetID;
                            Descend.ItemData[i].CreatorID = Item.CreatorID;
                            Descend.ItemData[i].BaseMask = FULL_MASK_PERMISSIONS;
                            Descend.ItemData[i].CreationDate = 1000;
                            Descend.ItemData[i].Description = _enc.GetBytes(Item.Description + "\0");
                            Descend.ItemData[i].EveryoneMask = FULL_MASK_PERMISSIONS;
                            Descend.ItemData[i].Flags = 1;
                            Descend.ItemData[i].FolderID = Item.FolderID;
                            Descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
                            Descend.ItemData[i].GroupMask = FULL_MASK_PERMISSIONS;
                            Descend.ItemData[i].InvType = Item.InvType;
                            Descend.ItemData[i].Name = _enc.GetBytes(Item.Name + "\0");
                            Descend.ItemData[i].NextOwnerMask = FULL_MASK_PERMISSIONS;
                            Descend.ItemData[i].OwnerID = Item.OwnerID;
                            Descend.ItemData[i].OwnerMask = FULL_MASK_PERMISSIONS;
                            Descend.ItemData[i].SalePrice = 100;
                            Descend.ItemData[i].SaleType = 0;
                            Descend.ItemData[i].Type = Item.Type;
                            Descend.ItemData[i].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, Descend.ItemData[i].InvType, Descend.ItemData[i].Type, Descend.ItemData[i].AssetID, Descend.ItemData[i].GroupID, 100, Descend.ItemData[i].OwnerID, Descend.ItemData[i].CreatorID, Descend.ItemData[i].ItemID, Descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
                        }

                        userInfo.OutPacket(Descend);

                    }
                }
                else
                {
                    Console.WriteLine("fetch subfolders");
                }
            }
        }
Ejemplo n.º 21
0
        protected virtual void AddNewClient(Packet packet)
        {
            UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet;
            this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
            bool isChildAgent = false;

            SimClient newuser = new SimClient(epSender, useCircuit, LocalWorld, _packetServer.ClientThreads, AssetCache, GridServers.GridServer, this, InventoryCache, m_sandbox, isChildAgent, this.regionData);
            if ((this.GridServers.UserServer != null) && (user_accounts))
            {
                newuser.UserServer = this.GridServers.UserServer;
            }
            //OpenSimRoot.Instance.ClientThreads.Add(epSender, newuser);
            this._packetServer.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
        }
Ejemplo n.º 22
0
        public bool UpdateInventoryItemAsset(SimClient remoteClient, LLUUID itemID, OpenSim.Framework.Types.AssetBase asset)
        {
            if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
            {
                bool res = _agentsInventory[remoteClient.AgentID].UpdateItemAsset(itemID, asset);
                if (res)
                {
                    InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID];
                    this.SendItemUpdateCreate(remoteClient, Item);
                }
                return res;
            }

            return false;
        }
Ejemplo n.º 23
0
        public bool UpdateInventoryItemDetails(SimClient remoteClient, LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet)
        {
            if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
            {
                bool res = _agentsInventory[remoteClient.AgentID].UpdateItemDetails(itemID, packet);
                if (res)
                {
                    InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID];
                    this.SendItemUpdateCreate(remoteClient, Item);
                }
                return res;
            }

            return false;
        }
Ejemplo n.º 24
0
        private void SendItemUpdateCreate(SimClient remoteClient, InventoryItem Item)
        {
            UpdateCreateInventoryItemPacket InventoryReply = new UpdateCreateInventoryItemPacket();
            InventoryReply.AgentData.AgentID = remoteClient.AgentID;
            InventoryReply.AgentData.SimApproved = true;
            InventoryReply.InventoryData = new UpdateCreateInventoryItemPacket.InventoryDataBlock[1];
            InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock();
            InventoryReply.InventoryData[0].ItemID = Item.ItemID;
            InventoryReply.InventoryData[0].AssetID = Item.AssetID;
            InventoryReply.InventoryData[0].CreatorID = Item.CreatorID;
            InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS;
            InventoryReply.InventoryData[0].CreationDate = 1000;
            InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0");
            InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
            InventoryReply.InventoryData[0].Flags = 0;
            InventoryReply.InventoryData[0].FolderID = Item.FolderID;
            InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
            InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
            InventoryReply.InventoryData[0].InvType = Item.InvType;
            InventoryReply.InventoryData[0].Name = _enc.GetBytes(Item.Name + "\0");
            InventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS;
            InventoryReply.InventoryData[0].OwnerID = Item.OwnerID;
            InventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS;
            InventoryReply.InventoryData[0].SalePrice = 100;
            InventoryReply.InventoryData[0].SaleType = 0;
            InventoryReply.InventoryData[0].Type = Item.Type;
            InventoryReply.InventoryData[0].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);

            remoteClient.OutPacket(InventoryReply);
        }
Ejemplo n.º 25
0
 public void SendPacketToAllExcept(Packet packet, SimClient simClient)
 {
 }
Ejemplo n.º 26
0
 public void SendPacketToAllExcept(Packet packet, SimClient simClient)
 {
 }