aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-02-12 18:15:54 +0000
committerJustin Clarke Casey2008-02-12 18:15:54 +0000
commit6a3455a98cb3b7c910dd2d8d09f69d1c3acf7d2d (patch)
treefc05f0a0f1bc94ff4330358aab81f4c49fbdb0f6 /OpenSim/Framework
parent* This fixes the object edit box's flipping checkboxes when you modify one of... (diff)
downloadopensim-SC_OLD-6a3455a98cb3b7c910dd2d8d09f69d1c3acf7d2d.zip
opensim-SC_OLD-6a3455a98cb3b7c910dd2d8d09f69d1c3acf7d2d.tar.gz
opensim-SC_OLD-6a3455a98cb3b7c910dd2d8d09f69d1c3acf7d2d.tar.bz2
opensim-SC_OLD-6a3455a98cb3b7c910dd2d8d09f69d1c3acf7d2d.tar.xz
* Refactoring: Rename AssetTransactions.cs and AssetTransactionsManager and align classes with file names
* Small amount of ndoc * This will probably require a prebuild and nant clean
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/AgentAssetTransactions.cs (renamed from OpenSim/Framework/Communications/Cache/AssetTransactions.cs)7
-rw-r--r--OpenSim/Framework/Communications/Cache/AgentAssetTransactionsManager.cs (renamed from OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs)37
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs8
3 files changed, 35 insertions, 17 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AgentAssetTransactions.cs
index 996e5ba..e74a06b 100644
--- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
+++ b/OpenSim/Framework/Communications/Cache/AgentAssetTransactions.cs
@@ -35,6 +35,9 @@ using OpenSim.Region.Capabilities;
35 35
36namespace OpenSim.Framework.Communications.Cache 36namespace OpenSim.Framework.Communications.Cache
37{ 37{
38 /// <summary>
39 /// Manage asset transactions for a single agent.
40 /// </summary>
38 public class AgentAssetTransactions 41 public class AgentAssetTransactions
39 { 42 {
40 private static readonly log4net.ILog m_log 43 private static readonly log4net.ILog m_log
@@ -45,11 +48,11 @@ namespace OpenSim.Framework.Communications.Cache
45 public List<NoteCardCapsUpdate> NotecardUpdaters = new List<NoteCardCapsUpdate>(); 48 public List<NoteCardCapsUpdate> NotecardUpdaters = new List<NoteCardCapsUpdate>();
46 public LLUUID UserID; 49 public LLUUID UserID;
47 public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>(); 50 public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>();
48 public AssetTransactionManager Manager; 51 public AgentAssetTransactionsManager Manager;
49 private bool m_dumpAssetsToFile; 52 private bool m_dumpAssetsToFile;
50 53
51 // Methods 54 // Methods
52 public AgentAssetTransactions(LLUUID agentID, AssetTransactionManager manager, bool dumpAssetsToFile) 55 public AgentAssetTransactions(LLUUID agentID, AgentAssetTransactionsManager manager, bool dumpAssetsToFile)
53 { 56 {
54 UserID = agentID; 57 UserID = agentID;
55 Manager = manager; 58 Manager = manager;
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
34namespace OpenSim.Framework.Communications.Cache 34namespace 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);
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index f6cfda7..3e72d89 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -73,9 +73,9 @@ namespace OpenSim.Framework.Communications
73 get { return m_userProfileCacheService; } 73 get { return m_userProfileCacheService; }
74 } 74 }
75 75
76 protected AssetTransactionManager m_transactionsManager; 76 protected AgentAssetTransactionsManager m_transactionsManager;
77 77
78 public AssetTransactionManager TransactionsManager 78 public AgentAssetTransactionsManager TransactionsManager
79 { 79 {
80 get { return m_transactionsManager; } 80 get { return m_transactionsManager; }
81 } 81 }
@@ -100,7 +100,7 @@ namespace OpenSim.Framework.Communications
100 m_networkServersInfo = serversInfo; 100 m_networkServersInfo = serversInfo;
101 m_assetCache = assetCache; 101 m_assetCache = assetCache;
102 m_userProfileCacheService = new UserProfileCacheService(this); 102 m_userProfileCacheService = new UserProfileCacheService(this);
103 m_transactionsManager = new AssetTransactionManager(this, dumpAssetsToFile); 103 m_transactionsManager = new AgentAssetTransactionsManager(this, dumpAssetsToFile);
104 } 104 }
105 105
106 public void doCreate(string[] cmmdParams) 106 public void doCreate(string[] cmmdParams)
@@ -241,4 +241,4 @@ namespace OpenSim.Framework.Communications
241 241
242 #endregion 242 #endregion
243 } 243 }
244} \ No newline at end of file 244}