diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9b9d9da..1aac09d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -840,6 +840,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
840 | 840 | ||
841 | //m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count); | 841 | //m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count); |
842 | 842 | ||
843 | bool wasChild = m_isChildAgent; | ||
844 | m_isChildAgent = false; | ||
845 | |||
843 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | 846 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); |
844 | if (gm != null) | 847 | if (gm != null) |
845 | m_grouptitle = gm.GetGroupTitle(m_uuid); | 848 | m_grouptitle = gm.GetGroupTitle(m_uuid); |
@@ -929,14 +932,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
929 | // Animator.SendAnimPack(); | 932 | // Animator.SendAnimPack(); |
930 | 933 | ||
931 | m_scene.SwapRootAgentCount(false); | 934 | m_scene.SwapRootAgentCount(false); |
932 | 935 | ||
933 | //CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(m_uuid); | 936 | // The initial login scene presence is already root when it gets here |
934 | //if (userInfo != null) | 937 | // and it has already rezzed the attachments and started their scripts. |
935 | // userInfo.FetchInventory(); | 938 | // We do the following only for non-login agents, because their scripts |
936 | //else | 939 | // haven't started yet. |
937 | // m_log.ErrorFormat("[SCENE]: Could not find user info for {0} when making it a root agent", m_uuid); | 940 | if (wasChild) |
938 | 941 | { | |
939 | m_isChildAgent = false; | 942 | m_log.DebugFormat("[SCENE PRESENCE]: Restarting scripts in attachments..."); |
943 | // Resume scripts | ||
944 | Attachments.ForEach(delegate(SceneObjectGroup sog) | ||
945 | { | ||
946 | sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); | ||
947 | sog.ResumeScripts(); | ||
948 | }); | ||
949 | } | ||
940 | 950 | ||
941 | // send the animations of the other presences to me | 951 | // send the animations of the other presences to me |
942 | m_scene.ForEachScenePresence(delegate(ScenePresence presence) | 952 | m_scene.ForEachScenePresence(delegate(ScenePresence presence) |
@@ -948,6 +958,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
948 | m_scene.EventManager.TriggerOnMakeRootAgent(this); | 958 | m_scene.EventManager.TriggerOnMakeRootAgent(this); |
949 | } | 959 | } |
950 | 960 | ||
961 | public int GetStateSource() | ||
962 | { | ||
963 | AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(UUID); | ||
964 | |||
965 | if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default)) | ||
966 | { | ||
967 | // This will get your attention | ||
968 | //m_log.Error("[XXX] Triggering CHANGED_TELEPORT"); | ||
969 | |||
970 | return 5; // StateSource.Teleporting | ||
971 | } | ||
972 | return 2; // StateSource.PrimCrossing | ||
973 | } | ||
974 | |||
951 | /// <summary> | 975 | /// <summary> |
952 | /// This turns a root agent into a child agent | 976 | /// This turns a root agent into a child agent |
953 | /// when an agent departs this region for a neighbor, this gets called. | 977 | /// when an agent departs this region for a neighbor, this gets called. |
@@ -1139,7 +1163,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1139 | AbsolutePosition = pos; | 1163 | AbsolutePosition = pos; |
1140 | } | 1164 | } |
1141 | 1165 | ||
1142 | m_isChildAgent = false; | ||
1143 | bool m_flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | 1166 | bool m_flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); |
1144 | MakeRootAgent(AbsolutePosition, m_flying); | 1167 | MakeRootAgent(AbsolutePosition, m_flying); |
1145 | 1168 | ||