aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
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/Communications/Cache/AssetTransactionManager.cs
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/Communications/Cache/AssetTransactionManager.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs128
1 files changed, 0 insertions, 128 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
deleted file mode 100644
index e4808a1..0000000
--- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28
29using System;
30using System.Collections.Generic;
31
32using libsecondlife;
33
34namespace OpenSim.Framework.Communications.Cache
35{
36 public class AssetTransactionManager
37 {
38 private static readonly log4net.ILog m_log
39 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
40
41 // Fields
42 public CommunicationsManager CommsManager;
43
44 public Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions =
45 new Dictionary<LLUUID, AgentAssetTransactions>();
46
47 private bool m_dumpAssetsToFile;
48
49 public AssetTransactionManager(CommunicationsManager commsManager, bool dumpAssetsToFile)
50 {
51 CommsManager = commsManager;
52 m_dumpAssetsToFile = dumpAssetsToFile;
53 }
54
55 // Methods
56 public AgentAssetTransactions AddUser(LLUUID userID)
57 {
58 lock (AgentTransactions)
59 {
60 if (!AgentTransactions.ContainsKey(userID))
61 {
62 AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile);
63 AgentTransactions.Add(userID, transactions);
64 return transactions;
65 }
66 }
67 return null;
68 }
69
70 public AgentAssetTransactions GetUserTransActions(LLUUID userID)
71 {
72 if (AgentTransactions.ContainsKey(userID))
73 {
74 return AgentTransactions[userID];
75 }
76 return null;
77 }
78
79 public void HandleInventoryFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID,
80 uint callbackID, string description, string name, sbyte invType,
81 sbyte type, byte wearableType, uint nextOwnerMask)
82 {
83 AgentAssetTransactions transactions = GetUserTransActions(remoteClient.AgentId);
84 if (transactions != null)
85 {
86 transactions.RequestCreateInventoryItem(remoteClient, transactionID, folderID, callbackID, description,
87 name, invType, type, wearableType, nextOwnerMask);
88 }
89 }
90
91 public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type,
92 byte[] data, bool storeLocal, bool tempFile)
93 {
94 // Console.WriteLine("asset upload of " + assetID);
95 AgentAssetTransactions transactions = GetUserTransActions(remoteClient.AgentId);
96 if (transactions != null)
97 {
98 AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction);
99 if (uploader != null)
100 {
101 // Upload has already compelted uploading...
102
103 if (uploader.Initialise(remoteClient, assetID, transaction, type, data, storeLocal, tempFile))
104 {
105 //[commenting out as this removal breaks uploads]
106 /*lock (transactions.XferUploaders)
107 {
108
109 // XXX Weak ass way of doing this by directly manipulating this public dictionary, purely temporary
110 transactions.XferUploaders.Remove(uploader.TransactionID);
111
112 //m_log.InfoFormat("[ASSET TRANSACTIONS] Current uploaders: {0}", transactions.XferUploaders.Count);
113 }*/
114 }
115 }
116 }
117 }
118
119 public void HandleXfer(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data)
120 {
121 AgentAssetTransactions transactions = GetUserTransActions(remoteClient.AgentId);
122 if (transactions != null)
123 {
124 transactions.HandleXfer(xferID, packetID, data);
125 }
126 }
127 }
128}