aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs11
-rw-r--r--OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs31
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCache.cs5
-rw-r--r--OpenSim/Framework/IClientAPI.cs4
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs1
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs127
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs1
9 files changed, 134 insertions, 57 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 0ea33ff..99041c1 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -239,6 +239,17 @@ namespace OpenSim.Framework.Communications.Cache
239 //Todo should delete it from memory too 239 //Todo should delete it from memory too
240 } 240 }
241 241
242 public AssetBase CopyAsset(LLUUID assetID)
243 {
244 AssetBase asset = GetAsset(assetID);
245 if (asset == null)
246 return null;
247
248 asset.FullID = LLUUID.Random(); // TODO: check for conflicts
249 AddAsset(asset);
250 return asset;
251 }
252
242 /// <summary> 253 /// <summary>
243 /// 254 ///
244 /// </summary> 255 /// </summary>
diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
index 05caa84..62251bc 100644
--- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
@@ -88,7 +88,8 @@ namespace OpenSim.Framework.Communications.Cache
88 item.assetID = new LLUUID("00000000-0000-0000-9999-000000000002"); 88 item.assetID = new LLUUID("00000000-0000-0000-9999-000000000002");
89 item.inventoryDescription = "Plywood texture"; 89 item.inventoryDescription = "Plywood texture";
90 item.inventoryName = "Plywood"; 90 item.inventoryName = "Plywood";
91 item.assetType = 0; 91 item.assetType = (int) AssetType.Texture;
92 item.invType = (int) InventoryType.Texture;
92 item.parentFolderID = m_textureFolder.folderID; 93 item.parentFolderID = m_textureFolder.folderID;
93 item.inventoryBasePermissions = 0x7FFFFFFF; 94 item.inventoryBasePermissions = 0x7FFFFFFF;
94 item.inventoryEveryOnePermissions = 0x7FFFFFFF; 95 item.inventoryEveryOnePermissions = 0x7FFFFFFF;
@@ -103,7 +104,8 @@ namespace OpenSim.Framework.Communications.Cache
103 item.assetID = new LLUUID("00000000-0000-0000-9999-000000000003"); 104 item.assetID = new LLUUID("00000000-0000-0000-9999-000000000003");
104 item.inventoryDescription = "Rocks texture"; 105 item.inventoryDescription = "Rocks texture";
105 item.inventoryName = "Rocks"; 106 item.inventoryName = "Rocks";
106 item.assetType = 0; 107 item.assetType = (int) AssetType.Texture;
108 item.invType = (int) InventoryType.Texture;
107 item.parentFolderID = m_textureFolder.folderID; 109 item.parentFolderID = m_textureFolder.folderID;
108 item.inventoryBasePermissions = 0x7FFFFFFF; 110 item.inventoryBasePermissions = 0x7FFFFFFF;
109 item.inventoryEveryOnePermissions = 0x7FFFFFFF; 111 item.inventoryEveryOnePermissions = 0x7FFFFFFF;
@@ -118,7 +120,8 @@ namespace OpenSim.Framework.Communications.Cache
118 item.assetID = new LLUUID("00000000-0000-0000-9999-000000000001"); 120 item.assetID = new LLUUID("00000000-0000-0000-9999-000000000001");
119 item.inventoryDescription = "Bricks texture"; 121 item.inventoryDescription = "Bricks texture";
120 item.inventoryName = "Bricks"; 122 item.inventoryName = "Bricks";
121 item.assetType = 0; 123 item.assetType = (int) AssetType.Texture;
124 item.invType = (int) InventoryType.Texture;
122 item.parentFolderID = m_textureFolder.folderID; 125 item.parentFolderID = m_textureFolder.folderID;
123 item.inventoryBasePermissions = 0x7FFFFFFF; 126 item.inventoryBasePermissions = 0x7FFFFFFF;
124 item.inventoryEveryOnePermissions = 0x7FFFFFFF; 127 item.inventoryEveryOnePermissions = 0x7FFFFFFF;
@@ -133,7 +136,8 @@ namespace OpenSim.Framework.Communications.Cache
133 item.assetID = new LLUUID("00000000-0000-0000-9999-000000000004"); 136 item.assetID = new LLUUID("00000000-0000-0000-9999-000000000004");
134 item.inventoryDescription = "Granite texture"; 137 item.inventoryDescription = "Granite texture";
135 item.inventoryName = "Granite"; 138 item.inventoryName = "Granite";
136 item.assetType = 0; 139 item.assetType = (int) AssetType.Texture;
140 item.invType = (int) InventoryType.Texture;
137 item.parentFolderID = m_textureFolder.folderID; 141 item.parentFolderID = m_textureFolder.folderID;
138 item.inventoryBasePermissions = 0x7FFFFFFF; 142 item.inventoryBasePermissions = 0x7FFFFFFF;
139 item.inventoryEveryOnePermissions = 0x7FFFFFFF; 143 item.inventoryEveryOnePermissions = 0x7FFFFFFF;
@@ -148,7 +152,8 @@ namespace OpenSim.Framework.Communications.Cache
148 item.assetID = new LLUUID("00000000-0000-0000-9999-000000000005"); 152 item.assetID = new LLUUID("00000000-0000-0000-9999-000000000005");
149 item.inventoryDescription = "Hardwood texture"; 153 item.inventoryDescription = "Hardwood texture";
150 item.inventoryName = "Hardwood"; 154 item.inventoryName = "Hardwood";
151 item.assetType = 0; 155 item.assetType = (int) AssetType.Texture;
156 item.invType = (int) InventoryType.Texture;
152 item.parentFolderID = m_textureFolder.folderID; 157 item.parentFolderID = m_textureFolder.folderID;
153 item.inventoryBasePermissions = 0x7FFFFFFF; 158 item.inventoryBasePermissions = 0x7FFFFFFF;
154 item.inventoryEveryOnePermissions = 0x7FFFFFFF; 159 item.inventoryEveryOnePermissions = 0x7FFFFFFF;
@@ -163,8 +168,8 @@ namespace OpenSim.Framework.Communications.Cache
163 item.assetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); 168 item.assetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
164 item.inventoryDescription = "Default Shape"; 169 item.inventoryDescription = "Default Shape";
165 item.inventoryName = "Default Shape"; 170 item.inventoryName = "Default Shape";
166 item.assetType = 13; 171 item.assetType = (int) AssetType.Bodypart;
167 item.invType = 18; 172 item.invType = (int) InventoryType.Wearable;
168 item.parentFolderID = folderID; 173 item.parentFolderID = folderID;
169 item.inventoryCurrentPermissions = 0; 174 item.inventoryCurrentPermissions = 0;
170 item.inventoryNextPermissions = 0; 175 item.inventoryNextPermissions = 0;
@@ -177,8 +182,8 @@ namespace OpenSim.Framework.Communications.Cache
177 item.assetID = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb"); 182 item.assetID = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb");
178 item.inventoryDescription = "Default Skin"; 183 item.inventoryDescription = "Default Skin";
179 item.inventoryName = "Default Skin"; 184 item.inventoryName = "Default Skin";
180 item.assetType = 13; 185 item.assetType = (int) AssetType.Bodypart;
181 item.invType = 18; 186 item.invType = (int) InventoryType.Wearable;
182 item.parentFolderID = folderID; 187 item.parentFolderID = folderID;
183 item.inventoryCurrentPermissions = 0; 188 item.inventoryCurrentPermissions = 0;
184 item.inventoryNextPermissions = 0; 189 item.inventoryNextPermissions = 0;
@@ -191,8 +196,8 @@ namespace OpenSim.Framework.Communications.Cache
191 item.assetID = new LLUUID("00000000-38f9-1111-024e-222222111110"); 196 item.assetID = new LLUUID("00000000-38f9-1111-024e-222222111110");
192 item.inventoryDescription = "Default Shirt"; 197 item.inventoryDescription = "Default Shirt";
193 item.inventoryName = "Default Shirt"; 198 item.inventoryName = "Default Shirt";
194 item.assetType = 5; 199 item.assetType = (int) AssetType.Clothing;
195 item.invType = 18; 200 item.invType = (int) InventoryType.Wearable;
196 item.parentFolderID = folderID; 201 item.parentFolderID = folderID;
197 item.inventoryCurrentPermissions = 0; 202 item.inventoryCurrentPermissions = 0;
198 item.inventoryNextPermissions = 0; 203 item.inventoryNextPermissions = 0;
@@ -205,8 +210,8 @@ namespace OpenSim.Framework.Communications.Cache
205 item.assetID = new LLUUID("00000000-38f9-1111-024e-222222111120"); 210 item.assetID = new LLUUID("00000000-38f9-1111-024e-222222111120");
206 item.inventoryDescription = "Default Pants"; 211 item.inventoryDescription = "Default Pants";
207 item.inventoryName = "Default Pants"; 212 item.inventoryName = "Default Pants";
208 item.assetType = 5; 213 item.assetType = (int) AssetType.Clothing;
209 item.invType = 18; 214 item.invType = (int) InventoryType.Wearable;
210 item.parentFolderID = folderID; 215 item.parentFolderID = folderID;
211 item.inventoryCurrentPermissions = 0; 216 item.inventoryCurrentPermissions = 0;
212 item.inventoryNextPermissions = 0; 217 item.inventoryNextPermissions = 0;
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
index 74b2440..117ed36 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
@@ -74,7 +74,10 @@ namespace OpenSim.Framework.Communications.Cache
74 74
75 public CachedUserInfo GetUserDetails(LLUUID userID) 75 public CachedUserInfo GetUserDetails(LLUUID userID)
76 { 76 {
77 return m_userProfiles[userID]; 77 if (m_userProfiles.ContainsKey(userID))
78 return m_userProfiles[userID];
79 else
80 return null;
78 } 81 }
79 82
80 public void HandleCreateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort folderType, 83 public void HandleCreateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort folderType,
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index ada5ff0..23181bf 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -272,6 +272,9 @@ namespace OpenSim.Framework
272 public delegate void UpdateInventoryItemTransaction( 272 public delegate void UpdateInventoryItemTransaction(
273 IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID, LLUUID itemID); 273 IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID, LLUUID itemID);
274 274
275 public delegate void CopyInventoryItem(
276 IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, LLUUID newFolderID, string newName);
277
275 public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID); 278 public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID);
276 279
277 public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); 280 public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID);
@@ -344,6 +347,7 @@ namespace OpenSim.Framework
344 event FetchInventory OnFetchInventory; 347 event FetchInventory OnFetchInventory;
345 event RequestTaskInventory OnRequestTaskInventory; 348 event RequestTaskInventory OnRequestTaskInventory;
346 event UpdateInventoryItemTransaction OnUpdateInventoryItem; 349 event UpdateInventoryItemTransaction OnUpdateInventoryItem;
350 event CopyInventoryItem OnCopyInventoryItem;
347 event UDPAssetUploadRequest OnAssetUploadRequest; 351 event UDPAssetUploadRequest OnAssetUploadRequest;
348 event XferReceive OnXferReceive; 352 event XferReceive OnXferReceive;
349 event RequestXfer OnRequestXfer; 353 event RequestXfer OnRequestXfer;
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 65d57ad..70a99f0 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -96,6 +96,7 @@ namespace OpenSim.Region.ClientStack
96 public event FetchInventory OnFetchInventory; 96 public event FetchInventory OnFetchInventory;
97 public event RequestTaskInventory OnRequestTaskInventory; 97 public event RequestTaskInventory OnRequestTaskInventory;
98 public event UpdateInventoryItemTransaction OnUpdateInventoryItem; 98 public event UpdateInventoryItemTransaction OnUpdateInventoryItem;
99 public event CopyInventoryItem OnCopyInventoryItem;
99 public event UDPAssetUploadRequest OnAssetUploadRequest; 100 public event UDPAssetUploadRequest OnAssetUploadRequest;
100 public event XferReceive OnXferReceive; 101 public event XferReceive OnXferReceive;
101 public event RequestXfer OnRequestXfer; 102 public event RequestXfer OnRequestXfer;
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 4336eb4..507bd64 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -563,6 +563,16 @@ namespace OpenSim.Region.ClientStack
563 } 563 }
564 }*/ 564 }*/
565 break; 565 break;
566 case PacketType.CopyInventoryItem:
567 CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket) Pack;
568 if (OnCopyInventoryItem != null)
569 {
570 foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData)
571 {
572 OnCopyInventoryItem(this, datablock.CallbackID, datablock.OldAgentID, datablock.OldItemID, datablock.NewFolderID, Util.FieldToString(datablock.NewName));
573 }
574 }
575 break;
566 case PacketType.RequestTaskInventory: 576 case PacketType.RequestTaskInventory:
567 RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket) Pack; 577 RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket) Pack;
568 if (OnRequestTaskInventory != null) 578 if (OnRequestTaskInventory != null)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index b06fa2f..bc0ccb3 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -31,6 +31,7 @@ using libsecondlife;
31using libsecondlife.Packets; 31using libsecondlife.Packets;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.Communications.Cache; 33using OpenSim.Framework.Communications.Cache;
34using OpenSim.Framework.Console;
34using OpenSim.Region.Physics.Manager; 35using OpenSim.Region.Physics.Manager;
35 36
36namespace OpenSim.Region.Environment.Scenes 37namespace OpenSim.Region.Environment.Scenes
@@ -82,24 +83,18 @@ namespace OpenSim.Region.Environment.Scenes
82 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 83 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
83 if (item != null) 84 if (item != null)
84 { 85 {
85 AssetBase asset; 86 AssetBase asset = CreateAsset(item.inventoryName, item.inventoryDescription, (sbyte) item.invType, (sbyte) item.assetType, data);
86 asset = new AssetBase();
87 asset.FullID = LLUUID.Random();
88 asset.Type = (sbyte) item.assetType;
89 asset.InvType = (sbyte) item.invType;
90 asset.Name = item.inventoryName;
91 asset.Data = data;
92 AssetCache.AddAsset(asset); 87 AssetCache.AddAsset(asset);
93 88
94 item.assetID = asset.FullID; 89 item.assetID = asset.FullID;
95 userInfo.UpdateItem(remoteClient.AgentId, item); 90 userInfo.UpdateItem(remoteClient.AgentId, item);
96 91
97 // remoteClient.SendInventoryItemUpdate(item); 92 // remoteClient.SendInventoryItemUpdate(item);
98 if (item.invType == 7) 93 if ((InventoryType) item.invType == InventoryType.Notecard)
99 { 94 {
100 //do we want to know about updated note cards? 95 //do we want to know about updated note cards?
101 } 96 }
102 else if (item.invType == 10) 97 else if ((InventoryType) item.invType == InventoryType.LSL)
103 { 98 {
104 // do we want to know about updated scripts 99 // do we want to know about updated scripts
105 } 100 }
@@ -160,6 +155,75 @@ namespace OpenSim.Region.Environment.Scenes
160 } 155 }
161 } 156 }
162 157
158 public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, LLUUID newFolderID, string newName)
159 {
160 InventoryItemBase item = CommsManager.UserProfileCache.libraryRoot.HasItem(oldItemID);
161 if (item == null)
162 {
163 CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(oldAgentID);
164 if (userInfo == null)
165 {
166 MainLog.Instance.Warn("INVENTORY", "Failed to find user " + oldAgentID.ToString());
167 return;
168 }
169
170 item = userInfo.RootFolder.HasItem(oldItemID);
171 if (item == null)
172 {
173 MainLog.Instance.Warn("INVENTORY", "Failed to find item " + oldItemID.ToString());
174 return;
175 }
176 }
177
178 AssetBase asset = AssetCache.CopyAsset(item.assetID);
179 if (asset == null)
180 {
181 MainLog.Instance.Warn("INVENTORY", "Failed to find asset " + item.assetID.ToString());
182 return;
183 }
184
185 asset.Name = (newName.Length == 0) ? item.inventoryName : newName;
186
187 // TODO: preserve current permissions?
188 CreateNewInventoryItem(remoteClient, newFolderID, callbackID, asset, item.inventoryNextPermissions);
189 }
190
191 private AssetBase CreateAsset(string name, string description, sbyte invType, sbyte assetType, byte[] data)
192 {
193 AssetBase asset = new AssetBase();
194 asset.Name = name;
195 asset.Description = description;
196 asset.InvType = invType;
197 asset.Type = assetType;
198 asset.FullID = LLUUID.Random(); // TODO: check for conflicts
199 asset.Data = (data == null) ? new byte[1] : data;
200 return asset;
201 }
202
203 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
204 AssetBase asset, uint nextOwnerMask)
205 {
206 CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId);
207 if (userInfo != null)
208 {
209 InventoryItemBase item = new InventoryItemBase();
210 item.avatarID = remoteClient.AgentId;
211 item.creatorsID = remoteClient.AgentId;
212 item.inventoryID = LLUUID.Random();
213 item.assetID = asset.FullID;
214 item.inventoryDescription = asset.Description;
215 item.inventoryName = asset.Name;
216 item.assetType = asset.Type;
217 item.invType = asset.InvType;
218 item.parentFolderID = folderID;
219 item.inventoryCurrentPermissions = 2147483647;
220 item.inventoryNextPermissions = nextOwnerMask;
221
222 userInfo.AddItem(remoteClient.AgentId, item);
223 remoteClient.SendInventoryItemUpdate(item);
224 }
225 }
226
163 /// <summary> 227 /// <summary>
164 /// temporary method to test out creating new inventory items 228 /// temporary method to test out creating new inventory items
165 /// </summary> 229 /// </summary>
@@ -174,7 +238,7 @@ namespace OpenSim.Region.Environment.Scenes
174 /// <param name="wearableType"></param> 238 /// <param name="wearableType"></param>
175 /// <param name="nextOwnerMask"></param> 239 /// <param name="nextOwnerMask"></param>
176 public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, 240 public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID,
177 uint callbackID, string description, string name, sbyte invType, sbyte type, 241 uint callbackID, string description, string name, sbyte invType, sbyte assetType,
178 byte wearableType, uint nextOwnerMask) 242 byte wearableType, uint nextOwnerMask)
179 { 243 {
180 if (transActionID == LLUUID.Zero) 244 if (transActionID == LLUUID.Zero)
@@ -182,37 +246,17 @@ namespace OpenSim.Region.Environment.Scenes
182 CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); 246 CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId);
183 if (userInfo != null) 247 if (userInfo != null)
184 { 248 {
185 AssetBase asset = new AssetBase(); 249 AssetBase asset = CreateAsset(name, description, invType, assetType, null);
186 asset.Name = name;
187 asset.Description = description;
188 asset.InvType = invType;
189 asset.Type = type;
190 asset.FullID = LLUUID.Random();
191 asset.Data = new byte[1];
192 AssetCache.AddAsset(asset); 250 AssetCache.AddAsset(asset);
193 251
194 InventoryItemBase item = new InventoryItemBase(); 252 CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask);
195 item.avatarID = remoteClient.AgentId;
196 item.creatorsID = remoteClient.AgentId;
197 item.inventoryID = LLUUID.Random();
198 item.assetID = asset.FullID;
199 item.inventoryDescription = description;
200 item.inventoryName = name;
201 item.assetType = invType;
202 item.invType = invType;
203 item.parentFolderID = folderID;
204 item.inventoryCurrentPermissions = 2147483647;
205 item.inventoryNextPermissions = nextOwnerMask;
206
207 userInfo.AddItem(remoteClient.AgentId, item);
208 remoteClient.SendInventoryItemUpdate(item);
209 } 253 }
210 } 254 }
211 else 255 else
212 { 256 {
213 CommsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID, 257 CommsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID,
214 callbackID, description, name, invType, 258 callbackID, description, name, invType,
215 type, wearableType, nextOwnerMask); 259 assetType, wearableType, nextOwnerMask);
216 //System.Console.WriteLine("request to create inventory item from transaction " + transActionID); 260 //System.Console.WriteLine("request to create inventory item from transaction " + transActionID);
217 } 261 }
218 } 262 }
@@ -348,21 +392,18 @@ namespace OpenSim.Region.Environment.Scenes
348 CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); 392 CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId);
349 if (userInfo != null) 393 if (userInfo != null)
350 { 394 {
351 AssetBase asset = new AssetBase(); 395 AssetBase asset = CreateAsset(
352 asset.Name = ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId); 396 ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId),
353 asset.Description = 397 ((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId),
354 ((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId); 398 (sbyte) InventoryType.Object,
355 asset.InvType = 6; 399 (sbyte) AssetType.Object, // TODO: after libSL r1357, this becomes AssetType.Primitive
356 asset.Type = 6; 400 Helpers.StringToField(sceneObjectXml));
357 asset.FullID = LLUUID.Random();
358 asset.Data = Helpers.StringToField(sceneObjectXml);
359 AssetCache.AddAsset(asset); 401 AssetCache.AddAsset(asset);
360 402
361
362 InventoryItemBase item = new InventoryItemBase(); 403 InventoryItemBase item = new InventoryItemBase();
363 item.avatarID = remoteClient.AgentId; 404 item.avatarID = remoteClient.AgentId;
364 item.creatorsID = remoteClient.AgentId; 405 item.creatorsID = remoteClient.AgentId;
365 item.inventoryID = LLUUID.Random(); 406 item.inventoryID = LLUUID.Random(); // TODO: check for conflicts
366 item.assetID = asset.FullID; 407 item.assetID = asset.FullID;
367 item.inventoryDescription = asset.Description; 408 item.inventoryDescription = asset.Description;
368 item.inventoryName = asset.Name; 409 item.inventoryName = asset.Name;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 0b9d218..87bd0c1 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -789,6 +789,7 @@ namespace OpenSim.Region.Environment.Scenes
789 client.OnRequestTaskInventory += RequestTaskInventory; 789 client.OnRequestTaskInventory += RequestTaskInventory;
790 client.OnFetchInventory += CommsManager.UserProfileCache.HandleFetchInventory; 790 client.OnFetchInventory += CommsManager.UserProfileCache.HandleFetchInventory;
791 client.OnUpdateInventoryItem += UDPUpdateInventoryItemAsset; 791 client.OnUpdateInventoryItem += UDPUpdateInventoryItemAsset;
792 client.OnCopyInventoryItem += CopyInventoryItem;
792 client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest; 793 client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest;
793 client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer; 794 client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer;
794 client.OnRezScript += RezScript; 795 client.OnRezScript += RezScript;
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index e084266..f78dc8f 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -106,6 +106,7 @@ namespace SimpleApp
106 public event FetchInventory OnFetchInventory; 106 public event FetchInventory OnFetchInventory;
107 public event RequestTaskInventory OnRequestTaskInventory; 107 public event RequestTaskInventory OnRequestTaskInventory;
108 public event UpdateInventoryItemTransaction OnUpdateInventoryItem; 108 public event UpdateInventoryItemTransaction OnUpdateInventoryItem;
109 public event CopyInventoryItem OnCopyInventoryItem;
109 public event UDPAssetUploadRequest OnAssetUploadRequest; 110 public event UDPAssetUploadRequest OnAssetUploadRequest;
110 public event XferReceive OnXferReceive; 111 public event XferReceive OnXferReceive;
111 public event RequestXfer OnRequestXfer; 112 public event RequestXfer OnRequestXfer;