diff options
Diffstat (limited to 'OpenSim/Region')
4 files changed, 33 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index b91eb83..733392f 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -1618,19 +1618,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
1618 | { | 1618 | { |
1619 | string sceneObjectXml = objectGroup.ToXmlString(); | 1619 | string sceneObjectXml = objectGroup.ToXmlString(); |
1620 | 1620 | ||
1621 | CachedUserInfo userInfo = | 1621 | CachedUserInfo userInfo; |
1622 | CommsManager.UserProfileCacheService.GetUserDetails( | ||
1623 | remoteClient.AgentId); | ||
1624 | 1622 | ||
1625 | if (remoteClient == null) | 1623 | if (remoteClient == null) |
1626 | { | 1624 | { |
1627 | userInfo = CommsManager.UserProfileCacheService.GetUserDetails( | 1625 | userInfo = CommsManager.UserProfileCacheService.GetUserDetails( |
1628 | objectGroup.RootPart.OwnerID); | 1626 | objectGroup.RootPart.OwnerID); |
1629 | } | 1627 | } |
1630 | else | 1628 | else |
1631 | { | 1629 | { |
1632 | userInfo = CommsManager.UserProfileCacheService.GetUserDetails( | 1630 | userInfo = CommsManager.UserProfileCacheService.GetUserDetails( |
1633 | remoteClient.AgentId); | 1631 | remoteClient.AgentId); |
1634 | } | 1632 | } |
1635 | 1633 | ||
1636 | if (userInfo != null) | 1634 | if (userInfo != null) |
@@ -1648,9 +1646,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
1648 | (int)AssetType.LostAndFoundFolder); | 1646 | (int)AssetType.LostAndFoundFolder); |
1649 | 1647 | ||
1650 | if (folder != null) | 1648 | if (folder != null) |
1649 | { | ||
1651 | folderID = folder.ID; | 1650 | folderID = folder.ID; |
1651 | } | ||
1652 | else | 1652 | else |
1653 | folderID = userInfo.RootFolder.ID; | 1653 | { |
1654 | if (userInfo.RootFolder != null) | ||
1655 | { | ||
1656 | folderID = userInfo.RootFolder.ID; | ||
1657 | } | ||
1658 | else | ||
1659 | { | ||
1660 | CommsManager.UserProfileCacheService.RequestInventoryForUser(objectGroup.RootPart.OwnerID); | ||
1661 | m_log.WarnFormat("[SCENE] Can't find root folder for user, requesting inventory"); | ||
1662 | return; | ||
1663 | } | ||
1664 | } | ||
1654 | } | 1665 | } |
1655 | 1666 | ||
1656 | AssetBase asset = CreateAsset( | 1667 | AssetBase asset = CreateAsset( |
@@ -1677,7 +1688,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1677 | item.InvType = (int)InventoryType.Object; | 1688 | item.InvType = (int)InventoryType.Object; |
1678 | item.Folder = folderID; | 1689 | item.Folder = folderID; |
1679 | 1690 | ||
1680 | if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) | 1691 | if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) |
1681 | { | 1692 | { |
1682 | uint perms=objectGroup.GetEffectivePermissions(); | 1693 | uint perms=objectGroup.GetEffectivePermissions(); |
1683 | uint nextPerms=(perms & 7) << 13; | 1694 | uint nextPerms=(perms & 7) << 13; |
@@ -1706,7 +1717,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1706 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 1717 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
1707 | 1718 | ||
1708 | userInfo.AddItem(item); | 1719 | userInfo.AddItem(item); |
1709 | if (item.Owner == remoteClient.AgentId) | 1720 | if (remoteClient != null && item.Owner == remoteClient.AgentId) |
1710 | { | 1721 | { |
1711 | remoteClient.SendInventoryItemCreateUpdate(item); | 1722 | remoteClient.SendInventoryItemCreateUpdate(item); |
1712 | } | 1723 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 139281d..50d0a72 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -3385,6 +3385,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
3385 | // User needs to be logged into this sim | 3385 | // User needs to be logged into this sim |
3386 | if (m_scenePresences.ContainsKey(agentID)) | 3386 | if (m_scenePresences.ContainsKey(agentID)) |
3387 | { | 3387 | { |
3388 | if (godLike == false) | ||
3389 | { | ||
3390 | m_scenePresences[agentID].GrantGodlikePowers(agentID, sessionID, token, godLike); | ||
3391 | return; | ||
3392 | } | ||
3393 | |||
3388 | // First check that this is the sim owner | 3394 | // First check that this is the sim owner |
3389 | if (ExternalChecks.ExternalChecksCanBeGodLike(agentID)) | 3395 | if (ExternalChecks.ExternalChecksCanBeGodLike(agentID)) |
3390 | { | 3396 | { |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 60cf061..f24e6fb 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -1009,7 +1009,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1009 | // that they don't happen, otherwise the deleted objects will reappear | 1009 | // that they don't happen, otherwise the deleted objects will reappear |
1010 | m_isDeleted = true; | 1010 | m_isDeleted = true; |
1011 | 1011 | ||
1012 | DetachFromBackup(); | 1012 | // DetachFromBackup(); |
1013 | 1013 | ||
1014 | foreach (SceneObjectPart part in m_parts.Values) | 1014 | foreach (SceneObjectPart part in m_parts.Values) |
1015 | { | 1015 | { |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 4517d11..2caeb14 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -580,7 +580,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
580 | { | 580 | { |
581 | m_pendingObjects = new Queue<SceneObjectGroup>(); | 581 | m_pendingObjects = new Queue<SceneObjectGroup>(); |
582 | 582 | ||
583 | foreach (EntityBase e in m_scene.Entities.Values) | 583 | List<EntityBase> ents = new List<EntityBase>(m_scene.Entities.Values); |
584 | ents.Sort(delegate(EntityBase a, EntityBase b) | ||
585 | { | ||
586 | return Vector3.Distance(AbsolutePosition, a.AbsolutePosition).CompareTo(Vector3.Distance(AbsolutePosition, b.AbsolutePosition)); | ||
587 | }); | ||
588 | |||
589 | foreach (EntityBase e in ents) | ||
584 | if (e is SceneObjectGroup) | 590 | if (e is SceneObjectGroup) |
585 | m_pendingObjects.Enqueue((SceneObjectGroup)e); | 591 | m_pendingObjects.Enqueue((SceneObjectGroup)e); |
586 | } | 592 | } |