aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs49
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetServer.cs6
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetServerBase.cs10
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs2
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetTransactions.cs6
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs2
-rw-r--r--OpenSim/Framework/Communications/Cache/GridAssetClient.cs15
-rw-r--r--OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs4
-rw-r--r--OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs37
-rw-r--r--OpenSim/Framework/Communications/Cache/SQLAssetServer.cs8
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs37
11 files changed, 93 insertions, 83 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 4765548..664625e 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -28,7 +28,6 @@
28 28
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.IO;
32using System.Threading; 31using System.Threading;
33using libsecondlife; 32using libsecondlife;
34using libsecondlife.Packets; 33using libsecondlife.Packets;
@@ -92,7 +91,7 @@ namespace OpenSim.Framework.Communications.Cache
92 Thread.Sleep(500); 91 Thread.Sleep(500);
93 } 92 }
94 catch (Exception e) 93 catch (Exception e)
95 { 94 {
96 m_log.Error("ASSETCACHE", e.ToString()); 95 m_log.Error("ASSETCACHE", e.ToString());
97 } 96 }
98 } 97 }
@@ -177,30 +176,29 @@ namespace OpenSim.Framework.Communications.Cache
177 // packets from the client. 176 // packets from the client.
178 int pollPeriod = 200; 177 int pollPeriod = 200;
179 int maxPolls = 15; 178 int maxPolls = 15;
180 179
181 AssetBase asset = GetCachedAsset(assetID); 180 AssetBase asset = GetCachedAsset(assetID);
182 if (asset != null) 181 if (asset != null)
183 { 182 {
184 return asset; 183 return asset;
185 } 184 }
186 185
187 m_assetServer.RequestAsset(assetID, isTexture); 186 m_assetServer.RequestAsset(assetID, isTexture);
188 187
189 do 188 do
190 { 189 {
191 Thread.Sleep(pollPeriod); 190 Thread.Sleep(pollPeriod);
192 191
193 asset = GetCachedAsset(assetID); 192 asset = GetCachedAsset(assetID);
194 if (asset != null) 193 if (asset != null)
195 { 194 {
196 return asset; 195 return asset;
197 } 196 }
198 } 197 } while (--maxPolls > 0);
199 while (--maxPolls > 0); 198
200
201 MainLog.Instance.Warn( 199 MainLog.Instance.Warn(
202 "ASSETCACHE", "Asset {0} was not received before the retrieval timeout was reached"); 200 "ASSETCACHE", "Asset {0} was not received before the retrieval timeout was reached");
203 201
204 return null; 202 return null;
205 } 203 }
206 204
@@ -368,12 +366,13 @@ namespace OpenSim.Framework.Communications.Cache
368 { 366 {
369 // over max number of bytes so split up file 367 // over max number of bytes so split up file
370 long restData = data.LongLength - m_maxPacketSize; 368 long restData = data.LongLength - m_maxPacketSize;
371 int restPackets = (int) ((restData + m_maxPacketSize - 1) / m_maxPacketSize); 369 int restPackets = (int) ((restData + m_maxPacketSize - 1)/m_maxPacketSize);
372 numPackets += restPackets; 370 numPackets += restPackets;
373 } 371 }
374 372
375 return numPackets; 373 return numPackets;
376 } 374 }
375
377 #region Assets 376 #region Assets
378 377
379 /// <summary> 378 /// <summary>
@@ -448,7 +447,7 @@ namespace OpenSim.Framework.Communications.Cache
448 AssetRequest req; 447 AssetRequest req;
449 for (int i = 0; i < num; i++) 448 for (int i = 0; i < num; i++)
450 { 449 {
451 req = (AssetRequest)AssetRequests[i]; 450 req = (AssetRequest) AssetRequests[i];
452 //Console.WriteLine("sending asset " + req.RequestAssetID); 451 //Console.WriteLine("sending asset " + req.RequestAssetID);
453 TransferInfoPacket Transfer = new TransferInfoPacket(); 452 TransferInfoPacket Transfer = new TransferInfoPacket();
454 Transfer.TransferInfo.ChannelType = 2; 453 Transfer.TransferInfo.ChannelType = 2;
@@ -458,7 +457,7 @@ namespace OpenSim.Framework.Communications.Cache
458 { 457 {
459 Transfer.TransferInfo.Params = new byte[20]; 458 Transfer.TransferInfo.Params = new byte[20];
460 Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); 459 Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
461 int assType = (int)req.AssetInf.Type; 460 int assType = (int) req.AssetInf.Type;
462 Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4); 461 Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
463 } 462 }
464 else if (req.AssetRequestSource == 3) 463 else if (req.AssetRequestSource == 3)
@@ -468,7 +467,7 @@ namespace OpenSim.Framework.Communications.Cache
468 //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); 467 //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
469 //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16); 468 //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16);
470 } 469 }
471 Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length; 470 Transfer.TransferInfo.Size = (int) req.AssetInf.Data.Length;
472 Transfer.TransferInfo.TransferID = req.TransferRequestID; 471 Transfer.TransferInfo.TransferID = req.TransferRequestID;
473 req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset); 472 req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset);
474 473
@@ -488,20 +487,20 @@ namespace OpenSim.Framework.Communications.Cache
488 // libsecondlife hardcodes 1500 as the maximum data chunk size 487 // libsecondlife hardcodes 1500 as the maximum data chunk size
489 int maxChunkSize = 1500; 488 int maxChunkSize = 1500;
490 int packetNumber = 0; 489 int packetNumber = 0;
491 490
492 while (processedLength < req.AssetInf.Data.Length) 491 while (processedLength < req.AssetInf.Data.Length)
493 { 492 {
494 TransferPacketPacket TransferPacket = new TransferPacketPacket(); 493 TransferPacketPacket TransferPacket = new TransferPacketPacket();
495 TransferPacket.TransferData.Packet = packetNumber; 494 TransferPacket.TransferData.Packet = packetNumber;
496 TransferPacket.TransferData.ChannelType = 2; 495 TransferPacket.TransferData.ChannelType = 2;
497 TransferPacket.TransferData.TransferID = req.TransferRequestID; 496 TransferPacket.TransferData.TransferID = req.TransferRequestID;
498 497
499 int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize); 498 int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
500 byte[] chunk = new byte[chunkSize]; 499 byte[] chunk = new byte[chunkSize];
501 Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length); 500 Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
502 501
503 TransferPacket.TransferData.Data = chunk; 502 TransferPacket.TransferData.Data = chunk;
504 503
505 // 0 indicates more packets to come, 1 indicates last packet 504 // 0 indicates more packets to come, 1 indicates last packet
506 if (req.AssetInf.Data.Length - processedLength > maxChunkSize) 505 if (req.AssetInf.Data.Length - processedLength > maxChunkSize)
507 { 506 {
@@ -510,10 +509,10 @@ namespace OpenSim.Framework.Communications.Cache
510 else 509 else
511 { 510 {
512 TransferPacket.TransferData.Status = 1; 511 TransferPacket.TransferData.Status = 1;
513 } 512 }
514 513
515 req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset); 514 req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
516 515
517 processedLength += chunkSize; 516 processedLength += chunkSize;
518 packetNumber++; 517 packetNumber++;
519 } 518 }
@@ -609,4 +608,4 @@ namespace OpenSim.Framework.Communications.Cache
609 } 608 }
610 } 609 }
611 } 610 }
612} 611} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/AssetServer.cs b/OpenSim/Framework/Communications/Cache/AssetServer.cs
index ae6494f..692ee1e 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServer.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServer.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Framework.Communications.Cache
80 IObjectSet result = db.Query(new AssetUUIDQuery(req.AssetID)); 80 IObjectSet result = db.Query(new AssetUUIDQuery(req.AssetID));
81 if (result.Count > 0) 81 if (result.Count > 0)
82 { 82 {
83 foundAsset = (AssetStorage)result.Next(); 83 foundAsset = (AssetStorage) result.Next();
84 found = true; 84 found = true;
85 } 85 }
86 86
@@ -93,7 +93,7 @@ namespace OpenSim.Framework.Communications.Cache
93 asset.Name = foundAsset.Name; 93 asset.Name = foundAsset.Name;
94 idata = foundAsset.Data; 94 idata = foundAsset.Data;
95 asset.Data = idata; 95 asset.Data = idata;
96 96
97 return asset; 97 return asset;
98 } 98 }
99 else 99 else
@@ -141,4 +141,4 @@ namespace OpenSim.Framework.Communications.Cache
141 return (asset.UUID == _findID); 141 return (asset.UUID == _findID);
142 } 142 }
143 } 143 }
144} 144} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
index 43d3dd9..1b2c836 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Framework.Communications.Cache
69 { 69 {
70 MainLog.Instance.Verbose( 70 MainLog.Instance.Verbose(
71 "ASSET", "Asset {0} received from asset server", req.AssetID); 71 "ASSET", "Asset {0} received from asset server", req.AssetID);
72 72
73 _receiver.AssetReceived(asset, req.IsTexture); 73 _receiver.AssetReceived(asset, req.IsTexture);
74 } 74 }
75 else 75 else
@@ -112,9 +112,9 @@ namespace OpenSim.Framework.Communications.Cache
112 112
113 ProcessRequest(req); 113 ProcessRequest(req);
114 } 114 }
115 catch(Exception e) 115 catch (Exception e)
116 { 116 {
117 MainLog.Instance.Error("ASSETSERVER", e.Message ); 117 MainLog.Instance.Error("ASSETSERVER", e.Message);
118 } 118 }
119 } 119 }
120 } 120 }
@@ -149,7 +149,7 @@ namespace OpenSim.Framework.Communications.Cache
149 req.AssetID = assetID; 149 req.AssetID = assetID;
150 req.IsTexture = isTexture; 150 req.IsTexture = isTexture;
151 _assetRequests.Enqueue(req); 151 _assetRequests.Enqueue(req);
152 152
153 MainLog.Instance.Verbose("ASSET", "Added {0} to request queue", assetID); 153 MainLog.Instance.Verbose("ASSET", "Added {0} to request queue", assetID);
154 } 154 }
155 155
@@ -253,4 +253,4 @@ namespace OpenSim.Framework.Communications.Cache
253 assets.ForEach(action); 253 assets.ForEach(action);
254 } 254 }
255 } 255 }
256} 256} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
index 7de84fa..c9c9541 100644
--- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
@@ -106,4 +106,4 @@ namespace OpenSim.Framework.Communications.Cache
106 } 106 }
107 } 107 }
108 } 108 }
109} 109} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
index 57c1fa6..8aa567c 100644
--- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
@@ -182,7 +182,7 @@ namespace OpenSim.Framework.Communications.Cache
182 Asset.Description = "empty"; 182 Asset.Description = "empty";
183 Asset.Local = storeLocal; 183 Asset.Local = storeLocal;
184 Asset.Temporary = tempFile; 184 Asset.Temporary = tempFile;
185 185
186 TransactionID = transaction; 186 TransactionID = transaction;
187 m_storeLocal = storeLocal; 187 m_storeLocal = storeLocal;
188 if (Asset.Data.Length > 2) 188 if (Asset.Data.Length > 2)
@@ -312,6 +312,7 @@ namespace OpenSim.Framework.Communications.Cache
312 } 312 }
313 313
314 #region Nested Classes currently not in use (waiting for them to be enabled) 314 #region Nested Classes currently not in use (waiting for them to be enabled)
315
315 public class AssetCapsUploader 316 public class AssetCapsUploader
316 { 317 {
317 // Fields 318 // Fields
@@ -424,6 +425,7 @@ namespace OpenSim.Framework.Communications.Cache
424 return text; 425 return text;
425 } 426 }
426 } 427 }
428
427 #endregion 429 #endregion
428 } 430 }
429} 431} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index a547c8a..1cf95b7 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -130,4 +130,4 @@ namespace OpenSim.Framework.Communications.Cache
130 return result; 130 return result;
131 } 131 }
132 } 132 }
133} 133} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
index 9c460c7..cf54fa4 100644
--- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
@@ -27,10 +27,8 @@
27*/ 27*/
28 28
29using System; 29using System;
30using System.Collections.Generic;
31using System.IO; 30using System.IO;
32using System.Xml.Serialization; 31using System.Xml.Serialization;
33using libsecondlife;
34using OpenSim.Framework.Console; 32using OpenSim.Framework.Console;
35using OpenSim.Framework.Servers; 33using OpenSim.Framework.Servers;
36 34
@@ -65,9 +63,9 @@ namespace OpenSim.Framework.Communications.Cache
65 63
66 if (s.Length > 0) 64 if (s.Length > 0)
67 { 65 {
68 XmlSerializer xs = new XmlSerializer(typeof(AssetBase)); 66 XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
69 67
70 return (AssetBase)xs.Deserialize(s); 68 return (AssetBase) xs.Deserialize(s);
71 } 69 }
72 } 70 }
73 catch (Exception e) 71 catch (Exception e)
@@ -76,12 +74,11 @@ namespace OpenSim.Framework.Communications.Cache
76 MainLog.Instance.Debug("ASSETCACHE", "Getting asset {0}", req.AssetID.ToString()); 74 MainLog.Instance.Debug("ASSETCACHE", "Getting asset {0}", req.AssetID.ToString());
77 MainLog.Instance.Error("ASSETCACHE", e.StackTrace); 75 MainLog.Instance.Error("ASSETCACHE", e.StackTrace);
78 } 76 }
79 77
80 return null; 78 return null;
81 } 79 }
82 80
83 81
84
85 public override void UpdateAsset(AssetBase asset) 82 public override void UpdateAsset(AssetBase asset)
86 { 83 {
87 throw new Exception("The method or operation is not implemented."); 84 throw new Exception("The method or operation is not implemented.");
@@ -119,8 +116,6 @@ namespace OpenSim.Framework.Communications.Cache
119 throw new Exception("The method or operation is not implemented."); 116 throw new Exception("The method or operation is not implemented.");
120 } 117 }
121 118
122
123
124 #endregion 119 #endregion
125 } 120 }
126} 121} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
index 1d2c920..a1e79b2 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Framework.Communications.Cache
65 InventoryFolderImpl subFold = new InventoryFolderImpl(); 65 InventoryFolderImpl subFold = new InventoryFolderImpl();
66 subFold.name = folderName; 66 subFold.name = folderName;
67 subFold.folderID = folderID; 67 subFold.folderID = folderID;
68 subFold.type = (short)type; 68 subFold.type = (short) type;
69 subFold.parentID = this.folderID; 69 subFold.parentID = this.folderID;
70 subFold.agentID = agentID; 70 subFold.agentID = agentID;
71 SubFolders.Add(subFold.folderID, subFold); 71 SubFolders.Add(subFold.folderID, subFold);
@@ -153,4 +153,4 @@ namespace OpenSim.Framework.Communications.Cache
153 return folderList; 153 return folderList;
154 } 154 }
155 } 155 }
156} 156} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
index 4c8eddf..fd93b19 100644
--- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
@@ -49,8 +49,8 @@ namespace OpenSim.Framework.Communications.Cache
49 folderID = new LLUUID("00000112-000f-0000-0000-000100bba000"); 49 folderID = new LLUUID("00000112-000f-0000-0000-000100bba000");
50 name = "OpenSim Library"; 50 name = "OpenSim Library";
51 parentID = LLUUID.Zero; 51 parentID = LLUUID.Zero;
52 type = (short)-1; 52 type = (short) -1;
53 version = (ushort)1; 53 version = (ushort) 1;
54 54
55 InventoryFolderImpl folderInfo = new InventoryFolderImpl(); 55 InventoryFolderImpl folderInfo = new InventoryFolderImpl();
56 folderInfo.agentID = libOwner; 56 folderInfo.agentID = libOwner;
@@ -81,28 +81,41 @@ namespace OpenSim.Framework.Communications.Cache
81 81
82 private void CreateLibraryItems() 82 private void CreateLibraryItems()
83 { 83 {
84 InventoryItemBase item = CreateItem(new LLUUID("66c41e39-38f9-f75a-024e-585989bfaba9"), new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"), "Default Shape", "Default Shape", (int)AssetType.Bodypart, (int)InventoryType.Wearable, folderID); 84 InventoryItemBase item =
85 CreateItem(new LLUUID("66c41e39-38f9-f75a-024e-585989bfaba9"),
86 new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"), "Default Shape", "Default Shape",
87 (int) AssetType.Bodypart, (int) InventoryType.Wearable, folderID);
85 item.inventoryCurrentPermissions = 0; 88 item.inventoryCurrentPermissions = 0;
86 item.inventoryNextPermissions = 0; 89 item.inventoryNextPermissions = 0;
87 Items.Add(item.inventoryID, item); 90 Items.Add(item.inventoryID, item);
88 91
89 item = CreateItem(new LLUUID("77c41e39-38f9-f75a-024e-585989bfabc9"), new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb"), "Default Skin", "Default Skin", (int)AssetType.Bodypart, (int)InventoryType.Wearable, folderID); 92 item =
93 CreateItem(new LLUUID("77c41e39-38f9-f75a-024e-585989bfabc9"),
94 new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb"), "Default Skin", "Default Skin",
95 (int) AssetType.Bodypart, (int) InventoryType.Wearable, folderID);
90 item.inventoryCurrentPermissions = 0; 96 item.inventoryCurrentPermissions = 0;
91 item.inventoryNextPermissions = 0; 97 item.inventoryNextPermissions = 0;
92 Items.Add(item.inventoryID, item); 98 Items.Add(item.inventoryID, item);
93 99
94 item = CreateItem(new LLUUID("77c41e39-38f9-f75a-0000-585989bf0000"), new LLUUID("00000000-38f9-1111-024e-222222111110"), "Default Shirt", "Default Shirt", (int)AssetType.Clothing, (int)InventoryType.Wearable, folderID); 100 item =
101 CreateItem(new LLUUID("77c41e39-38f9-f75a-0000-585989bf0000"),
102 new LLUUID("00000000-38f9-1111-024e-222222111110"), "Default Shirt", "Default Shirt",
103 (int) AssetType.Clothing, (int) InventoryType.Wearable, folderID);
95 item.inventoryCurrentPermissions = 0; 104 item.inventoryCurrentPermissions = 0;
96 item.inventoryNextPermissions = 0; 105 item.inventoryNextPermissions = 0;
97 Items.Add(item.inventoryID, item); 106 Items.Add(item.inventoryID, item);
98 107
99 item = CreateItem(new LLUUID("77c41e39-38f9-f75a-0000-5859892f1111"), new LLUUID("00000000-38f9-1111-024e-222222111120"), "Default Pants", "Default Pants", (int)AssetType.Clothing, (int)InventoryType.Wearable, folderID); 108 item =
109 CreateItem(new LLUUID("77c41e39-38f9-f75a-0000-5859892f1111"),
110 new LLUUID("00000000-38f9-1111-024e-222222111120"), "Default Pants", "Default Pants",
111 (int) AssetType.Clothing, (int) InventoryType.Wearable, folderID);
100 item.inventoryCurrentPermissions = 0; 112 item.inventoryCurrentPermissions = 0;
101 item.inventoryNextPermissions = 0; 113 item.inventoryNextPermissions = 0;
102 Items.Add(item.inventoryID, item); 114 Items.Add(item.inventoryID, item);
103 } 115 }
104 116
105 public InventoryItemBase CreateItem(LLUUID inventoryID, LLUUID assetID, string name, string description, int assetType, int invType, LLUUID parentFolderID) 117 public InventoryItemBase CreateItem(LLUUID inventoryID, LLUUID assetID, string name, string description,
118 int assetType, int invType, LLUUID parentFolderID)
106 { 119 {
107 InventoryItemBase item = new InventoryItemBase(); 120 InventoryItemBase item = new InventoryItemBase();
108 item.avatarID = libOwner; 121 item.avatarID = libOwner;
@@ -135,10 +148,10 @@ namespace OpenSim.Framework.Communications.Cache
135 item.inventoryName = source.Configs[i].GetString("name", ""); 148 item.inventoryName = source.Configs[i].GetString("name", "");
136 item.assetType = source.Configs[i].GetInt("assetType", 0); 149 item.assetType = source.Configs[i].GetInt("assetType", 0);
137 item.invType = source.Configs[i].GetInt("inventoryType", 0); 150 item.invType = source.Configs[i].GetInt("inventoryType", 0);
138 item.inventoryCurrentPermissions = (uint)source.Configs[i].GetLong("currentPermissions", 0x7FFFFFFF); 151 item.inventoryCurrentPermissions = (uint) source.Configs[i].GetLong("currentPermissions", 0x7FFFFFFF);
139 item.inventoryNextPermissions = (uint)source.Configs[i].GetLong("nextPermissions", 0x7FFFFFFF); 152 item.inventoryNextPermissions = (uint) source.Configs[i].GetLong("nextPermissions", 0x7FFFFFFF);
140 item.inventoryEveryOnePermissions = (uint)source.Configs[i].GetLong("everyonePermissions", 0x7FFFFFFF); 153 item.inventoryEveryOnePermissions = (uint) source.Configs[i].GetLong("everyonePermissions", 0x7FFFFFFF);
141 item.inventoryBasePermissions = (uint)source.Configs[i].GetLong("basePermissions", 0x7FFFFFFF); 154 item.inventoryBasePermissions = (uint) source.Configs[i].GetLong("basePermissions", 0x7FFFFFFF);
142 if (item.assetType == 0) 155 if (item.assetType == 0)
143 { 156 {
144 item.parentFolderID = m_textureFolder.folderID; 157 item.parentFolderID = m_textureFolder.folderID;
@@ -152,4 +165,4 @@ namespace OpenSim.Framework.Communications.Cache
152 } 165 }
153 } 166 }
154 } 167 }
155} 168} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs
index 7fcff10..e4c278f 100644
--- a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs
+++ b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Framework.Communications.Cache
57 if (typeInterface != null) 57 if (typeInterface != null)
58 { 58 {
59 IAssetProvider plug = 59 IAssetProvider plug =
60 (IAssetProvider)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); 60 (IAssetProvider) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
61 m_assetProviderPlugin = plug; 61 m_assetProviderPlugin = plug;
62 m_assetProviderPlugin.Initialise(); 62 m_assetProviderPlugin.Initialise();
63 63
@@ -84,8 +84,8 @@ namespace OpenSim.Framework.Communications.Cache
84 { 84 {
85 asset = m_assetProviderPlugin.FetchAsset(req.AssetID); 85 asset = m_assetProviderPlugin.FetchAsset(req.AssetID);
86 } 86 }
87 87
88 return asset; 88 return asset;
89 } 89 }
90 90
91 protected override void StoreAsset(AssetBase asset) 91 protected override void StoreAsset(AssetBase asset)
@@ -98,4 +98,4 @@ namespace OpenSim.Framework.Communications.Cache
98 m_assetProviderPlugin.CommitAssets(); 98 m_assetProviderPlugin.CommitAssets();
99 } 99 }
100 } 100 }
101} 101} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 47f970e..14670fd 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -130,7 +130,8 @@ namespace OpenSim.Framework.Communications.Cache
130 } 130 }
131 } 131 }
132 132
133 public void HandleUpdateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort type, string name, LLUUID parentID) 133 public void HandleUpdateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort type, string name,
134 LLUUID parentID)
134 { 135 {
135 CachedUserInfo userProfile; 136 CachedUserInfo userProfile;
136 137
@@ -143,7 +144,7 @@ namespace OpenSim.Framework.Communications.Cache
143 baseFolder.folderID = folderID; 144 baseFolder.folderID = folderID;
144 baseFolder.name = name; 145 baseFolder.name = name;
145 baseFolder.parentID = parentID; 146 baseFolder.parentID = parentID;
146 baseFolder.type = (short)type; 147 baseFolder.type = (short) type;
147 baseFolder.version = userProfile.RootFolder.version; 148 baseFolder.version = userProfile.RootFolder.version;
148 m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, baseFolder); 149 m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, baseFolder);
149 } 150 }
@@ -180,12 +181,12 @@ namespace OpenSim.Framework.Communications.Cache
180 bool fetchFolders, bool fetchItems, int sortOrder) 181 bool fetchFolders, bool fetchItems, int sortOrder)
181 { 182 {
182 // XXX We're not handling sortOrder yet! 183 // XXX We're not handling sortOrder yet!
183 184
184 InventoryFolderImpl fold = null; 185 InventoryFolderImpl fold = null;
185 if (folderID == libraryRoot.folderID) 186 if (folderID == libraryRoot.folderID)
186 { 187 {
187 remoteClient.SendInventoryFolderDetails( 188 remoteClient.SendInventoryFolderDetails(
188 libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems(), 189 libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems(),
189 libraryRoot.RequestListOfFolders(), fetchFolders, fetchItems); 190 libraryRoot.RequestListOfFolders(), fetchFolders, fetchItems);
190 191
191 return; 192 return;
@@ -194,7 +195,7 @@ namespace OpenSim.Framework.Communications.Cache
194 if ((fold = libraryRoot.HasSubFolder(folderID)) != null) 195 if ((fold = libraryRoot.HasSubFolder(folderID)) != null)
195 { 196 {
196 remoteClient.SendInventoryFolderDetails( 197 remoteClient.SendInventoryFolderDetails(
197 libraryRoot.agentID, folderID, fold.RequestListOfItems(), 198 libraryRoot.agentID, folderID, fold.RequestListOfItems(),
198 fold.RequestListOfFolders(), fetchFolders, fetchItems); 199 fold.RequestListOfFolders(), fetchFolders, fetchItems);
199 200
200 return; 201 return;
@@ -209,9 +210,9 @@ namespace OpenSim.Framework.Communications.Cache
209 { 210 {
210 remoteClient.SendInventoryFolderDetails( 211 remoteClient.SendInventoryFolderDetails(
211 remoteClient.AgentId, folderID, userProfile.RootFolder.RequestListOfItems(), 212 remoteClient.AgentId, folderID, userProfile.RootFolder.RequestListOfItems(),
212 userProfile.RootFolder.RequestListOfFolders(), 213 userProfile.RootFolder.RequestListOfFolders(),
213 fetchFolders, fetchItems); 214 fetchFolders, fetchItems);
214 215
215 return; 216 return;
216 } 217 }
217 else 218 else
@@ -219,9 +220,9 @@ namespace OpenSim.Framework.Communications.Cache
219 if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) 220 if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null)
220 { 221 {
221 remoteClient.SendInventoryFolderDetails( 222 remoteClient.SendInventoryFolderDetails(
222 remoteClient.AgentId, folderID, fold.RequestListOfItems(), 223 remoteClient.AgentId, folderID, fold.RequestListOfItems(),
223 fold.RequestListOfFolders(), fetchFolders, fetchItems); 224 fold.RequestListOfFolders(), fetchFolders, fetchItems);
224 225
225 return; 226 return;
226 } 227 }
227 } 228 }
@@ -230,20 +231,20 @@ namespace OpenSim.Framework.Communications.Cache
230 { 231 {
231 MainLog.Instance.Error( 232 MainLog.Instance.Error(
232 "INVENTORYCACHE", "Could not find root folder for user {0}", remoteClient.Name); 233 "INVENTORYCACHE", "Could not find root folder for user {0}", remoteClient.Name);
233 234
234 return; 235 return;
235 } 236 }
236 } 237 }
237 else 238 else
238 { 239 {
239 MainLog.Instance.Error( 240 MainLog.Instance.Error(
240 "INVENTORYCACHE", 241 "INVENTORYCACHE",
241 "Could not find user profile for {0} for folder {1}", 242 "Could not find user profile for {0} for folder {1}",
242 remoteClient.Name, folderID); 243 remoteClient.Name, folderID);
243 244
244 return; 245 return;
245 } 246 }
246 247
247 // If we've reached this point then we couldn't find the folder, even though the client thinks 248 // If we've reached this point then we couldn't find the folder, even though the client thinks
248 // it exists 249 // it exists
249 MainLog.Instance.Error( 250 MainLog.Instance.Error(
@@ -262,8 +263,8 @@ namespace OpenSim.Framework.Communications.Cache
262 InventoryFolderImpl subFolder = userProfile.RootFolder.HasSubFolder(folderID); 263 InventoryFolderImpl subFolder = userProfile.RootFolder.HasSubFolder(folderID);
263 if (subFolder != null) 264 if (subFolder != null)
264 { 265 {
265 List<InventoryItemBase> items=subFolder.RequestListOfItems(); 266 List<InventoryItemBase> items = subFolder.RequestListOfItems();
266 foreach(InventoryItemBase item in items) 267 foreach (InventoryItemBase item in items)
267 { 268 {
268 userProfile.DeleteItem(remoteClient.AgentId, item); 269 userProfile.DeleteItem(remoteClient.AgentId, item);
269 } 270 }
@@ -300,4 +301,4 @@ namespace OpenSim.Framework.Communications.Cache
300 m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); 301 m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
301 } 302 }
302 } 303 }
303} 304} \ No newline at end of file