aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMW2007-08-16 16:31:32 +0000
committerMW2007-08-16 16:31:32 +0000
commit531f64a53bbd084dd8d0b33ae6c49821c74d718a (patch)
tree6e515f4d52a974b72a229f1fbc39253a7ba2a8a0 /OpenSim/Framework
parentI will get it right, honestly! (diff)
downloadopensim-SC_OLD-531f64a53bbd084dd8d0b33ae6c49821c74d718a.zip
opensim-SC_OLD-531f64a53bbd084dd8d0b33ae6c49821c74d718a.tar.gz
opensim-SC_OLD-531f64a53bbd084dd8d0b33ae6c49821c74d718a.tar.bz2
opensim-SC_OLD-531f64a53bbd084dd8d0b33ae6c49821c74d718a.tar.xz
Taking Prims (SceneObjectGroups) in and out of inventory should now work and if left in inventory will still be there after restarts. (as with the rest of inventory it will only fully work in standalone mode with account authentication turned on).
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs69
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs16
-rw-r--r--OpenSim/Framework/Communications/Cache/InventoryFolder.cs20
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs1
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs9
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs17
-rw-r--r--OpenSim/Framework/Data/InventoryData.cs6
-rw-r--r--OpenSim/Framework/General/Interfaces/IClientAPI.cs3
-rw-r--r--OpenSim/Framework/General/NullClientAPI.cs1
-rw-r--r--OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs8
10 files changed, 122 insertions, 28 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 3866e21..c08bef2 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -137,6 +137,16 @@ namespace OpenSim.Framework.Communications.Caches
137 return asset; 137 return asset;
138 } 138 }
139 139
140 public AssetBase GetAsset(LLUUID assetID, bool isTexture)
141 {
142 AssetBase asset = GetAsset(assetID);
143 if (asset == null)
144 {
145 this._assetServer.RequestAsset(assetID, isTexture);
146 }
147 return asset;
148 }
149
140 public void AddAsset(AssetBase asset) 150 public void AddAsset(AssetBase asset)
141 { 151 {
142 // Console.WriteLine("adding asset " + asset.FullID.ToStringHyphenated()); 152 // Console.WriteLine("adding asset " + asset.FullID.ToStringHyphenated());
@@ -241,44 +251,51 @@ namespace OpenSim.Framework.Communications.Caches
241 if (IsTexture) 251 if (IsTexture)
242 { 252 {
243 // Console.WriteLine("asset recieved from asset server"); 253 // Console.WriteLine("asset recieved from asset server");
254
244 TextureImage image = new TextureImage(asset); 255 TextureImage image = new TextureImage(asset);
245 this.Textures.Add(image.FullID, image); 256 if (!this.Textures.ContainsKey(image.FullID))
246 if (this.RequestedTextures.ContainsKey(image.FullID))
247 { 257 {
248 AssetRequest req = this.RequestedTextures[image.FullID]; 258 this.Textures.Add(image.FullID, image);
249 req.ImageInfo = image; 259 if (this.RequestedTextures.ContainsKey(image.FullID))
250 if (image.Data.LongLength > 600)
251 {
252 //over 600 bytes so split up file
253 req.NumPackets = 1 + (int)(image.Data.Length - 600 ) / 1000;
254 }
255 else
256 { 260 {
257 req.NumPackets = 1; 261 AssetRequest req = this.RequestedTextures[image.FullID];
262 req.ImageInfo = image;
263 if (image.Data.LongLength > 600)
264 {
265 //over 600 bytes so split up file
266 req.NumPackets = 1 + (int)(image.Data.Length - 600) / 1000;
267 }
268 else
269 {
270 req.NumPackets = 1;
271 }
272 this.RequestedTextures.Remove(image.FullID);
273 this.TextureRequests.Add(req);
258 } 274 }
259 this.RequestedTextures.Remove(image.FullID);
260 this.TextureRequests.Add(req);
261 } 275 }
262 } 276 }
263 else 277 else
264 { 278 {
265 AssetInfo assetInf = new AssetInfo(asset); 279 AssetInfo assetInf = new AssetInfo(asset);
266 this.Assets.Add(assetInf.FullID, assetInf); 280 if (!this.Assets.ContainsKey(assetInf.FullID))
267 if (this.RequestedAssets.ContainsKey(assetInf.FullID))
268 { 281 {
269 AssetRequest req = this.RequestedAssets[assetInf.FullID]; 282 this.Assets.Add(assetInf.FullID, assetInf);
270 req.AssetInf = assetInf; 283 if (this.RequestedAssets.ContainsKey(assetInf.FullID))
271 if (assetInf.Data.LongLength > 600)
272 {
273 //over 600 bytes so split up file
274 req.NumPackets = 1 + (int)(assetInf.Data.Length - 600 + 999) / 1000;
275 }
276 else
277 { 284 {
278 req.NumPackets = 1; 285 AssetRequest req = this.RequestedAssets[assetInf.FullID];
286 req.AssetInf = assetInf;
287 if (assetInf.Data.LongLength > 600)
288 {
289 //over 600 bytes so split up file
290 req.NumPackets = 1 + (int)(assetInf.Data.Length - 600 + 999) / 1000;
291 }
292 else
293 {
294 req.NumPackets = 1;
295 }
296 this.RequestedAssets.Remove(assetInf.FullID);
297 this.AssetRequests.Add(req);
279 } 298 }
280 this.RequestedAssets.Remove(assetInf.FullID);
281 this.AssetRequests.Add(req);
282 } 299 }
283 } 300 }
284 } 301 }
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 9970d80..ddb5658 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -105,13 +105,27 @@ namespace OpenSim.Framework.Communications.Caches
105 } 105 }
106 } 106 }
107 107
108 public void updateItem(LLUUID userID, InventoryItemBase itemInfo) 108 public void UpdateItem(LLUUID userID, InventoryItemBase itemInfo)
109 { 109 {
110 if ((userID == this.UserProfile.UUID) && (this.RootFolder != null)) 110 if ((userID == this.UserProfile.UUID) && (this.RootFolder != null))
111 { 111 {
112 this.m_parentCommsManager.InventoryServer.AddNewInventoryItem(userID, itemInfo); 112 this.m_parentCommsManager.InventoryServer.AddNewInventoryItem(userID, itemInfo);
113 } 113 }
114 } 114 }
115
116 public bool DeleteItem(LLUUID userID, InventoryItemBase item)
117 {
118 bool result = false;
119 if ((userID == this.UserProfile.UUID) && (this.RootFolder != null))
120 {
121 result = RootFolder.DeleteItem(item.inventoryID);
122 if (result)
123 {
124 this.m_parentCommsManager.InventoryServer.DeleteInventoryItem(userID, item);
125 }
126 }
127 return result;
128 }
115 } 129 }
116 130
117 131
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolder.cs b/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
index 6b0e2b4..34f83db 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
@@ -90,6 +90,26 @@ namespace OpenSim.Framework.Communications.Caches
90 return base2; 90 return base2;
91 } 91 }
92 92
93 public bool DeleteItem(LLUUID itemID)
94 {
95 bool found = false;
96 if (this.Items.ContainsKey(itemID))
97 {
98 Items.Remove(itemID);
99 return true;
100 }
101 foreach (InventoryFolder folder in this.SubFolders.Values)
102 {
103 found = folder.DeleteItem(itemID);
104 if (found == true)
105 {
106 break;
107 }
108 }
109 return found;
110 }
111
112
93 public InventoryFolder HasSubFolder(LLUUID folderID) 113 public InventoryFolder HasSubFolder(LLUUID folderID)
94 { 114 {
95 InventoryFolder returnFolder = null; 115 InventoryFolder returnFolder = null;
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index 6f01cf2..bd58756 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -16,5 +16,6 @@ namespace OpenSim.Framework.Communications
16 void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); 16 void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
17 void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder); 17 void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder);
18 void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); 18 void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
19 void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
19 } 20 }
20} 21}
diff --git a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
index d8bfc4d..b02aa93 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
@@ -320,6 +320,15 @@ namespace OpenSim.Framework.Data.MySQL
320 } 320 }
321 321
322 /// <summary> 322 /// <summary>
323 ///
324 /// </summary>
325 /// <param name="item"></param>
326 public void deleteInventoryItem(InventoryItemBase item)
327 {
328
329 }
330
331 /// <summary>
323 /// Creates a new inventory folder 332 /// Creates a new inventory folder
324 /// </summary> 333 /// </summary>
325 /// <param name="folder">Folder to create</param> 334 /// <param name="folder">Folder to create</param>
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs
index 045fbee..fe494fb 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs
@@ -447,6 +447,23 @@ namespace OpenSim.Framework.Data.SQLite
447 } 447 }
448 448
449 /// <summary> 449 /// <summary>
450 ///
451 /// </summary>
452 /// <param name="item"></param>
453 public void deleteInventoryItem(InventoryItemBase item)
454 {
455 DataTable inventoryItemTable = ds.Tables["inventoryitems"];
456
457 DataRow inventoryRow = inventoryItemTable.Rows.Find(item.inventoryID);
458 if (inventoryRow != null)
459 {
460 inventoryRow.Delete();
461 }
462
463 this.invItemsDa.Update(ds, "inventoryitems");
464 }
465
466 /// <summary>
450 /// Adds a new folder specified by folder 467 /// Adds a new folder specified by folder
451 /// </summary> 468 /// </summary>
452 /// <param name="folder">The inventory folder</param> 469 /// <param name="folder">The inventory folder</param>
diff --git a/OpenSim/Framework/Data/InventoryData.cs b/OpenSim/Framework/Data/InventoryData.cs
index a12b87b..38c251c 100644
--- a/OpenSim/Framework/Data/InventoryData.cs
+++ b/OpenSim/Framework/Data/InventoryData.cs
@@ -202,6 +202,12 @@ namespace OpenSim.Framework.Data
202 void updateInventoryItem(InventoryItemBase item); 202 void updateInventoryItem(InventoryItemBase item);
203 203
204 /// <summary> 204 /// <summary>
205 ///
206 /// </summary>
207 /// <param name="item"></param>
208 void deleteInventoryItem(InventoryItemBase item);
209
210 /// <summary>
205 /// Adds a new folder specified by folder 211 /// Adds a new folder specified by folder
206 /// </summary> 212 /// </summary>
207 /// <param name="folder">The inventory folder</param> 213 /// <param name="folder">The inventory folder</param>
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
index f39d0c7..8db1e15 100644
--- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs
+++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Framework.Interfaces
36{ 36{
37 public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); 37 public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
38 public delegate void ImprovedInstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message); // Cut down from full list 38 public delegate void ImprovedInstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message); // Cut down from full list
39 public delegate void RezObject(AssetBase primAsset, LLVector3 pos); 39 public delegate void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos);
40 public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west, IClientAPI remoteClient); 40 public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west, IClientAPI remoteClient);
41 public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); 41 public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam);
42 public delegate void StartAnim(LLUUID animID, int seq); 42 public delegate void StartAnim(LLUUID animID, int seq);
@@ -210,6 +210,7 @@ namespace OpenSim.Framework.Interfaces
210 void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items); 210 void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items);
211 void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item); 211 void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item);
212 void SendInventoryItemUpdate(InventoryItemBase Item); 212 void SendInventoryItemUpdate(InventoryItemBase Item);
213 void SendRemoveInventoryItem(LLUUID itemID);
213 void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName); 214 void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName);
214 215
215 void SendNameReply(LLUUID profileId, string firstname, string lastname); 216 void SendNameReply(LLUUID profileId, string firstname, string lastname);
diff --git a/OpenSim/Framework/General/NullClientAPI.cs b/OpenSim/Framework/General/NullClientAPI.cs
index e85b88f..6be2563 100644
--- a/OpenSim/Framework/General/NullClientAPI.cs
+++ b/OpenSim/Framework/General/NullClientAPI.cs
@@ -138,6 +138,7 @@ namespace OpenSim.Framework
138 public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items){} 138 public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items){}
139 public virtual void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item){} 139 public virtual void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item){}
140 public virtual void SendInventoryItemUpdate(InventoryItemBase Item) { } 140 public virtual void SendInventoryItemUpdate(InventoryItemBase Item) { }
141 public virtual void SendRemoveInventoryItem(LLUUID itemID) { }
141 public virtual void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) { } 142 public virtual void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) { }
142 143
143 public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname){} 144 public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname){}
diff --git a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs b/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs
index bc55d05..20d3a77 100644
--- a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs
+++ b/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs
@@ -124,6 +124,14 @@ namespace OpenSim.Framework.InventoryServiceBase
124 } 124 }
125 } 125 }
126 126
127 public void deleteItem(InventoryItemBase item)
128 {
129 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
130 {
131 plugin.Value.deleteInventoryItem(item);
132 }
133 }
134
127 /// <summary> 135 /// <summary>
128 /// 136 ///
129 /// </summary> 137 /// </summary>