From 70fa30204272e874b8e3acccdc2e22cd4e42b2b2 Mon Sep 17 00:00:00 2001
From: MW
Date: Sun, 22 Jul 2007 11:44:36 +0000
Subject: * Some work in progress code: Inventory cache, start of inventory
server/service, userprofile cache, inventory handling. (non of it is enabled
yet (or at least it shouldn't be). * Fixed some of the problems with crossing
regions when flying: you should no longer sink to ground level when crossing
(should keep roughly your right height). Should no longer sometimes get sent
back to the centre of the current region when attempting to border cross. But
instead sometimes you will find you avatar stop at the edge of region and you
will need to start moving again to retry the crossing (which should then
work). This code is partly based on Babblefrog's issue #212 patch. [I think I
have some ideas of how to solve the stopping at edges problem, just want to
get the inventory code done first] * Capabilities code has now been moved to
the OpenSim.Framework.Communications project as some of the caps code will be
tightly tied to inventory/asset handling and it was causing a two way
reference problem when it was in its own project/dll.
This is a Big commit as I was going to keep my inventory work local until I had it in a working state, in case it brakes anything, but its getting harder to keep in sync with svn.
---
.../Environment/Scenes/Scene.PacketHandlers.cs | 72 +++++++++++++++++++++-
1 file changed, 71 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index e963737..126b636 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -26,11 +26,14 @@
*
*/
using System;
+using System.IO;
using System.Collections.Generic;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
+using OpenSim.Framework.Communications.Caches;
+using OpenSim.Framework.Data;
namespace OpenSim.Region.Environment.Scenes
{
@@ -139,7 +142,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
{
- ScenePresence avatar = null;
+ ScenePresence avatar = null;
if (this.Avatars.ContainsKey(fromAgentID))
{
avatar = this.Avatars[fromAgentID];
@@ -343,6 +346,29 @@ namespace OpenSim.Region.Environment.Scenes
}
}
}
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
+ {
+ Primitive prim = null;
+ foreach (EntityBase ent in Entities.Values)
+ {
+ if (ent is SceneObject)
+ {
+ prim = ((SceneObject)ent).HasChildPrim(primLocalID);
+ if (prim != null)
+ {
+ prim.GetInventory(remoteClient, primLocalID);
+ break;
+ }
+ }
+ }
+ }
+
///
///
///
@@ -623,6 +649,50 @@ namespace OpenSim.Region.Environment.Scenes
}
///
+ /// temporary method to test out creating new inventory items
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask)
+ {
+ CachedUserInfo userInfo = commsManager.UserProfilesCache.GetUserDetails(remoteClient.AgentId);
+ if (userInfo != null)
+ {
+ AssetBase asset = new AssetBase();
+ asset.Name = name;
+ asset.Description = description;
+ asset.InvType = invType;
+ asset.Type = type;
+ asset.FullID = LLUUID.Random();
+ asset.Data = new byte[0];
+ this.assetCache.AddAsset(asset);
+
+ InventoryItemBase item = new InventoryItemBase();
+ item.avatarID = remoteClient.AgentId;
+ item.creatorsID = remoteClient.AgentId;
+ item.inventoryID = LLUUID.Random();
+ item.assetID = asset.FullID;
+ item.inventoryDescription = description;
+ item.inventoryName = name;
+ item.type = invType;
+ item.parentFolderID = folderID;
+ item.inventoryCurrentPermissions = 2147483647;
+ item.inventoryNextPermissions = nextOwnerMask;
+
+ userInfo.ItemReceive(remoteClient.AgentId, item);
+ remoteClient.SendInventoryItemUpdate(item);
+ }
+ }
+
+ ///
/// Sends prims to a client
///
/// Client to send to
--
cgit v1.1