diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AgentAssetTransactionsManager.cs (renamed from OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs) | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AgentAssetTransactionsManager.cs index e4808a1..70471cc 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs +++ b/OpenSim/Framework/Communications/Cache/AgentAssetTransactionsManager.cs | |||
@@ -33,7 +33,10 @@ using libsecondlife; | |||
33 | 33 | ||
34 | namespace OpenSim.Framework.Communications.Cache | 34 | namespace OpenSim.Framework.Communications.Cache |
35 | { | 35 | { |
36 | public class AssetTransactionManager | 36 | /// <summary> |
37 | /// Manage the collection of agent asset transaction collections. Each agent has its own transaction collection | ||
38 | /// </summary> | ||
39 | public class AgentAssetTransactionsManager | ||
37 | { | 40 | { |
38 | private static readonly log4net.ILog m_log | 41 | private static readonly log4net.ILog m_log |
39 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 42 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
@@ -41,19 +44,28 @@ namespace OpenSim.Framework.Communications.Cache | |||
41 | // Fields | 44 | // Fields |
42 | public CommunicationsManager CommsManager; | 45 | public CommunicationsManager CommsManager; |
43 | 46 | ||
44 | public Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = | 47 | /// <summary> |
48 | /// Each agent has its own singleton collection of transactions | ||
49 | /// </summary> | ||
50 | private Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = | ||
45 | new Dictionary<LLUUID, AgentAssetTransactions>(); | 51 | new Dictionary<LLUUID, AgentAssetTransactions>(); |
46 | 52 | ||
53 | /// <summary> | ||
54 | /// Should we dump uploaded assets to the filesystem? | ||
55 | /// </summary> | ||
47 | private bool m_dumpAssetsToFile; | 56 | private bool m_dumpAssetsToFile; |
48 | 57 | ||
49 | public AssetTransactionManager(CommunicationsManager commsManager, bool dumpAssetsToFile) | 58 | public AgentAssetTransactionsManager(CommunicationsManager commsManager, bool dumpAssetsToFile) |
50 | { | 59 | { |
51 | CommsManager = commsManager; | 60 | CommsManager = commsManager; |
52 | m_dumpAssetsToFile = dumpAssetsToFile; | 61 | m_dumpAssetsToFile = dumpAssetsToFile; |
53 | } | 62 | } |
54 | 63 | ||
55 | // Methods | 64 | /// <summary> |
56 | public AgentAssetTransactions AddUser(LLUUID userID) | 65 | /// Add a collection of asset transactions for the given user |
66 | /// </summary> | ||
67 | /// <param name="userID"></param> | ||
68 | public void AddUser(LLUUID userID) | ||
57 | { | 69 | { |
58 | lock (AgentTransactions) | 70 | lock (AgentTransactions) |
59 | { | 71 | { |
@@ -61,13 +73,16 @@ namespace OpenSim.Framework.Communications.Cache | |||
61 | { | 73 | { |
62 | AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile); | 74 | AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile); |
63 | AgentTransactions.Add(userID, transactions); | 75 | AgentTransactions.Add(userID, transactions); |
64 | return transactions; | ||
65 | } | 76 | } |
66 | } | 77 | } |
67 | return null; | ||
68 | } | 78 | } |
69 | 79 | ||
70 | public AgentAssetTransactions GetUserTransActions(LLUUID userID) | 80 | /// <summary> |
81 | /// Get the collection of asset transactions for the given user. | ||
82 | /// </summary> | ||
83 | /// <param name="userID"></param> | ||
84 | /// <returns></returns> | ||
85 | public AgentAssetTransactions GetUserTransactions(LLUUID userID) | ||
71 | { | 86 | { |
72 | if (AgentTransactions.ContainsKey(userID)) | 87 | if (AgentTransactions.ContainsKey(userID)) |
73 | { | 88 | { |
@@ -80,7 +95,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
80 | uint callbackID, string description, string name, sbyte invType, | 95 | uint callbackID, string description, string name, sbyte invType, |
81 | sbyte type, byte wearableType, uint nextOwnerMask) | 96 | sbyte type, byte wearableType, uint nextOwnerMask) |
82 | { | 97 | { |
83 | AgentAssetTransactions transactions = GetUserTransActions(remoteClient.AgentId); | 98 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); |
84 | if (transactions != null) | 99 | if (transactions != null) |
85 | { | 100 | { |
86 | transactions.RequestCreateInventoryItem(remoteClient, transactionID, folderID, callbackID, description, | 101 | transactions.RequestCreateInventoryItem(remoteClient, transactionID, folderID, callbackID, description, |
@@ -92,7 +107,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
92 | byte[] data, bool storeLocal, bool tempFile) | 107 | byte[] data, bool storeLocal, bool tempFile) |
93 | { | 108 | { |
94 | // Console.WriteLine("asset upload of " + assetID); | 109 | // Console.WriteLine("asset upload of " + assetID); |
95 | AgentAssetTransactions transactions = GetUserTransActions(remoteClient.AgentId); | 110 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); |
96 | if (transactions != null) | 111 | if (transactions != null) |
97 | { | 112 | { |
98 | AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction); | 113 | AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction); |
@@ -118,7 +133,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
118 | 133 | ||
119 | public void HandleXfer(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) | 134 | public void HandleXfer(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) |
120 | { | 135 | { |
121 | AgentAssetTransactions transactions = GetUserTransActions(remoteClient.AgentId); | 136 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); |
122 | if (transactions != null) | 137 | if (transactions != null) |
123 | { | 138 | { |
124 | transactions.HandleXfer(xferID, packetID, data); | 139 | transactions.HandleXfer(xferID, packetID, data); |