aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/CAPSService.cs16
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs14
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetTransactions.cs28
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs9
-rw-r--r--OpenSim/Framework/Communications/Cache/InventoryFolder.cs26
-rw-r--r--OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs10
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCache.cs23
-rw-r--r--OpenSim/Framework/Communications/Capabilities/Caps.cs46
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs5
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs7
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs4
11 files changed, 87 insertions, 101 deletions
diff --git a/OpenSim/Framework/Communications/CAPSService.cs b/OpenSim/Framework/Communications/CAPSService.cs
index 6f65551..b60ef02 100644
--- a/OpenSim/Framework/Communications/CAPSService.cs
+++ b/OpenSim/Framework/Communications/CAPSService.cs
@@ -26,21 +26,9 @@
26* 26*
27*/ 27*/
28 28
29using System;
30using System.Collections;
31using System.Collections.Generic;
32using System.Reflection;
33using System.Security.Cryptography;
34using libsecondlife;
35using Nwc.XmlRpc;
36using OpenSim.Framework.Console;
37using OpenSim.Framework.Data;
38using OpenSim.Framework.Interfaces;
39using OpenSim.Framework.Inventory;
40using OpenSim.Framework.Utilities;
41using OpenSim.Framework.Servers; 29using OpenSim.Framework.Servers;
42 30
43namespace OpenSim.Framework.UserManagement 31namespace OpenSim.Framework.Communications
44{ 32{
45 public class CAPSService 33 public class CAPSService
46 { 34 {
@@ -63,4 +51,4 @@ namespace OpenSim.Framework.UserManagement
63 return ""; 51 return "";
64 } 52 }
65 } 53 }
66} 54} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
index 42c0a8e..2c1e5c8 100644
--- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
@@ -36,17 +36,19 @@ using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities; 36using OpenSim.Framework.Utilities;
37using OpenSim.Framework.Data; 37using OpenSim.Framework.Data;
38 38
39namespace OpenSim.Framework.Communications.Caches 39namespace OpenSim.Framework.Communications.Cache
40{ 40{
41 public class AssetTransactionManager 41 public class AssetTransactionManager
42 { 42 {
43 // Fields 43 // Fields
44 public CommunicationsManager CommsManager; 44 public CommunicationsManager CommsManager;
45 public Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = new Dictionary<LLUUID, AgentAssetTransactions>(); 45 public Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = new Dictionary<LLUUID, AgentAssetTransactions>();
46 private bool m_dumpAssetsToFile;
46 47
47 public AssetTransactionManager(CommunicationsManager commsManager) 48 public AssetTransactionManager(CommunicationsManager commsManager, bool dumpAssetsToFile)
48 { 49 {
49 CommsManager = commsManager; 50 CommsManager = commsManager;
51 m_dumpAssetsToFile = dumpAssetsToFile;
50 } 52 }
51 53
52 // Methods 54 // Methods
@@ -54,7 +56,7 @@ namespace OpenSim.Framework.Communications.Caches
54 { 56 {
55 if (!this.AgentTransactions.ContainsKey(userID)) 57 if (!this.AgentTransactions.ContainsKey(userID))
56 { 58 {
57 AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this); 59 AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile);
58 this.AgentTransactions.Add(userID, transactions); 60 this.AgentTransactions.Add(userID, transactions);
59 return transactions; 61 return transactions;
60 } 62 }
@@ -82,7 +84,7 @@ namespace OpenSim.Framework.Communications.Caches
82 84
83 public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal) 85 public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal)
84 { 86 {
85 // Console.WriteLine("asset upload of " + assetID); 87 // Console.WriteLine("asset upload of " + assetID);
86 AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId); 88 AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId);
87 if (transactions != null) 89 if (transactions != null)
88 { 90 {
@@ -103,6 +105,4 @@ namespace OpenSim.Framework.Communications.Caches
103 } 105 }
104 } 106 }
105 } 107 }
106} 108} \ No newline at end of file
107
108
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
index 51fc462..581e300 100644
--- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
@@ -39,7 +39,7 @@ using OpenSim.Framework.Utilities;
39using OpenSim.Region.Capabilities; 39using OpenSim.Region.Capabilities;
40using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
41 41
42namespace OpenSim.Framework.Communications.Caches 42namespace OpenSim.Framework.Communications.Cache
43{ 43{
44 public class AgentAssetTransactions 44 public class AgentAssetTransactions
45 { 45 {
@@ -49,12 +49,14 @@ namespace OpenSim.Framework.Communications.Caches
49 public LLUUID UserID; 49 public LLUUID UserID;
50 public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>(); 50 public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>();
51 public AssetTransactionManager Manager; 51 public AssetTransactionManager Manager;
52 private bool m_dumpAssetsToFile;
52 53
53 // Methods 54 // Methods
54 public AgentAssetTransactions(LLUUID agentID, AssetTransactionManager manager) 55 public AgentAssetTransactions(LLUUID agentID, AssetTransactionManager manager, bool dumpAssetsToFile)
55 { 56 {
56 this.UserID = agentID; 57 this.UserID = agentID;
57 Manager = manager; 58 Manager = manager;
59 m_dumpAssetsToFile = dumpAssetsToFile;
58 } 60 }
59 61
60 public AssetCapsUploader RequestCapsUploader() 62 public AssetCapsUploader RequestCapsUploader()
@@ -75,7 +77,7 @@ namespace OpenSim.Framework.Communications.Caches
75 { 77 {
76 if (!this.XferUploaders.ContainsKey(transactionID)) 78 if (!this.XferUploaders.ContainsKey(transactionID))
77 { 79 {
78 AssetXferUploader uploader = new AssetXferUploader(this); 80 AssetXferUploader uploader = new AssetXferUploader(this, m_dumpAssetsToFile);
79 81
80 this.XferUploaders.Add(transactionID, uploader); 82 this.XferUploaders.Add(transactionID, uploader);
81 return uploader; 83 return uploader;
@@ -122,14 +124,14 @@ namespace OpenSim.Framework.Communications.Caches
122 private string m_assetName = ""; 124 private string m_assetName = "";
123 private LLUUID m_folderID; 125 private LLUUID m_folderID;
124 private LLUUID newAssetID; 126 private LLUUID newAssetID;
125 private bool SaveImages = false; 127 private bool m_dumpImageToFile;
126 private string uploaderPath = ""; 128 private string uploaderPath = "";
127 129
128 // Events 130 // Events
129 public event UpLoadedAsset OnUpLoad; 131 public event UpLoadedAsset OnUpLoad;
130 132
131 // Methods 133 // Methods
132 public void Initialise(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID folderID, string path, BaseHttpServer httpServer) 134 public void Initialise(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID folderID, string path, BaseHttpServer httpServer, bool dumpImageToFile)
133 { 135 {
134 this.m_assetName = assetName; 136 this.m_assetName = assetName;
135 this.m_assetDescription = assetDescription; 137 this.m_assetDescription = assetDescription;
@@ -138,6 +140,7 @@ namespace OpenSim.Framework.Communications.Caches
138 this.inventoryItemID = inventoryItem; 140 this.inventoryItemID = inventoryItem;
139 this.uploaderPath = path; 141 this.uploaderPath = path;
140 this.httpListener = httpServer; 142 this.httpListener = httpServer;
143 m_dumpImageToFile = dumpImageToFile;
141 } 144 }
142 145
143 private void SaveImageToFile(string filename, byte[] data) 146 private void SaveImageToFile(string filename, byte[] data)
@@ -159,7 +162,7 @@ namespace OpenSim.Framework.Communications.Caches
159 complete.state = "complete"; 162 complete.state = "complete";
160 text = LLSDHelpers.SerialiseLLSDReply(complete); 163 text = LLSDHelpers.SerialiseLLSDReply(complete);
161 this.httpListener.RemoveStreamHandler("POST", this.uploaderPath); 164 this.httpListener.RemoveStreamHandler("POST", this.uploaderPath);
162 if (this.SaveImages) 165 if (this.m_dumpImageToFile)
163 { 166 {
164 this.SaveImageToFile(this.m_assetName + ".jp2", data); 167 this.SaveImageToFile(this.m_assetName + ".jp2", data);
165 } 168 }
@@ -190,10 +193,12 @@ namespace OpenSim.Framework.Communications.Caches
190 private bool m_createItem = false; 193 private bool m_createItem = false;
191 private AgentAssetTransactions m_userTransactions; 194 private AgentAssetTransactions m_userTransactions;
192 private bool m_storeLocal; 195 private bool m_storeLocal;
196 private bool m_dumpAssetToFile;
193 197
194 public AssetXferUploader(AgentAssetTransactions transactions) 198 public AssetXferUploader(AgentAssetTransactions transactions, bool dumpAssetToFile)
195 { 199 {
196 this.m_userTransactions = transactions; 200 this.m_userTransactions = transactions;
201 m_dumpAssetToFile = dumpAssetToFile;
197 } 202 }
198 203
199 // Methods 204 // Methods
@@ -278,9 +283,14 @@ namespace OpenSim.Framework.Communications.Caches
278 this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset); 283 this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset);
279 } 284 }
280 285
281 // Console.WriteLine("upload complete "+ this.TransactionID); 286 // Console.WriteLine("upload complete "+ this.TransactionID);
282 //SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data); 287
288 if (m_dumpAssetToFile)
289 {
290 SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data);
291 }
283 } 292 }
293
284 private void SaveAssetToFile(string filename, byte[] data) 294 private void SaveAssetToFile(string filename, byte[] data)
285 { 295 {
286 FileStream fs = File.Create(filename); 296 FileStream fs = File.Create(filename);
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index b1432ff..92b21a8 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -27,7 +27,6 @@
27*/ 27*/
28using libsecondlife; 28using libsecondlife;
29using OpenSim.Framework.Types; 29using OpenSim.Framework.Types;
30using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
31 30
32namespace OpenSim.Framework.Communications.Cache 31namespace OpenSim.Framework.Communications.Cache
33{ 32{
@@ -35,7 +34,7 @@ namespace OpenSim.Framework.Communications.Cache
35 { 34 {
36 private readonly CommunicationsManager m_parentCommsManager; 35 private readonly CommunicationsManager m_parentCommsManager;
37 // Fields 36 // Fields
38 public InventoryFolder RootFolder = null; 37 public InventoryFolderImpl RootFolder = null;
39 public UserProfileData UserProfile = null; 38 public UserProfileData UserProfile = null;
40 39
41 public CachedUserInfo(CommunicationsManager commsManager) 40 public CachedUserInfo(CommunicationsManager commsManager)
@@ -44,7 +43,7 @@ namespace OpenSim.Framework.Communications.Cache
44 } 43 }
45 44
46 // Methods 45 // Methods
47 public void FolderReceive(LLUUID userID, InventoryFolder folderInfo) 46 public void FolderReceive(LLUUID userID, InventoryFolderImpl folderInfo)
48 { 47 {
49 if (userID == this.UserProfile.UUID) 48 if (userID == this.UserProfile.UUID)
50 { 49 {
@@ -61,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache
61 } 60 }
62 else 61 else
63 { 62 {
64 InventoryFolder folder = this.RootFolder.HasSubFolder(folderInfo.parentID); 63 InventoryFolderImpl folder = this.RootFolder.HasSubFolder(folderInfo.parentID);
65 if (folder != null) 64 if (folder != null)
66 { 65 {
67 folder.SubFolders.Add(folderInfo.folderID, folderInfo); 66 folder.SubFolders.Add(folderInfo.folderID, folderInfo);
@@ -80,7 +79,7 @@ namespace OpenSim.Framework.Communications.Cache
80 } 79 }
81 else 80 else
82 { 81 {
83 InventoryFolder folder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID); 82 InventoryFolderImpl folder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID);
84 if (folder != null) 83 if (folder != null)
85 { 84 {
86 folder.Items.Add(itemInfo.inventoryID, itemInfo); 85 folder.Items.Add(itemInfo.inventoryID, itemInfo);
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolder.cs b/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
index fbe1bd0..af3346f 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
@@ -35,15 +35,15 @@ using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Types; 35using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities; 36using OpenSim.Framework.Utilities;
37 37
38namespace OpenSim.Framework.Communications.Caches 38namespace OpenSim.Framework.Communications.Cache
39{ 39{
40 public class InventoryFolder : InventoryFolderBase 40 public class InventoryFolderImpl : InventoryFolderBase
41 { 41 {
42 // Fields 42 // Fields
43 public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); 43 public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>();
44 public Dictionary<LLUUID, InventoryFolder> SubFolders = new Dictionary<LLUUID, InventoryFolder>(); 44 public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>();
45 45
46 public InventoryFolder(InventoryFolderBase folderbase) 46 public InventoryFolderImpl(InventoryFolderBase folderbase)
47 { 47 {
48 this.agentID = folderbase.agentID; 48 this.agentID = folderbase.agentID;
49 this.folderID = folderbase.folderID; 49 this.folderID = folderbase.folderID;
@@ -53,15 +53,15 @@ namespace OpenSim.Framework.Communications.Caches
53 this.version = folderbase.version; 53 this.version = folderbase.version;
54 } 54 }
55 55
56 public InventoryFolder() 56 public InventoryFolderImpl()
57 { 57 {
58 58
59 } 59 }
60 60
61 // Methods 61 // Methods
62 public InventoryFolder CreateNewSubFolder(LLUUID folderID, string folderName, ushort type) 62 public InventoryFolderImpl CreateNewSubFolder(LLUUID folderID, string folderName, ushort type)
63 { 63 {
64 InventoryFolder subFold = new InventoryFolder(); 64 InventoryFolderImpl subFold = new InventoryFolderImpl();
65 subFold.name = folderName; 65 subFold.name = folderName;
66 subFold.folderID = folderID; 66 subFold.folderID = folderID;
67 subFold.type = (short) type; 67 subFold.type = (short) type;
@@ -78,7 +78,7 @@ namespace OpenSim.Framework.Communications.Caches
78 { 78 {
79 return this.Items[itemID]; 79 return this.Items[itemID];
80 } 80 }
81 foreach (InventoryFolder folder in this.SubFolders.Values) 81 foreach (InventoryFolderImpl folder in this.SubFolders.Values)
82 { 82 {
83 base2 = folder.HasItem(itemID); 83 base2 = folder.HasItem(itemID);
84 if (base2 != null) 84 if (base2 != null)
@@ -97,7 +97,7 @@ namespace OpenSim.Framework.Communications.Caches
97 Items.Remove(itemID); 97 Items.Remove(itemID);
98 return true; 98 return true;
99 } 99 }
100 foreach (InventoryFolder folder in this.SubFolders.Values) 100 foreach (InventoryFolderImpl folder in this.SubFolders.Values)
101 { 101 {
102 found = folder.DeleteItem(itemID); 102 found = folder.DeleteItem(itemID);
103 if (found == true) 103 if (found == true)
@@ -109,16 +109,16 @@ namespace OpenSim.Framework.Communications.Caches
109 } 109 }
110 110
111 111
112 public InventoryFolder HasSubFolder(LLUUID folderID) 112 public InventoryFolderImpl HasSubFolder(LLUUID folderID)
113 { 113 {
114 InventoryFolder returnFolder = null; 114 InventoryFolderImpl returnFolder = null;
115 if (this.SubFolders.ContainsKey(folderID)) 115 if (this.SubFolders.ContainsKey(folderID))
116 { 116 {
117 returnFolder = this.SubFolders[folderID]; 117 returnFolder = this.SubFolders[folderID];
118 } 118 }
119 else 119 else
120 { 120 {
121 foreach (InventoryFolder folder in this.SubFolders.Values) 121 foreach (InventoryFolderImpl folder in this.SubFolders.Values)
122 { 122 {
123 returnFolder = folder.HasSubFolder(folderID); 123 returnFolder = folder.HasSubFolder(folderID);
124 if (returnFolder != null) 124 if (returnFolder != null)
@@ -140,4 +140,4 @@ namespace OpenSim.Framework.Communications.Caches
140 return itemList; 140 return itemList;
141 } 141 }
142 } 142 }
143} 143} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
index 13ce39e..86e26f0 100644
--- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
@@ -35,16 +35,16 @@ using OpenSim.Framework.Types;
35using OpenSim.Framework.Utilities; 35using OpenSim.Framework.Utilities;
36using Nini.Config; 36using Nini.Config;
37 37
38namespace OpenSim.Framework.Communications.Caches 38namespace OpenSim.Framework.Communications.Cache
39{ 39{
40 /// <summary> 40 /// <summary>
41 /// Basically a hack to give us a Inventory library while we don't have a inventory server 41 /// Basically a hack to give us a Inventory library while we don't have a inventory server
42 /// once the server is fully implemented then should read the data from that 42 /// once the server is fully implemented then should read the data from that
43 /// </summary> 43 /// </summary>
44 public class LibraryRootFolder : InventoryFolder 44 public class LibraryRootFolder : Cache.InventoryFolderImpl
45 { 45 {
46 private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000"); 46 private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000");
47 private InventoryFolder m_textureFolder; 47 private Cache.InventoryFolderImpl m_textureFolder;
48 48
49 public LibraryRootFolder() 49 public LibraryRootFolder()
50 { 50 {
@@ -55,7 +55,7 @@ namespace OpenSim.Framework.Communications.Caches
55 this.type = (short)-1; 55 this.type = (short)-1;
56 this.version = (ushort)1; 56 this.version = (ushort)1;
57 57
58 InventoryFolder folderInfo = new InventoryFolder(); 58 Cache.InventoryFolderImpl folderInfo = new InventoryFolderImpl();
59 folderInfo.agentID = libOwner; 59 folderInfo.agentID = libOwner;
60 folderInfo.folderID = new LLUUID("00000112-000f-0000-0000-000100bba001"); 60 folderInfo.folderID = new LLUUID("00000112-000f-0000-0000-000100bba001");
61 folderInfo.name = "Texture Library"; 61 folderInfo.name = "Texture Library";
@@ -242,4 +242,4 @@ namespace OpenSim.Framework.Communications.Caches
242 } 242 }
243 243
244 } 244 }
245} 245} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
index 362ab17..bd7aeef 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
@@ -36,7 +36,7 @@ using OpenSim.Framework.Interfaces;
36using OpenSim.Framework.Types; 36using OpenSim.Framework.Types;
37using OpenSim.Framework.Utilities; 37using OpenSim.Framework.Utilities;
38 38
39namespace OpenSim.Framework.Communications.Caches 39namespace OpenSim.Framework.Communications.Cache
40{ 40{
41 public class UserProfileCache 41 public class UserProfileCache
42 { 42 {
@@ -107,15 +107,15 @@ namespace OpenSim.Framework.Communications.Caches
107 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; 107 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
108 if (info.RootFolder.folderID == parentID) 108 if (info.RootFolder.folderID == parentID)
109 { 109 {
110 InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType); 110 InventoryFolderImpl createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
111 if (createdFolder != null) 111 if (createdFolder != null)
112 { 112 {
113 this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder); 113 this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder);
114 } 114 }
115 } 115 }
116 else 116 else
117 { 117 {
118 InventoryFolder folder = info.RootFolder.HasSubFolder(parentID); 118 InventoryFolderImpl folder = info.RootFolder.HasSubFolder(parentID);
119 if (folder != null) 119 if (folder != null)
120 { 120 {
121 folder.CreateNewSubFolder(folderID, folderName, folderType); 121 folder.CreateNewSubFolder(folderID, folderName, folderType);
@@ -127,7 +127,7 @@ namespace OpenSim.Framework.Communications.Caches
127 127
128 public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) 128 public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
129 { 129 {
130 InventoryFolder fold = null; 130 InventoryFolderImpl fold = null;
131 if (folderID == libraryRoot.folderID ) 131 if (folderID == libraryRoot.folderID )
132 { 132 {
133 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems()); 133 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems());
@@ -150,7 +150,7 @@ namespace OpenSim.Framework.Communications.Caches
150 } 150 }
151 else 151 else
152 { 152 {
153 InventoryFolder folder = info.RootFolder.HasSubFolder(folderID); 153 InventoryFolderImpl folder = info.RootFolder.HasSubFolder(folderID);
154 if ((folder != null) && fetchItems) 154 if ((folder != null) && fetchItems)
155 { 155 {
156 remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems()); 156 remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems());
@@ -185,7 +185,7 @@ namespace OpenSim.Framework.Communications.Caches
185 /// <param name="userID"></param> 185 /// <param name="userID"></param>
186 private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) 186 private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo)
187 { 187 {
188 this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); 188 this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
189 } 189 }
190 190
191 /// <summary> 191 /// <summary>
@@ -223,5 +223,4 @@ namespace OpenSim.Framework.Communications.Caches
223 { 223 {
224 } 224 }
225 } 225 }
226} 226} \ No newline at end of file
227
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs
index 899fb61..095a5b1 100644
--- a/OpenSim/Framework/Communications/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs
@@ -61,8 +61,9 @@ namespace OpenSim.Region.Capabilities
61 private Queue<string> CapsEventQueue = new Queue<string>(); 61 private Queue<string> CapsEventQueue = new Queue<string>();
62 public NewInventoryItem AddNewInventoryItem = null; 62 public NewInventoryItem AddNewInventoryItem = null;
63 public ItemUpdatedCallback ItemUpdatedCall = null; 63 public ItemUpdatedCallback ItemUpdatedCall = null;
64 private bool m_dumpAssetsToFile;
64 65
65 public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent) 66 public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent, bool dumpAssetsToFile)
66 { 67 {
67 assetCache = assetCach; 68 assetCache = assetCach;
68 m_capsObjectPath = capsPath; 69 m_capsObjectPath = capsPath;
@@ -70,6 +71,7 @@ namespace OpenSim.Region.Capabilities
70 m_httpListenerHostName = httpListen; 71 m_httpListenerHostName = httpListen;
71 m_httpListenPort = httpPort; 72 m_httpListenPort = httpPort;
72 agentID = agent; 73 agentID = agent;
74 m_dumpAssetsToFile = dumpAssetsToFile;
73 } 75 }
74 76
75 /// <summary> 77 /// <summary>
@@ -250,7 +252,7 @@ namespace OpenSim.Region.Capabilities
250 LLUUID newInvItem = llsdRequest.item_id; 252 LLUUID newInvItem = llsdRequest.item_id;
251 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); 253 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
252 254
253 ItemUpdater uploader = new ItemUpdater(newInvItem, capsBase + uploaderPath, this.httpListener); 255 ItemUpdater uploader = new ItemUpdater(newInvItem, capsBase + uploaderPath, this.httpListener, m_dumpAssetsToFile );
254 uploader.OnUpLoad += this.ItemUpdated; 256 uploader.OnUpLoad += this.ItemUpdated;
255 257
256 httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); 258 httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
@@ -280,7 +282,7 @@ namespace OpenSim.Region.Capabilities
280 LLUUID parentFolder = llsdRequest.folder_id; 282 LLUUID parentFolder = llsdRequest.folder_id;
281 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); 283 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
282 284
283 AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, llsdRequest.asset_type, capsBase + uploaderPath, this.httpListener); 285 AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, llsdRequest.asset_type, capsBase + uploaderPath, this.httpListener, m_dumpAssetsToFile);
284 httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); 286 httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
285 string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; 287 string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath;
286 288
@@ -360,21 +362,14 @@ namespace OpenSim.Region.Capabilities
360 private LLUUID inventoryItemID; 362 private LLUUID inventoryItemID;
361 private LLUUID parentFolder; 363 private LLUUID parentFolder;
362 private BaseHttpServer httpListener; 364 private BaseHttpServer httpListener;
363 private bool SaveAssets = false; 365 private bool m_dumpAssetsToFile;
364 private string m_assetName = ""; 366 private string m_assetName = "";
365 private string m_assetDes = ""; 367 private string m_assetDes = "";
366 368
367 private string m_invType = ""; 369 private string m_invType = "";
368 private string m_assetType = ""; 370 private string m_assetType = "";
369 371
370 /// <summary> 372 public AssetUploader(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolderID, string invType, string assetType, string path, BaseHttpServer httpServer, bool dumpAssetsToFile)
371 ///
372 /// </summary>
373 /// <param name="assetID"></param>
374 /// <param name="inventoryItem"></param>
375 /// <param name="path"></param>
376 /// <param name="httpServer"></param>
377 public AssetUploader(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolderID, string invType, string assetType, string path, BaseHttpServer httpServer)
378 { 373 {
379 m_assetName = assetName; 374 m_assetName = assetName;
380 m_assetDes = description; 375 m_assetDes = description;
@@ -385,7 +380,7 @@ namespace OpenSim.Region.Capabilities
385 parentFolder = parentFolderID; 380 parentFolder = parentFolderID;
386 m_assetType = assetType; 381 m_assetType = assetType;
387 m_invType = invType; 382 m_invType = invType;
388 383 m_dumpAssetsToFile = dumpAssetsToFile;
389 } 384 }
390 385
391 /// <summary> 386 /// <summary>
@@ -408,8 +403,10 @@ namespace OpenSim.Region.Capabilities
408 403
409 httpListener.RemoveStreamHandler("POST", uploaderPath); 404 httpListener.RemoveStreamHandler("POST", uploaderPath);
410 405
411 if(this.SaveAssets) 406 if (this.m_dumpAssetsToFile)
407 {
412 this.SaveAssetToFile(m_assetName + ".jp2", data); 408 this.SaveAssetToFile(m_assetName + ".jp2", data);
409 }
413 410
414 if (OnUpLoad != null) 411 if (OnUpLoad != null)
415 { 412 {
@@ -436,19 +433,12 @@ namespace OpenSim.Region.Capabilities
436 private string uploaderPath = ""; 433 private string uploaderPath = "";
437 private LLUUID inventoryItemID; 434 private LLUUID inventoryItemID;
438 private BaseHttpServer httpListener; 435 private BaseHttpServer httpListener;
439 private bool SaveAssets = false; 436 private bool m_dumpAssetToFile;
440
441 437
442 /// <summary> 438 public ItemUpdater( LLUUID inventoryItem, string path, BaseHttpServer httpServer, bool dumpAssetToFile)
443 ///
444 /// </summary>
445 /// <param name="assetID"></param>
446 /// <param name="inventoryItem"></param>
447 /// <param name="path"></param>
448 /// <param name="httpServer"></param>
449 public ItemUpdater( LLUUID inventoryItem, string path, BaseHttpServer httpServer)
450 { 439 {
451 440 m_dumpAssetToFile = dumpAssetToFile;
441
452 inventoryItemID = inventoryItem; 442 inventoryItemID = inventoryItem;
453 uploaderPath = path; 443 uploaderPath = path;
454 httpListener = httpServer; 444 httpListener = httpServer;
@@ -481,8 +471,10 @@ namespace OpenSim.Region.Capabilities
481 471
482 httpListener.RemoveStreamHandler("POST", uploaderPath); 472 httpListener.RemoveStreamHandler("POST", uploaderPath);
483 473
484 if (this.SaveAssets) 474 if (this.m_dumpAssetToFile)
485 this.SaveAssetToFile("updateditem"+Util.RandomClass.Next(1,1000) + ".dat", data); 475 {
476 this.SaveAssetToFile("updateditem" + Util.RandomClass.Next(1, 1000) + ".dat", data);
477 }
486 478
487 return res; 479 return res;
488 } 480 }
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 5af07f7..7a157be 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -28,7 +28,6 @@
28using System; 28using System;
29using libsecondlife; 29using libsecondlife;
30using OpenSim.Framework.Communications.Cache; 30using OpenSim.Framework.Communications.Cache;
31using OpenSim.Framework.Communications.Caches;
32using OpenSim.Framework.Interfaces; 31using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Servers; 32using OpenSim.Framework.Servers;
34using OpenSim.Framework.Types; 33using OpenSim.Framework.Types;
@@ -87,12 +86,12 @@ namespace OpenSim.Framework.Communications
87 get { return m_networkServersInfo; } 86 get { return m_networkServersInfo; }
88 } 87 }
89 88
90 public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache) 89 public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool dumpAssetsToFile)
91 { 90 {
92 m_networkServersInfo = serversInfo; 91 m_networkServersInfo = serversInfo;
93 m_assetCache = assetCache; 92 m_assetCache = assetCache;
94 m_userProfileCache = new UserProfileCache(this); 93 m_userProfileCache = new UserProfileCache(this);
95 m_transactionsManager = new AssetTransactionManager(this); 94 m_transactionsManager = new AssetTransactionManager(this, dumpAssetsToFile );
96 } 95 }
97 96
98 public void doCreate(string[] cmmdParams) 97 public void doCreate(string[] cmmdParams)
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index bfc3ee7..5643d78 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -30,19 +30,18 @@ using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Text; 31using System.Text;
32using libsecondlife; 32using libsecondlife;
33using OpenSim.Framework.Communications.Caches; 33using OpenSim.Framework.Communications.Cache;
34using OpenSim.Framework.Types; 34using OpenSim.Framework.Types;
35using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder;
36 35
37namespace OpenSim.Framework.Communications 36namespace OpenSim.Framework.Communications
38{ 37{
39 public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolder folderInfo); 38 public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolderImpl folderInfo);
40 public delegate void InventoryItemInfo(LLUUID userID, InventoryItemBase itemInfo); 39 public delegate void InventoryItemInfo(LLUUID userID, InventoryItemBase itemInfo);
41 40
42 public interface IInventoryServices 41 public interface IInventoryServices
43 { 42 {
44 void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); 43 void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
45 void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder); 44 void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder);
46 void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); 45 void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
47 void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); 46 void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
48 void CreateNewUserInventory(LLUUID user); 47 void CreateNewUserInventory(LLUUID user);
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 06a1ca8..6549966 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using libsecondlife; 32using libsecondlife;
33using OpenSim.Framework.Communications; 33using OpenSim.Framework.Communications;
34using OpenSim.Framework.Communications.Cache;
34using OpenSim.Framework.Console; 35using OpenSim.Framework.Console;
35using OpenSim.Framework.Types; 36using OpenSim.Framework.Types;
36using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
37 37
38namespace OpenSim.Framework.Communications 38namespace OpenSim.Framework.Communications
39{ 39{
@@ -232,7 +232,7 @@ namespace OpenSim.Framework.Communications
232 } 232 }
233 233
234 public abstract void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); 234 public abstract void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
235 public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder); 235 public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder);
236 public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); 236 public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
237 public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); 237 public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
238 } 238 }