mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -187,18 +187,20 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
|
||||
int start, end;
|
||||
if (TryParseRange(range, out start, out end))
|
||||
{
|
||||
end = Utils.Clamp(end, 1, texture.Data.Length);
|
||||
end = Utils.Clamp(end, 1, texture.Data.Length - 1);
|
||||
start = Utils.Clamp(start, 0, end - 1);
|
||||
int len = end - start + 1;
|
||||
|
||||
//m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
|
||||
|
||||
if (end - start < texture.Data.Length)
|
||||
if (len < texture.Data.Length)
|
||||
response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;
|
||||
|
||||
response.ContentLength = end - start;
|
||||
response.ContentLength = len;
|
||||
response.ContentType = texture.Metadata.ContentType;
|
||||
response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length));
|
||||
|
||||
response.Body.Write(texture.Data, start, end - start);
|
||||
response.Body.Write(texture.Data, start, len);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
itemID = group.GetFromItemID();
|
||||
}
|
||||
|
||||
SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group);
|
||||
ShowAttachInUserInventory(remoteClient, AttachmentPt, itemID, group);
|
||||
|
||||
AttachToAgent(sp, group, AttachmentPt, attachPos, silent);
|
||||
}
|
||||
@@ -219,8 +219,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
|
||||
{
|
||||
m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name);
|
||||
|
||||
return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true);
|
||||
}
|
||||
|
||||
@@ -238,11 +236,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
if (updateInventoryStatus)
|
||||
{
|
||||
if (att == null)
|
||||
{
|
||||
ShowDetachInUserInventory(itemID, remoteClient);
|
||||
}
|
||||
|
||||
SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt);
|
||||
else
|
||||
ShowAttachInUserInventory(att, remoteClient, itemID, AttachmentPt);
|
||||
}
|
||||
|
||||
if (null == att)
|
||||
@@ -313,12 +309,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
return null;
|
||||
}
|
||||
|
||||
public UUID SetAttachmentInventoryStatus(
|
||||
/// <summary>
|
||||
/// Update the user inventory to the attachment of an item
|
||||
/// </summary>
|
||||
/// <param name="att"></param>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="itemID"></param>
|
||||
/// <param name="AttachmentPt"></param>
|
||||
/// <returns></returns>
|
||||
protected UUID ShowAttachInUserInventory(
|
||||
SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
|
||||
remoteClient.Name, att.Name, itemID);
|
||||
// m_log.DebugFormat(
|
||||
// "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
|
||||
// remoteClient.Name, att.Name, itemID);
|
||||
|
||||
if (!att.IsDeleted)
|
||||
AttachmentPt = att.RootPart.AttachmentPoint;
|
||||
@@ -343,7 +347,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
/// <param name="AttachmentPt"></param>
|
||||
/// <param name="itemID"></param>
|
||||
/// <param name="att"></param>
|
||||
public void SetAttachmentInventoryStatus(
|
||||
protected void ShowAttachInUserInventory(
|
||||
IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
@@ -407,7 +411,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
// Save avatar attachment information
|
||||
if (m_scene.AvatarFactory != null)
|
||||
{
|
||||
m_log.Debug("[ATTACHMENTS MODULE]: Dettaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
|
||||
m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
|
||||
m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
|
||||
public void UpdateDatabase(UUID user, AvatarAppearance appearance)
|
||||
{
|
||||
m_log.DebugFormat("[APPEARANCE]: UpdateDatabase");
|
||||
//m_log.DebugFormat("[APPEARANCE]: UpdateDatabase");
|
||||
AvatarData adata = new AvatarData(appearance);
|
||||
m_scene.AvatarService.SetAvatar(user, adata);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user