diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 7b13213..560f807 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -709,6 +709,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
709 | agent.CallbackURI, region.RegionName); | 709 | agent.CallbackURI, region.RegionName); |
710 | } | 710 | } |
711 | 711 | ||
712 | /// <summary> | ||
713 | /// Clean up operations once an agent has moved away through cross or teleport. | ||
714 | /// </summary> | ||
715 | /// <param name='sp'></param> | ||
716 | /// <param name='logout'></param> | ||
712 | protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) | 717 | protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) |
713 | { | 718 | { |
714 | if (sp.Scene.AttachmentsModule != null) | 719 | if (sp.Scene.AttachmentsModule != null) |
@@ -1622,6 +1627,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1622 | #endregion | 1627 | #endregion |
1623 | 1628 | ||
1624 | #region Object Transfers | 1629 | #region Object Transfers |
1630 | |||
1625 | /// <summary> | 1631 | /// <summary> |
1626 | /// Move the given scene object into a new region depending on which region its absolute position has moved | 1632 | /// Move the given scene object into a new region depending on which region its absolute position has moved |
1627 | /// into. | 1633 | /// into. |
@@ -1932,35 +1938,43 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1932 | return successYN; | 1938 | return successYN; |
1933 | } | 1939 | } |
1934 | 1940 | ||
1935 | protected bool CrossAttachmentsIntoNewRegion(GridRegion destination, ScenePresence sp, bool silent) | 1941 | /// <summary> |
1942 | /// Cross the attachments for an avatar into the destination region. | ||
1943 | /// </summary> | ||
1944 | /// <remarks> | ||
1945 | /// This is only invoked for simulators released prior to April 2011. Versions of OpenSimulator since then | ||
1946 | /// transfer attachments in one go as part of the ChildAgentDataUpdate data passed in the update agent call. | ||
1947 | /// </remarks> | ||
1948 | /// <param name='destination'></param> | ||
1949 | /// <param name='sp'></param> | ||
1950 | /// <param name='silent'></param> | ||
1951 | protected void CrossAttachmentsIntoNewRegion(GridRegion destination, ScenePresence sp, bool silent) | ||
1936 | { | 1952 | { |
1937 | List<SceneObjectGroup> m_attachments = sp.GetAttachments(); | 1953 | List<SceneObjectGroup> attachments = sp.GetAttachments(); |
1938 | 1954 | ||
1939 | // Validate | 1955 | // m_log.DebugFormat( |
1940 | // foreach (SceneObjectGroup gobj in m_attachments) | 1956 | // "[ENTITY TRANSFER MODULE]: Crossing {0} attachments into {1} for {2}", |
1941 | // { | 1957 | // m_attachments.Count, destination.RegionName, sp.Name); |
1942 | // if (gobj == null || gobj.IsDeleted) | ||
1943 | // return false; | ||
1944 | // } | ||
1945 | 1958 | ||
1946 | foreach (SceneObjectGroup gobj in m_attachments) | 1959 | foreach (SceneObjectGroup gobj in attachments) |
1947 | { | 1960 | { |
1948 | // If the prim group is null then something must have happened to it! | 1961 | // If the prim group is null then something must have happened to it! |
1949 | if (gobj != null && !gobj.IsDeleted) | 1962 | if (gobj != null && !gobj.IsDeleted) |
1950 | { | 1963 | { |
1951 | // Set the parent localID to 0 so it transfers over properly. | 1964 | SceneObjectGroup clone = (SceneObjectGroup)gobj.CloneForNewScene(); |
1952 | gobj.RootPart.SetParentLocalId(0); | 1965 | clone.RootPart.GroupPosition = gobj.RootPart.AttachedPos; |
1953 | gobj.AbsolutePosition = gobj.RootPart.AttachedPos; | 1966 | clone.IsAttachment = false; |
1954 | gobj.IsAttachment = false; | 1967 | |
1955 | //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID(); | 1968 | //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID(); |
1956 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName); | 1969 | m_log.DebugFormat( |
1957 | CrossPrimGroupIntoNewRegion(destination, Vector3.Zero, gobj, silent); | 1970 | "[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", |
1971 | clone.UUID, destination.RegionName); | ||
1972 | |||
1973 | CrossPrimGroupIntoNewRegion(destination, Vector3.Zero, clone, silent); | ||
1958 | } | 1974 | } |
1959 | } | 1975 | } |
1960 | 1976 | ||
1961 | sp.ClearAttachments(); | 1977 | sp.ClearAttachments(); |
1962 | |||
1963 | return true; | ||
1964 | } | 1978 | } |
1965 | 1979 | ||
1966 | #endregion | 1980 | #endregion |