aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Agent
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Agent')
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs21
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs20
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs13
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs9
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs19
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs12
7 files changed, 57 insertions, 43 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
index 550b673..48db51b 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
@@ -40,16 +40,15 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload
40 /// <summary> 40 /// <summary>
41 /// Asset requests with data which are ready to be sent back to requesters. This includes textures. 41 /// Asset requests with data which are ready to be sent back to requesters. This includes textures.
42 /// </summary> 42 /// </summary>
43 private readonly List<AssetRequest> AssetRequests; 43 private List<AssetRequest> AssetRequests;
44 44
45 private readonly Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>(); 45 private Scene m_scene;
46 private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>();
46 47
47 /// 48 ///
48 /// Assets requests (for each user) which are waiting for asset server data. This includes texture requests 49 /// Assets requests (for each user) which are waiting for asset server data. This includes texture requests
49 /// </summary> 50 /// </summary>
50 private readonly Dictionary<LLUUID, Dictionary<LLUUID, AssetRequest>> RequestedAssets; 51 private Dictionary<LLUUID, Dictionary<LLUUID, AssetRequest>> RequestedAssets;
51
52 private Scene m_scene;
53 52
54 public AssetDownloadModule() 53 public AssetDownloadModule()
55 { 54 {
@@ -206,18 +205,22 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload
206 { 205 {
207 public AssetBase AssetInf; 206 public AssetBase AssetInf;
208 public byte AssetRequestSource = 2; 207 public byte AssetRequestSource = 2;
209 public long DataPointer; 208 public long DataPointer = 0;
210 public int DiscardLevel = -1; 209 public int DiscardLevel = -1;
211 public AssetBase ImageInfo; 210 public AssetBase ImageInfo;
212 public bool IsTextureRequest; 211 public bool IsTextureRequest;
213 public int NumPackets; 212 public int NumPackets = 0;
214 public int PacketCounter; 213 public int PacketCounter = 0;
215 public byte[] Params; 214 public byte[] Params = null;
216 public LLUUID RequestAssetID; 215 public LLUUID RequestAssetID;
217 public IClientAPI RequestUser; 216 public IClientAPI RequestUser;
218 public LLUUID TransferRequestID; 217 public LLUUID TransferRequestID;
219 //public bool AssetInCache; 218 //public bool AssetInCache;
220 //public int TimeRequested; 219 //public int TimeRequested;
220
221 public AssetRequest()
222 {
223 }
221 } 224 }
222 225
223 #endregion 226 #endregion
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 008daa2..555d5f4 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
44 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 44 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 // Fields 46 // Fields
47 private readonly bool m_dumpAssetsToFile; 47 private bool m_dumpAssetsToFile;
48 public AgentAssetTransactionsManager Manager; 48 public AgentAssetTransactionsManager Manager;
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>();
@@ -141,23 +141,23 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
141 public class AssetXferUploader 141 public class AssetXferUploader
142 { 142 {
143 // Fields 143 // Fields
144 private readonly bool m_dumpAssetToFile;
145 private readonly AgentAssetTransactions m_userTransactions;
146 public bool AddToInventory; 144 public bool AddToInventory;
147 public AssetBase Asset; 145 public AssetBase Asset;
148 public LLUUID InventFolder = LLUUID.Zero; 146 public LLUUID InventFolder = LLUUID.Zero;
149 private sbyte invType; 147 private sbyte invType = 0;
150 private bool m_createItem; 148 private bool m_createItem = false;
151 private string m_description = String.Empty; 149 private string m_description = String.Empty;
152 private bool m_finished; 150 private bool m_dumpAssetToFile;
151 private bool m_finished = false;
153 private string m_name = String.Empty; 152 private string m_name = String.Empty;
154 private bool m_storeLocal; 153 private bool m_storeLocal;
155 private uint nextPerm; 154 private AgentAssetTransactions m_userTransactions;
155 private uint nextPerm = 0;
156 private IClientAPI ourClient; 156 private IClientAPI ourClient;
157 public LLUUID TransactionID = LLUUID.Zero; 157 public LLUUID TransactionID = LLUUID.Zero;
158 private sbyte type; 158 private sbyte type = 0;
159 public bool UploadComplete; 159 public bool UploadComplete;
160 private byte wearableType; 160 private byte wearableType = 0;
161 public ulong XferID; 161 public ulong XferID;
162 162
163 public AssetXferUploader(AgentAssetTransactions transactions, bool dumpAssetToFile) 163 public AssetXferUploader(AgentAssetTransactions transactions, bool dumpAssetToFile)
@@ -390,7 +390,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
390 item.BasePermissions = 2147483647; 390 item.BasePermissions = 2147483647;
391 item.CurrentPermissions = 2147483647; 391 item.CurrentPermissions = 2147483647;
392 item.NextPermissions = nextPerm; 392 item.NextPermissions = nextPerm;
393 item.Flags = wearableType; 393 item.Flags = (uint) wearableType;
394 394
395 userInfo.AddItem(ourClient.AgentId, item); 395 userInfo.AddItem(ourClient.AgentId, item);
396 ourClient.SendInventoryItemCreateUpdate(item); 396 ourClient.SendInventoryItemCreateUpdate(item);
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
index d7f5804..fcd0e0c 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
@@ -40,11 +40,16 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
40 public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions 40 public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions
41 { 41 {
42 private readonly Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>(); 42 private readonly Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>();
43 private bool m_dumpAssetsToFile; 43 private bool m_dumpAssetsToFile = false;
44 private Scene m_scene; 44 private Scene m_scene = null;
45 45
46 private AgentAssetTransactionsManager m_transactionManager; 46 private AgentAssetTransactionsManager m_transactionManager;
47 47
48 public AssetTransactionModule()
49 {
50 // System.Console.WriteLine("creating AgentAssetTransactionModule");
51 }
52
48 #region IAgentAssetTransactions Members 53 #region IAgentAssetTransactions Members
49 54
50 public void HandleItemCreationFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, 55 public void HandleItemCreationFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID,
@@ -140,13 +145,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
140 /// <summary> 145 /// <summary>
141 /// Each agent has its own singleton collection of transactions 146 /// Each agent has its own singleton collection of transactions
142 /// </summary> 147 /// </summary>
143 private readonly Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = 148 private Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions =
144 new Dictionary<LLUUID, AgentAssetTransactions>(); 149 new Dictionary<LLUUID, AgentAssetTransactions>();
145 150
146 /// <summary> 151 /// <summary>
147 /// Should we dump uploaded assets to the filesystem? 152 /// Should we dump uploaded assets to the filesystem?
148 /// </summary> 153 /// </summary>
149 private readonly bool m_dumpAssetsToFile; 154 private bool m_dumpAssetsToFile;
150 155
151 public Scene MyScene; 156 public Scene MyScene;
152 157
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
index 96ef61f..474ac75 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
@@ -47,8 +47,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
47 private readonly BlockingQueue<ITextureSender> m_queueSenders 47 private readonly BlockingQueue<ITextureSender> m_queueSenders
48 = new BlockingQueue<ITextureSender>(); 48 = new BlockingQueue<ITextureSender>();
49 49
50 private readonly List<Scene> m_scenes = new List<Scene>();
51
52 /// <summary> 50 /// <summary>
53 /// Each user has their own texture download service. 51 /// Each user has their own texture download service.
54 /// </summary> 52 /// </summary>
@@ -56,9 +54,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
56 new Dictionary<LLUUID, UserTextureDownloadService>(); 54 new Dictionary<LLUUID, UserTextureDownloadService>();
57 55
58 private Scene m_scene; 56 private Scene m_scene;
57 private List<Scene> m_scenes = new List<Scene>();
59 58
60 private Thread m_thread; 59 private Thread m_thread;
61 60
61 public TextureDownloadModule()
62 {
63 }
64
62 #region IRegionModule Members 65 #region IRegionModule Members
63 66
64 public void Initialise(Scene scene, IConfigSource config) 67 public void Initialise(Scene scene, IConfigSource config)
@@ -66,7 +69,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
66 if (m_scene == null) 69 if (m_scene == null)
67 { 70 {
68 //Console.WriteLine("Creating Texture download module"); 71 //Console.WriteLine("Creating Texture download module");
69 m_thread = new Thread(ProcessTextureSenders); 72 m_thread = new Thread(new ThreadStart(ProcessTextureSenders));
70 m_thread.Name = "ProcessTextureSenderThread"; 73 m_thread.Name = "ProcessTextureSenderThread";
71 m_thread.IsBackground = true; 74 m_thread.IsBackground = true;
72 m_thread.Start(); 75 m_thread.Start();
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
index 7d4c919..70e44d4 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
@@ -40,13 +40,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
40 //private static readonly log4net.ILog m_log 40 //private static readonly log4net.ILog m_log
41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 private readonly LLUUID m_textureId; 43 private bool m_cancel = false;
44 private bool m_cancel;
45 private IClientAPI m_client; 44 private IClientAPI m_client;
46 45
47 // See ITextureSender 46 // See ITextureSender
48 47
49 private bool m_sending; 48 private bool m_sending = false;
49 private LLUUID m_textureId;
50 50
51 // See ITextureSender 51 // See ITextureSender
52 52
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
index 44b9a23..02c541b 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
@@ -43,14 +43,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
43 private static readonly ILog m_log 43 private static readonly ILog m_log
44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 private readonly IClientAPI RequestUser;
47
48 /// <summary> 46 /// <summary>
49 /// Records the number of times texture send has been called. 47 /// Records the number of times texture send has been called.
50 /// </summary> 48 /// </summary>
51 public int counter; 49 public int counter = 0;
52 50
53 public bool ImageLoaded; 51 public bool ImageLoaded = false;
54 52
55 /// <summary> 53 /// <summary>
56 /// Holds the texture asset to send. 54 /// Holds the texture asset to send.
@@ -59,26 +57,27 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
59 57
60 //public LLUUID assetID { get { return m_asset.FullID; } } 58 //public LLUUID assetID { get { return m_asset.FullID; } }
61 59
62 private bool m_cancel; 60 private bool m_cancel = false;
63 61
64 // See ITextureSender 62 // See ITextureSender
65 63
66 private bool m_sending; 64 private bool m_sending = false;
67 65
68 /// <summary> 66 /// <summary>
69 /// This is actually the number of extra packets required to send the texture data! We always assume 67 /// This is actually the number of extra packets required to send the texture data! We always assume
70 /// at least one is required. 68 /// at least one is required.
71 /// </summary> 69 /// </summary>
72 private int NumPackets; 70 private int NumPackets = 0;
73 71
74 /// <summary> 72 /// <summary>
75 /// Holds the packet number to send next. In this case, each packet is 1000 bytes long and starts 73 /// Holds the packet number to send next. In this case, each packet is 1000 bytes long and starts
76 /// at the 600th byte (0th indexed). 74 /// at the 600th byte (0th indexed).
77 /// </summary> 75 /// </summary>
78 private int PacketCounter; 76 private int PacketCounter = 0;
79 77
80 private int RequestedDiscardLevel = -1; 78 private int RequestedDiscardLevel = -1;
81 private uint StartPacketNumber; 79 private IClientAPI RequestUser;
80 private uint StartPacketNumber = 0;
82 81
83 public TextureSender(IClientAPI client, int discardLevel, uint packetNumber) 82 public TextureSender(IClientAPI client, int discardLevel, uint packetNumber)
84 { 83 {
@@ -191,7 +190,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
191 catch (ArgumentOutOfRangeException) 190 catch (ArgumentOutOfRangeException)
192 { 191 {
193 m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + 192 m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" +
194 m_asset.FullID); 193 m_asset.FullID.ToString());
195 return; 194 return;
196 } 195 }
197 RequestUser.OutPacket(im, ThrottleOutPacketType.Texture); 196 RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
diff --git a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
index eaf2198..8e90d17 100644
--- a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
@@ -41,6 +41,10 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
41 public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>(); 41 public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>();
42 public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>(); 42 public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>();
43 43
44 public XferModule()
45 {
46 }
47
44 #region IRegionModule Members 48 #region IRegionModule Members
45 49
46 public void Initialise(Scene scene, IConfigSource config) 50 public void Initialise(Scene scene, IConfigSource config)
@@ -145,11 +149,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
145 public IClientAPI Client; 149 public IClientAPI Client;
146 private bool complete; 150 private bool complete;
147 public byte[] Data = new byte[0]; 151 public byte[] Data = new byte[0];
148 public int DataPointer; 152 public int DataPointer = 0;
149 public string FileName = String.Empty; 153 public string FileName = String.Empty;
150 public uint Packet; 154 public uint Packet = 0;
151 public uint Serial = 1; 155 public uint Serial = 1;
152 public ulong XferID; 156 public ulong XferID = 0;
153 157
154 public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client) 158 public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client)
155 { 159 {
@@ -213,7 +217,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
213 { 217 {
214 byte[] transferData = new byte[Data.Length - DataPointer]; 218 byte[] transferData = new byte[Data.Length - DataPointer];
215 Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); 219 Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer);
216 uint endPacket = Packet |= 0x80000000; 220 uint endPacket = Packet |= (uint) 0x80000000;
217 Client.SendXferPacket(XferID, endPacket, transferData); 221 Client.SendXferPacket(XferID, endPacket, transferData);
218 Packet++; 222 Packet++;
219 DataPointer += (Data.Length - DataPointer); 223 DataPointer += (Data.Length - DataPointer);