aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-12-02 23:56:01 +0000
committerJustin Clark-Casey (justincc)2011-12-02 23:56:01 +0000
commit054ebe8878cbd1552fe96c0df631f50d5c2409d3 (patch)
tree4c0231e4fb7d0f830397ed7feb4319c153d3c9c4 /OpenSim/Region/CoreModules
parentRemove pointless Animator.TrySetMovementAnimation("STAND") in ScenePresnece c... (diff)
downloadopensim-SC-054ebe8878cbd1552fe96c0df631f50d5c2409d3.zip
opensim-SC-054ebe8878cbd1552fe96c0df631f50d5c2409d3.tar.gz
opensim-SC-054ebe8878cbd1552fe96c0df631f50d5c2409d3.tar.bz2
opensim-SC-054ebe8878cbd1552fe96c0df631f50d5c2409d3.tar.xz
Stop some places where we're trying to reset animations in child agents where such requests are ignored.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs210
1 files changed, 110 insertions, 100 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