aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs74
1 files changed, 55 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 5ed7b67..0ab267a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -456,9 +456,9 @@ namespace OpenSim.Region.Framework.Scenes
456 { 456 {
457 m_pos = PhysicsActor.Position; 457 m_pos = PhysicsActor.Position;
458 458
459 //m_log.DebugFormat( 459// m_log.DebugFormat(
460 // "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!", 460// "[SCENE PRESENCE]: Set position of {0} in {1} to {2} via getting AbsolutePosition!",
461 // m_pos, Name, Scene.RegionInfo.RegionName); 461// Name, Scene.Name, m_pos);
462 } 462 }
463 else 463 else
464 { 464 {
@@ -485,6 +485,9 @@ namespace OpenSim.Region.Framework.Scenes
485 } 485 }
486 set 486 set
487 { 487 {
488// m_log.DebugFormat("[SCENE PRESENCE]: Setting position of {0} in {1} to {2}", Name, Scene.Name, value);
489// Util.PrintCallStack();
490
488 if (PhysicsActor != null) 491 if (PhysicsActor != null)
489 { 492 {
490 try 493 try
@@ -938,8 +941,6 @@ namespace OpenSim.Region.Framework.Scenes
938 "[SCENE]: Upgrading child to root agent for {0} in {1}", 941 "[SCENE]: Upgrading child to root agent for {0} in {1}",
939 Name, m_scene.RegionInfo.RegionName); 942 Name, m_scene.RegionInfo.RegionName);
940 943
941 bool wasChild = IsChildAgent;
942
943 if (ParentUUID != UUID.Zero) 944 if (ParentUUID != UUID.Zero)
944 { 945 {
945 m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID); 946 m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID);
@@ -972,6 +973,9 @@ namespace OpenSim.Region.Framework.Scenes
972 IsLoggingIn = false; 973 IsLoggingIn = false;
973 } 974 }
974 975
976 //m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count);
977
978 IsChildAgent = false;
975 979
976 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); 980 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
977 if (gm != null) 981 if (gm != null)
@@ -1065,6 +1069,13 @@ namespace OpenSim.Region.Framework.Scenes
1065 else 1069 else
1066 AddToPhysicalScene(isFlying); 1070 AddToPhysicalScene(isFlying);
1067 1071
1072 // XXX: This is to trigger any secondary teleport needed for a megaregion when the user has teleported to a
1073 // location outside the 'root region' (the south-west 256x256 corner). This is the earlist we can do it
1074 // since it requires a physics actor to be present. If it is left any later, then physics appears to reset
1075 // the value to a negative position which does not trigger the border cross.
1076 // This may not be the best location for this.
1077 CheckForBorderCrossing();
1078
1068 if (ForceFly) 1079 if (ForceFly)
1069 { 1080 {
1070 Flying = true; 1081 Flying = true;
@@ -1085,22 +1096,43 @@ namespace OpenSim.Region.Framework.Scenes
1085 // and it has already rezzed the attachments and started their scripts. 1096 // and it has already rezzed the attachments and started their scripts.
1086 // We do the following only for non-login agents, because their scripts 1097 // We do the following only for non-login agents, because their scripts
1087 // haven't started yet. 1098 // haven't started yet.
1088 lock (m_attachments) 1099 if (PresenceType == PresenceType.Npc || (TeleportFlags & TeleportFlags.ViaLogin) != 0)
1100 {
1101 // Viewers which have a current outfit folder will actually rez their own attachments. However,
1102 // viewers without (e.g. v1 viewers) will not, so we still need to make this call.
1103 if (Scene.AttachmentsModule != null)
1104 Util.FireAndForget(
1105 o =>
1106 {
1107// if (PresenceType != PresenceType.Npc && Util.FireAndForgetMethod != FireAndForgetMethod.None)
1108// System.Threading.Thread.Sleep(7000);
1109
1110 Scene.AttachmentsModule.RezAttachments(this);
1111 });
1112 }
1113 else
1089 { 1114 {
1090 if (wasChild && HasAttachments()) 1115 // We need to restart scripts here so that they receive the correct changed events (CHANGED_TELEPORT
1116 // and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently
1117 // be done in AttachmentsModule.CopyAttachments(AgentData ad, IScenePresence sp) itself since we are
1118 // not transporting the required data.
1119 lock (m_attachments)
1091 { 1120 {
1092 m_log.DebugFormat( 1121 if (HasAttachments())
1093 "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); 1122 {
1094 1123 m_log.DebugFormat(
1095 // Resume scripts 1124 "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
1096 Util.FireAndForget(delegate(object x) { 1125
1097 foreach (SceneObjectGroup sog in m_attachments) 1126 // Resume scripts
1098 { 1127 Util.FireAndForget(delegate(object x) {
1099 sog.ScheduleGroupForFullUpdate(); 1128 foreach (SceneObjectGroup sog in m_attachments)
1100 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); 1129 {
1101 sog.ResumeScripts(); 1130 sog.ScheduleGroupForFullUpdate();
1102 } 1131 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
1103 }); 1132 sog.ResumeScripts();
1133 }
1134 });
1135 }
1104 } 1136 }
1105 } 1137 }
1106 1138
@@ -3121,6 +3153,10 @@ namespace OpenSim.Region.Framework.Scenes
3121 3153
3122 if (!IsInTransit) 3154 if (!IsInTransit)
3123 { 3155 {
3156// m_log.DebugFormat(
3157// "[SCENE PRESENCE]: Testing border check for projected position {0} of {1} in {2}",
3158// pos2, Name, Scene.Name);
3159
3124 // Checks if where it's headed exists a region 3160 // Checks if where it's headed exists a region
3125 bool needsTransit = false; 3161 bool needsTransit = false;
3126 if (m_scene.TestBorderCross(pos2, Cardinals.W)) 3162 if (m_scene.TestBorderCross(pos2, Cardinals.W))