Merge branch 'master' into careminster-presence-refactor
commit
1dce243661
|
@ -25,6 +25,7 @@
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
@ -73,31 +74,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent)
|
public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent)
|
||||||
{
|
{
|
||||||
m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
|
m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
|
||||||
|
|
||||||
// If we can't take it, we can't attach it!
|
|
||||||
SceneObjectPart part = m_scene.GetSceneObjectPart(objectLocalID);
|
|
||||||
if (part == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId))
|
try
|
||||||
return;
|
|
||||||
|
|
||||||
// Calls attach with a Zero position
|
|
||||||
if (AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false))
|
|
||||||
{
|
{
|
||||||
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
|
// If we can't take it, we can't attach it!
|
||||||
|
SceneObjectPart part = m_scene.GetSceneObjectPart(objectLocalID);
|
||||||
// Save avatar attachment information
|
if (part == null)
|
||||||
ScenePresence presence;
|
return;
|
||||||
if (m_scene.AvatarFactory != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
|
|
||||||
|
if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Calls attach with a Zero position
|
||||||
|
if (AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false))
|
||||||
{
|
{
|
||||||
m_log.Info(
|
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
|
||||||
"[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
|
|
||||||
+ ", AttachmentPoint: " + AttachmentPt);
|
// Save avatar attachment information
|
||||||
|
ScenePresence presence;
|
||||||
m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
|
if (m_scene.AvatarFactory != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
|
||||||
|
{
|
||||||
|
m_log.Info(
|
||||||
|
"[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
|
||||||
|
+ ", AttachmentPoint: " + AttachmentPt);
|
||||||
|
|
||||||
|
m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[ATTACHMENTS MODULE]: exception upon Attach Object {0}", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AttachObject(
|
public bool AttachObject(
|
||||||
|
|
|
@ -1755,7 +1755,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
item.AssetType = asset.Type;
|
item.AssetType = asset.Type;
|
||||||
item.InvType = (int)InventoryType.Object;
|
item.InvType = (int)InventoryType.Object;
|
||||||
|
|
||||||
item.Folder = UUID.Zero; // Objects folder!
|
InventoryFolderBase folder = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.Object);
|
||||||
|
if (folder != null)
|
||||||
|
item.Folder = folder.ID;
|
||||||
|
else // oopsies
|
||||||
|
item.Folder = UUID.Zero;
|
||||||
|
|
||||||
if ((remoteClient.AgentId != grp.RootPart.OwnerID) && Permissions.PropagatePermissions())
|
if ((remoteClient.AgentId != grp.RootPart.OwnerID) && Permissions.PropagatePermissions())
|
||||||
{
|
{
|
||||||
|
|
|
@ -1206,6 +1206,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return;
|
return;
|
||||||
|
|
||||||
detachedpos = avatar.AbsolutePosition;
|
detachedpos = avatar.AbsolutePosition;
|
||||||
|
RootPart.FromItemID = UUID.Zero;
|
||||||
|
|
||||||
AbsolutePosition = detachedpos;
|
AbsolutePosition = detachedpos;
|
||||||
m_rootPart.AttachedAvatar = UUID.Zero;
|
m_rootPart.AttachedAvatar = UUID.Zero;
|
||||||
|
|
Loading…
Reference in New Issue