diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules')
3 files changed, 24 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 8aa87fd..a3238df 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | |||
@@ -187,18 +187,20 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
187 | int start, end; | 187 | int start, end; |
188 | if (TryParseRange(range, out start, out end)) | 188 | if (TryParseRange(range, out start, out end)) |
189 | { | 189 | { |
190 | end = Utils.Clamp(end, 1, texture.Data.Length); | 190 | end = Utils.Clamp(end, 1, texture.Data.Length - 1); |
191 | start = Utils.Clamp(start, 0, end - 1); | 191 | start = Utils.Clamp(start, 0, end - 1); |
192 | int len = end - start + 1; | ||
192 | 193 | ||
193 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); | 194 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); |
194 | 195 | ||
195 | if (end - start < texture.Data.Length) | 196 | if (len < texture.Data.Length) |
196 | response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent; | 197 | response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent; |
197 | 198 | ||
198 | response.ContentLength = end - start; | 199 | response.ContentLength = len; |
199 | response.ContentType = texture.Metadata.ContentType; | 200 | response.ContentType = texture.Metadata.ContentType; |
201 | response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length)); | ||
200 | 202 | ||
201 | response.Body.Write(texture.Data, start, end - start); | 203 | response.Body.Write(texture.Data, start, len); |
202 | } | 204 | } |
203 | else | 205 | else |
204 | { | 206 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index e1c0949..5378930 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
191 | itemID = group.GetFromItemID(); | 191 | itemID = group.GetFromItemID(); |
192 | } | 192 | } |
193 | 193 | ||
194 | SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group); | 194 | ShowAttachInUserInventory(remoteClient, AttachmentPt, itemID, group); |
195 | 195 | ||
196 | AttachToAgent(sp, group, AttachmentPt, attachPos, silent); | 196 | AttachToAgent(sp, group, AttachmentPt, attachPos, silent); |
197 | } | 197 | } |
@@ -219,8 +219,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
219 | 219 | ||
220 | public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | 220 | public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt) |
221 | { | 221 | { |
222 | m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name); | ||
223 | |||
224 | return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true); | 222 | return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true); |
225 | } | 223 | } |
226 | 224 | ||
@@ -238,11 +236,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
238 | if (updateInventoryStatus) | 236 | if (updateInventoryStatus) |
239 | { | 237 | { |
240 | if (att == null) | 238 | if (att == null) |
241 | { | ||
242 | ShowDetachInUserInventory(itemID, remoteClient); | 239 | ShowDetachInUserInventory(itemID, remoteClient); |
243 | } | 240 | else |
244 | 241 | ShowAttachInUserInventory(att, remoteClient, itemID, AttachmentPt); | |
245 | SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt); | ||
246 | } | 242 | } |
247 | 243 | ||
248 | if (null == att) | 244 | if (null == att) |
@@ -313,12 +309,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
313 | return null; | 309 | return null; |
314 | } | 310 | } |
315 | 311 | ||
316 | public UUID SetAttachmentInventoryStatus( | 312 | /// <summary> |
313 | /// Update the user inventory to the attachment of an item | ||
314 | /// </summary> | ||
315 | /// <param name="att"></param> | ||
316 | /// <param name="remoteClient"></param> | ||
317 | /// <param name="itemID"></param> | ||
318 | /// <param name="AttachmentPt"></param> | ||
319 | /// <returns></returns> | ||
320 | protected UUID ShowAttachInUserInventory( | ||
317 | SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | 321 | SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) |
318 | { | 322 | { |
319 | m_log.DebugFormat( | 323 | // m_log.DebugFormat( |
320 | "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})", | 324 | // "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})", |
321 | remoteClient.Name, att.Name, itemID); | 325 | // remoteClient.Name, att.Name, itemID); |
322 | 326 | ||
323 | if (!att.IsDeleted) | 327 | if (!att.IsDeleted) |
324 | AttachmentPt = att.RootPart.AttachmentPoint; | 328 | AttachmentPt = att.RootPart.AttachmentPoint; |
@@ -343,7 +347,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
343 | /// <param name="AttachmentPt"></param> | 347 | /// <param name="AttachmentPt"></param> |
344 | /// <param name="itemID"></param> | 348 | /// <param name="itemID"></param> |
345 | /// <param name="att"></param> | 349 | /// <param name="att"></param> |
346 | public void SetAttachmentInventoryStatus( | 350 | protected void ShowAttachInUserInventory( |
347 | IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) | 351 | IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) |
348 | { | 352 | { |
349 | // m_log.DebugFormat( | 353 | // m_log.DebugFormat( |
@@ -407,7 +411,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
407 | // Save avatar attachment information | 411 | // Save avatar attachment information |
408 | if (m_scene.AvatarFactory != null) | 412 | if (m_scene.AvatarFactory != null) |
409 | { | 413 | { |
410 | m_log.Debug("[ATTACHMENTS MODULE]: Dettaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); | 414 | m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); |
411 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 415 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); |
412 | } | 416 | } |
413 | } | 417 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 7e5a8ec..22c8937 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -198,7 +198,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
198 | 198 | ||
199 | public void UpdateDatabase(UUID user, AvatarAppearance appearance) | 199 | public void UpdateDatabase(UUID user, AvatarAppearance appearance) |
200 | { | 200 | { |
201 | m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); | 201 | //m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); |
202 | AvatarData adata = new AvatarData(appearance); | 202 | AvatarData adata = new AvatarData(appearance); |
203 | m_scene.AvatarService.SetAvatar(user, adata); | 203 | m_scene.AvatarService.SetAvatar(user, adata); |
204 | } | 204 | } |