aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs210
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs25
4 files changed, 133 insertions, 116 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index d01f89b..99064c8 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -495,7 +495,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
495 // Well, this is it. The agent is over there. 495 // Well, this is it. The agent is over there.
496 KillEntity(sp.Scene, sp.LocalId); 496 KillEntity(sp.Scene, sp.LocalId);
497 497
498
499 // Now let's make it officially a child agent 498 // Now let's make it officially a child agent
500 sp.MakeChildAgent(); 499 sp.MakeChildAgent();
501 500
@@ -510,9 +509,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
510 sp.Scene.IncomingCloseAgent(sp.UUID); 509 sp.Scene.IncomingCloseAgent(sp.UUID);
511 } 510 }
512 else 511 else
512 {
513 // now we have a child agent in this region. 513 // now we have a child agent in this region.
514 sp.Reset(); 514 sp.Reset();
515 515 }
516 516
517 // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! 517 // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!
518 if (sp.Scene.NeedSceneCacheClear(sp.UUID)) 518 if (sp.Scene.NeedSceneCacheClear(sp.UUID))
@@ -946,111 +946,121 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
946 ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, 946 ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion,
947 bool isFlying, string version) 947 bool isFlying, string version)
948 { 948 {
949 ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); 949 try
950
951 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} to {2}-{3} running version {4}", agent.Firstname, agent.Lastname, neighbourx, neighboury, version);
952
953 Scene m_scene = agent.Scene;
954
955 if (neighbourRegion != null)
956 { 950 {
957 if (!agent.ValidateAttachments()) 951 ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
958 m_log.DebugFormat( 952
959 "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.", 953 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} to {2}-{3} running version {4}", agent.Firstname, agent.Lastname, neighbourx, neighboury, version);
960 agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName); 954
961 955 Scene m_scene = agent.Scene;
962 pos = pos + (agent.Velocity); 956
963 957 if (neighbourRegion != null)
964 SetInTransit(agent.UUID);
965 AgentData cAgent = new AgentData();
966 agent.CopyTo(cAgent);
967 cAgent.Position = pos;
968 if (isFlying)
969 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
970 cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
971 "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
972
973 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
974 { 958 {
975 // region doesn't take it 959 if (!agent.ValidateAttachments())
976 ReInstantiateScripts(agent); 960 m_log.DebugFormat(
977 ResetFromTransit(agent.UUID); 961 "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.",
978 return agent; 962 agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName);
963
964 pos = pos + (agent.Velocity);
965
966 SetInTransit(agent.UUID);
967 AgentData cAgent = new AgentData();
968 agent.CopyTo(cAgent);
969 cAgent.Position = pos;
970 if (isFlying)
971 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
972 cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
973 "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
974
975 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
976 {
977 // region doesn't take it
978 ReInstantiateScripts(agent);
979 ResetFromTransit(agent.UUID);
980 return agent;
981 }
982
983 // Next, let's close the child agent connections that are too far away.
984 agent.CloseChildAgents(neighbourx, neighboury);
985
986 //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
987 agent.ControllingClient.RequestClientInfo();
988
989 //m_log.Debug("BEFORE CROSS");
990 //Scene.DumpChildrenSeeds(UUID);
991 //DumpKnownRegions();
992 string agentcaps;
993 if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps))
994 {
995 m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: No ENTITY TRANSFER MODULE information for region handle {0}, exiting CrossToNewRegion.",
996 neighbourRegion.RegionHandle);
997 return agent;
998 }
999 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
1000
1001 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
1002
1003 IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
1004 if (eq != null)
1005 {
1006 eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
1007 capsPath, agent.UUID, agent.ControllingClient.SessionId);
1008 }
1009 else
1010 {
1011 agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
1012 capsPath);
1013 }
1014
1015 if (!WaitForCallback(agent.UUID))
1016 {
1017 m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent");
1018 ReInstantiateScripts(agent);
1019 ResetFromTransit(agent.UUID);
1020
1021 // Yikes! We should just have a ref to scene here.
1022 //agent.Scene.InformClientOfNeighbours(agent);
1023 EnableChildAgents(agent);
1024
1025 return agent;
1026 }
1027
1028 agent.MakeChildAgent();
1029
1030 // now we have a child agent in this region. Request all interesting data about other (root) agents
1031 agent.SendOtherAgentsAvatarDataToMe();
1032 agent.SendOtherAgentsAppearanceToMe();
1033
1034 // Backwards compatibility
1035 if (version == "Unknown" || version == string.Empty)
1036 {
1037 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one...");
1038 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
1039 }
1040
1041 AgentHasMovedAway(agent, false);
1042
1043 // the user may change their profile information in other region,
1044 // so the userinfo in UserProfileCache is not reliable any more, delete it
1045 // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!
1046 if (agent.Scene.NeedSceneCacheClear(agent.UUID))
1047 {
1048 m_log.DebugFormat(
1049 "[ENTITY TRANSFER MODULE]: User {0} is going to another region", agent.UUID);
1050 }
979 } 1051 }
980 1052
981 // Next, let's close the child agent connections that are too far away. 1053 //m_log.Debug("AFTER CROSS");
982 agent.CloseChildAgents(neighbourx, neighboury);
983
984 //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
985 agent.ControllingClient.RequestClientInfo();
986
987 //m_log.Debug("BEFORE CROSS");
988 //Scene.DumpChildrenSeeds(UUID); 1054 //Scene.DumpChildrenSeeds(UUID);
989 //DumpKnownRegions(); 1055 //DumpKnownRegions();
990 string agentcaps; 1056 }
991 if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps)) 1057 catch (Exception e)
992 { 1058 {
993 m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: No ENTITY TRANSFER MODULE information for region handle {0}, exiting CrossToNewRegion.", 1059 m_log.ErrorFormat(
994 neighbourRegion.RegionHandle); 1060 "[ENTITY TRANSFER MODULE]: Problem crossing user {0} to new region {1} from {2}. Exception {3}{4}",
995 return agent; 1061 agent.Name, neighbourRegion.RegionName, agent.Scene.RegionInfo.RegionName, e.Message, e.StackTrace);
996 }
997 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
998
999 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
1000
1001 IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
1002 if (eq != null)
1003 {
1004 eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
1005 capsPath, agent.UUID, agent.ControllingClient.SessionId);
1006 }
1007 else
1008 {
1009 agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
1010 capsPath);
1011 }
1012
1013 if (!WaitForCallback(agent.UUID))
1014 {
1015 m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent");
1016 ReInstantiateScripts(agent);
1017 ResetFromTransit(agent.UUID);
1018
1019 // Yikes! We should just have a ref to scene here.
1020 //agent.Scene.InformClientOfNeighbours(agent);
1021 EnableChildAgents(agent);
1022
1023 return agent;
1024 }
1025
1026 agent.MakeChildAgent();
1027
1028 // now we have a child agent in this region. Request all interesting data about other (root) agents
1029 agent.SendOtherAgentsAvatarDataToMe();
1030 agent.SendOtherAgentsAppearanceToMe();
1031
1032 // Backwards compatibility
1033 if (version == "Unknown" || version == string.Empty)
1034 {
1035 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one...");
1036 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
1037 }
1038
1039 AgentHasMovedAway(agent, false);
1040
1041 // the user may change their profile information in other region,
1042 // so the userinfo in UserProfileCache is not reliable any more, delete it
1043 // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!
1044 if (agent.Scene.NeedSceneCacheClear(agent.UUID))
1045 {
1046 m_log.DebugFormat(
1047 "[ENTITY TRANSFER MODULE]: User {0} is going to another region", agent.UUID);
1048 }
1049 } 1062 }
1050 1063
1051 //m_log.Debug("AFTER CROSS");
1052 //Scene.DumpChildrenSeeds(UUID);
1053 //DumpKnownRegions();
1054 return agent; 1064 return agent;
1055 } 1065 }
1056 1066
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 4cf854e..6b1208c 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -131,8 +131,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
131 131
132 public void ResetAnimations() 132 public void ResetAnimations()
133 { 133 {
134// m_log.DebugFormat(
135// "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}",
136// m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName);
137
134 m_animations.Clear(); 138 m_animations.Clear();
135 TrySetMovementAnimation("STAND");
136 } 139 }
137 140
138 /// <summary> 141 /// <summary>
@@ -155,6 +158,14 @@ namespace OpenSim.Region.Framework.Scenes.Animation
155 SendAnimPack(); 158 SendAnimPack();
156 } 159 }
157 } 160 }
161 // Don't leave this on since on teleports SP.HandleAgentUpdate() still hammers us for a while after it teleports
162// else
163// {
164// m_log.WarnFormat(
165// "[SCENE PRESENCE ANIMATOR]: Tried to set movement animation {0} on child presence {1}",
166// anim, m_scenePresence.Name);
167// throw new Exception(string.Format("aaargh on setting {0}", anim));
168// }
158 } 169 }
159 170
160 /// <summary> 171 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 9a71cd4..3ac6327 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3700,7 +3700,6 @@ namespace OpenSim.Region.Framework.Scenes
3700 return false; 3700 return false;
3701 } 3701 }
3702 3702
3703
3704 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); 3703 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
3705 3704
3706 if (childAgentUpdate != null) 3705 if (childAgentUpdate != null)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 1c2025c..b93b67d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -995,13 +995,17 @@ namespace OpenSim.Region.Framework.Scenes
995 995
996 /// <summary> 996 /// <summary>
997 /// This turns a root agent into a child agent 997 /// This turns a root agent into a child agent
998 /// </summary>
999 /// <remarks>
998 /// when an agent departs this region for a neighbor, this gets called. 1000 /// when an agent departs this region for a neighbor, this gets called.
999 /// 1001 ///
1000 /// It doesn't get called for a teleport. Reason being, an agent that 1002 /// It doesn't get called for a teleport. Reason being, an agent that
1001 /// teleports out may not end up anywhere near this region 1003 /// teleports out may not end up anywhere near this region
1002 /// </summary> 1004 /// </remarks>
1003 public void MakeChildAgent() 1005 public void MakeChildAgent()
1004 { 1006 {
1007 m_log.DebugFormat("[SCENE PRESENCE]: Making {0} a child agent in {1}", Name, Scene.RegionInfo.RegionName);
1008
1005 // Reset these so that teleporting in and walking out isn't seen 1009 // Reset these so that teleporting in and walking out isn't seen
1006 // as teleporting back 1010 // as teleporting back
1007 TeleportFlags = TeleportFlags.Default; 1011 TeleportFlags = TeleportFlags.Default;
@@ -2295,11 +2299,6 @@ namespace OpenSim.Region.Framework.Scenes
2295 { 2299 {
2296 m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick. 2300 m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick.
2297 Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); 2301 Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
2298
2299 // TODO: This doesn't prevent the user from walking yet.
2300 // Setting parent ID would fix this, if we knew what value
2301 // to use. Or we could add a m_isSitting variable.
2302 //Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
2303 SitGround = true; 2302 SitGround = true;
2304 RemoveFromPhysicalScene(); 2303 RemoveFromPhysicalScene();
2305 } 2304 }
@@ -2908,9 +2907,12 @@ namespace OpenSim.Region.Framework.Scenes
2908 2907
2909 public void Reset() 2908 public void Reset()
2910 { 2909 {
2910// m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName);
2911
2911 // Put the child agent back at the center 2912 // Put the child agent back at the center
2912 AbsolutePosition 2913 AbsolutePosition
2913 = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 70); 2914 = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 70);
2915
2914 Animator.ResetAnimations(); 2916 Animator.ResetAnimations();
2915 } 2917 }
2916 2918
@@ -3133,7 +3135,7 @@ namespace OpenSim.Region.Framework.Scenes
3133 } 3135 }
3134 } 3136 }
3135 3137
3136 public void CopyFrom(AgentData cAgent) 3138 private void CopyFrom(AgentData cAgent)
3137 { 3139 {
3138 m_originRegionID = cAgent.RegionID; 3140 m_originRegionID = cAgent.RegionID;
3139 3141
@@ -3192,13 +3194,8 @@ namespace OpenSim.Region.Framework.Scenes
3192 } 3194 }
3193 } 3195 }
3194 catch { } 3196 catch { }
3195 // Animations 3197
3196 try 3198 Animator.Animations.FromArray(cAgent.Anims);
3197 {
3198 Animator.ResetAnimations();
3199 Animator.Animations.FromArray(cAgent.Anims);
3200 }
3201 catch { }
3202 3199
3203 if (cAgent.AttachmentObjects != null && cAgent.AttachmentObjects.Count > 0) 3200 if (cAgent.AttachmentObjects != null && cAgent.AttachmentObjects.Count > 0)
3204 { 3201 {