diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent')
4 files changed, 49 insertions, 27 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index c9ee54f..d30e954 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | |||
@@ -30,7 +30,7 @@ using System.Reflection; | |||
30 | using log4net; | 30 | using log4net; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Communications.Cache; | 33 | |
34 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Services.Interfaces; | 35 | using OpenSim.Services.Interfaces; |
36 | 36 | ||
@@ -181,7 +181,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
181 | Manager.MyScene.AssetService.Store(asset); | 181 | Manager.MyScene.AssetService.Store(asset); |
182 | 182 | ||
183 | if (part.Inventory.UpdateInventoryItem(item)) | 183 | if (part.Inventory.UpdateInventoryItem(item)) |
184 | { | ||
185 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | ||
184 | part.GetProperties(remoteClient); | 186 | part.GetProperties(remoteClient); |
187 | } | ||
185 | } | 188 | } |
186 | } | 189 | } |
187 | } | 190 | } |
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index fa92fe8..c791cb4 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | |||
@@ -31,7 +31,7 @@ using System.Reflection; | |||
31 | using log4net; | 31 | using log4net; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications.Cache; | 34 | |
35 | using OpenSim.Services.Interfaces; | 35 | using OpenSim.Services.Interfaces; |
36 | 36 | ||
37 | namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | 37 | namespace OpenSim.Region.CoreModules.Agent.AssetTransaction |
@@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
112 | bool storeLocal, bool tempFile) | 112 | bool storeLocal, bool tempFile) |
113 | { | 113 | { |
114 | ourClient = remoteClient; | 114 | ourClient = remoteClient; |
115 | m_asset = new AssetBase(assetID, "blank", type); | 115 | m_asset = new AssetBase(assetID, "blank", type, remoteClient.AgentId.ToString()); |
116 | m_asset.Data = data; | 116 | m_asset.Data = data; |
117 | m_asset.Description = "empty"; | 117 | m_asset.Description = "empty"; |
118 | m_asset.Local = storeLocal; | 118 | m_asset.Local = storeLocal; |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs index 71ff28c..c7bf6c8 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs | |||
@@ -33,7 +33,7 @@ using log4net; | |||
33 | using Nini.Config; | 33 | using Nini.Config; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications.Cache; | 36 | |
37 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
39 | using BlockingQueue = OpenSim.Framework.BlockingQueue<OpenSim.Region.Framework.Interfaces.ITextureSender>; | 39 | using BlockingQueue = OpenSim.Framework.BlockingQueue<OpenSim.Region.Framework.Interfaces.ITextureSender>; |
@@ -214,8 +214,8 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload | |||
214 | { | 214 | { |
215 | Scene scene = (Scene)client.Scene; | 215 | Scene scene = (Scene)client.Scene; |
216 | 216 | ||
217 | CachedUserInfo profile = scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); | 217 | ScenePresence sp = scene.GetScenePresence(client.AgentId); |
218 | if (profile == null) // Deny unknown user | 218 | if (sp == null) // Deny unknown user |
219 | return; | 219 | return; |
220 | 220 | ||
221 | IInventoryService invService = scene.InventoryService; | 221 | IInventoryService invService = scene.InventoryService; |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 7ac8bed..1386e86 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs | |||
@@ -60,6 +60,8 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
60 | 60 | ||
61 | #region IRegionModule | 61 | #region IRegionModule |
62 | 62 | ||
63 | private bool m_useCSJ2K = true; | ||
64 | |||
63 | public string Name { get { return "J2KDecoderModule"; } } | 65 | public string Name { get { return "J2KDecoderModule"; } } |
64 | public bool IsSharedModule { get { return true; } } | 66 | public bool IsSharedModule { get { return true; } } |
65 | 67 | ||
@@ -73,6 +75,12 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
73 | m_scene = scene; | 75 | m_scene = scene; |
74 | 76 | ||
75 | scene.RegisterModuleInterface<IJ2KDecoder>(this); | 77 | scene.RegisterModuleInterface<IJ2KDecoder>(this); |
78 | |||
79 | IConfig startupConfig = source.Configs["Startup"]; | ||
80 | if (startupConfig != null) | ||
81 | { | ||
82 | m_useCSJ2K = startupConfig.GetBoolean("UseCSJ2K", m_useCSJ2K); | ||
83 | } | ||
76 | } | 84 | } |
77 | 85 | ||
78 | public void PostInitialise() | 86 | public void PostInitialise() |
@@ -144,41 +152,52 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
144 | /// <param name="j2kData">JPEG2000 data</param> | 152 | /// <param name="j2kData">JPEG2000 data</param> |
145 | private void DoJ2KDecode(UUID assetID, byte[] j2kData) | 153 | private void DoJ2KDecode(UUID assetID, byte[] j2kData) |
146 | { | 154 | { |
147 | // int DecodeTime = 0; | 155 | //int DecodeTime = 0; |
148 | // DecodeTime = Environment.TickCount; | 156 | //DecodeTime = Environment.TickCount; |
149 | OpenJPEG.J2KLayerInfo[] layers; | 157 | OpenJPEG.J2KLayerInfo[] layers; |
150 | 158 | ||
151 | if (!TryLoadCacheForAsset(assetID, out layers)) | 159 | if (!TryLoadCacheForAsset(assetID, out layers)) |
152 | { | 160 | { |
153 | try | 161 | if (m_useCSJ2K) |
154 | { | 162 | { |
155 | List<int> layerStarts = CSJ2K.J2kImage.GetLayerBoundaries(new MemoryStream(j2kData)); | 163 | try |
156 | |||
157 | if (layerStarts != null && layerStarts.Count > 0) | ||
158 | { | 164 | { |
159 | layers = new OpenJPEG.J2KLayerInfo[layerStarts.Count]; | 165 | List<int> layerStarts = CSJ2K.J2kImage.GetLayerBoundaries(new MemoryStream(j2kData)); |
160 | 166 | ||
161 | for (int i = 0; i < layerStarts.Count; i++) | 167 | if (layerStarts != null && layerStarts.Count > 0) |
162 | { | 168 | { |
163 | OpenJPEG.J2KLayerInfo layer = new OpenJPEG.J2KLayerInfo(); | 169 | layers = new OpenJPEG.J2KLayerInfo[layerStarts.Count]; |
170 | |||
171 | for (int i = 0; i < layerStarts.Count; i++) | ||
172 | { | ||
173 | OpenJPEG.J2KLayerInfo layer = new OpenJPEG.J2KLayerInfo(); | ||
164 | 174 | ||
165 | if (i == 0) | 175 | if (i == 0) |
166 | layer.Start = 0; | 176 | layer.Start = 0; |
167 | else | 177 | else |
168 | layer.Start = layerStarts[i]; | 178 | layer.Start = layerStarts[i]; |
169 | 179 | ||
170 | if (i == layerStarts.Count - 1) | 180 | if (i == layerStarts.Count - 1) |
171 | layer.End = j2kData.Length; | 181 | layer.End = j2kData.Length; |
172 | else | 182 | else |
173 | layer.End = layerStarts[i + 1] - 1; | 183 | layer.End = layerStarts[i + 1] - 1; |
174 | 184 | ||
175 | layers[i] = layer; | 185 | layers[i] = layer; |
186 | } | ||
176 | } | 187 | } |
177 | } | 188 | } |
189 | catch (Exception ex) | ||
190 | { | ||
191 | m_log.Warn("[J2KDecoderModule]: CSJ2K threw an exception decoding texture " + assetID + ": " + ex.Message); | ||
192 | } | ||
178 | } | 193 | } |
179 | catch (Exception ex) | 194 | else |
180 | { | 195 | { |
181 | m_log.Warn("[J2KDecoderModule]: CSJ2K threw an exception decoding texture " + assetID + ": " + ex.Message); | 196 | int components; |
197 | if (!OpenJPEG.DecodeLayerBoundaries(j2kData, out layers, out components)) | ||
198 | { | ||
199 | m_log.Warn("[J2KDecoderModule]: OpenJPEG failed to decode texture " + assetID); | ||
200 | } | ||
182 | } | 201 | } |
183 | 202 | ||
184 | if (layers == null || layers.Length == 0) | 203 | if (layers == null || layers.Length == 0) |
@@ -240,7 +259,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
240 | { | 259 | { |
241 | string assetID = "j2kCache_" + AssetId.ToString(); | 260 | string assetID = "j2kCache_" + AssetId.ToString(); |
242 | 261 | ||
243 | AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard); | 262 | AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard, m_scene.RegionInfo.RegionID.ToString()); |
244 | layerDecodeAsset.Local = true; | 263 | layerDecodeAsset.Local = true; |
245 | layerDecodeAsset.Temporary = true; | 264 | layerDecodeAsset.Temporary = true; |
246 | 265 | ||