aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Agent
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent')
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs9
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs21
-rw-r--r--OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs28
4 files changed, 50 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 0271738..f56d17d 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -33,6 +33,7 @@ using OpenSim.Framework;
33 33
34using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
35using OpenSim.Services.Interfaces; 35using OpenSim.Services.Interfaces;
36using OpenSim.Region.Framework.Interfaces;
36 37
37namespace OpenSim.Region.CoreModules.Agent.AssetTransaction 38namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
38{ 39{
@@ -119,6 +120,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
119 } 120 }
120 else 121 else
121 { 122 {
123 // Check if the xfer is a terrain xfer
124 IEstateModule estateModule = m_Scene.RequestModuleInterface<IEstateModule>();
125 if (estateModule != null)
126 {
127 if (estateModule.IsTerrainXfer(xferID))
128 return;
129 }
130
122 m_log.ErrorFormat( 131 m_log.ErrorFormat(
123 "[AGENT ASSET TRANSACTIONS]: Could not find uploader for xfer id {0}, packet id {1}, data length {2}", 132 "[AGENT ASSET TRANSACTIONS]: Could not find uploader for xfer id {0}, packet id {1}, data length {2}",
124 xferID, packetID, data.Length); 133 xferID, packetID, data.Length);
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
index d1ad74f..b67c0df 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
42 public class AssetTransactionModule : INonSharedRegionModule, 42 public class AssetTransactionModule : INonSharedRegionModule,
43 IAgentAssetTransactions 43 IAgentAssetTransactions
44 { 44 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 protected Scene m_Scene; 47 protected Scene m_Scene;
48 private bool m_dumpAssetsToFile = false; 48 private bool m_dumpAssetsToFile = false;
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
index 11efe6d..5143204 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -31,8 +31,10 @@ using System.Reflection;
31using log4net; 31using log4net;
32using OpenMetaverse; 32using OpenMetaverse;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Region.Framework.Interfaces;
34using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
35using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
37using PermissionMask = OpenSim.Framework.PermissionMask;
36 38
37namespace OpenSim.Region.CoreModules.Agent.AssetTransaction 39namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
38{ 40{
@@ -317,12 +319,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
317 m_asset.Description = item.Description; 319 m_asset.Description = item.Description;
318 m_asset.Type = (sbyte)item.AssetType; 320 m_asset.Type = (sbyte)item.AssetType;
319 321
320 // We must always store the item at this point even if the asset hasn't finished uploading, in order 322 if (m_asset.FullID != UUID.Zero)
321 // to avoid a race condition when the appearance module retrieves the item to set the asset id in 323 {
322 // the AvatarAppearance structure. 324 // We must always store the item at this point even if the asset hasn't finished uploading, in order
323 item.AssetID = m_asset.FullID; 325 // to avoid a race condition when the appearance module retrieves the item to set the asset id in
324 if (item.AssetID != UUID.Zero) 326 // the AvatarAppearance structure.
327 item.AssetID = m_asset.FullID;
325 m_Scene.InventoryService.UpdateItem(item); 328 m_Scene.InventoryService.UpdateItem(item);
329 }
326 330
327 if (m_uploadState == UploadState.Complete) 331 if (m_uploadState == UploadState.Complete)
328 { 332 {
@@ -375,6 +379,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
375 m_Scene.AssetService.Store(m_asset); 379 m_Scene.AssetService.Store(m_asset);
376 380
377 m_transactions.RemoveXferUploader(m_transactionID); 381 m_transactions.RemoveXferUploader(m_transactionID);
382
383 m_Scene.EventManager.TriggerOnNewInventoryItemUploadComplete(ourClient.AgentId, (AssetType)type, m_asset.FullID, m_asset.Name, 0);
378 } 384 }
379 385
380 /// <summary> 386 /// <summary>
@@ -406,8 +412,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
406 item.AssetType = type; 412 item.AssetType = type;
407 item.InvType = invType; 413 item.InvType = invType;
408 item.Folder = InventFolder; 414 item.Folder = InventFolder;
409 item.BasePermissions = 0x7fffffff; 415 item.BasePermissions = (uint)(PermissionMask.All | PermissionMask.Export);
410 item.CurrentPermissions = 0x7fffffff; 416 item.CurrentPermissions = item.BasePermissions;
411 item.GroupPermissions=0; 417 item.GroupPermissions=0;
412 item.EveryOnePermissions=0; 418 item.EveryOnePermissions=0;
413 item.NextPermissions = nextPerm; 419 item.NextPermissions = nextPerm;
@@ -421,5 +427,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
421 427
422 m_transactions.RemoveXferUploader(m_transactionID); 428 m_transactions.RemoveXferUploader(m_transactionID);
423 } 429 }
430
424 } 431 }
425} \ No newline at end of file 432} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
index 3764685..47dcbcd 100644
--- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Drawing;
30using System.IO; 31using System.IO;
31using System.Reflection; 32using System.Reflection;
32using System.Text; 33using System.Text;
@@ -166,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
166 167
167 // Do Decode! 168 // Do Decode!
168 if (decode) 169 if (decode)
169 Decode(assetID, j2kData); 170 Util.FireAndForget(delegate { Decode(assetID, j2kData); }, null, "J2KDecoderModule.BeginDecode");
170 } 171 }
171 } 172 }
172 173
@@ -182,6 +183,25 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
182 return DoJ2KDecode(assetID, j2kData, out layers, out components); 183 return DoJ2KDecode(assetID, j2kData, out layers, out components);
183 } 184 }
184 185
186 public Image DecodeToImage(byte[] j2kData)
187 {
188 if (m_useCSJ2K)
189 return J2kImage.FromBytes(j2kData);
190 else
191 {
192 ManagedImage mimage;
193 Image image;
194 if (OpenJPEG.DecodeToImage(j2kData, out mimage, out image))
195 {
196 mimage = null;
197 return image;
198 }
199 else
200 return null;
201 }
202 }
203
204
185 #endregion IJ2KDecoder 205 #endregion IJ2KDecoder
186 206
187 /// <summary> 207 /// <summary>
@@ -211,7 +231,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
211 { 231 {
212 try 232 try
213 { 233 {
214 List<int> layerStarts = CSJ2K.J2kImage.GetLayerBoundaries(new MemoryStream(j2kData)); 234 List<int> layerStarts;
235 using (MemoryStream ms = new MemoryStream(j2kData))
236 {
237 layerStarts = CSJ2K.J2kImage.GetLayerBoundaries(ms);
238 }
215 239
216 if (layerStarts != null && layerStarts.Count > 0) 240 if (layerStarts != null && layerStarts.Count > 0)
217 { 241 {