aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2013-03-31 20:27:46 +0200
committerMelanie2013-03-31 20:27:46 +0200
commitf142e1f3941165f29f390132f53fc5e88b40c883 (patch)
tree1f1ddd276fd940f86aa88b61692ecd68a0d2084a /OpenSim/Region/Framework/Scenes
parentExport permission, part two. Setting export perms for textures and clothing w... (diff)
parentMerge branch 'master' into careminster (diff)
downloadopensim-SC_OLD-f142e1f3941165f29f390132f53fc5e88b40c883.zip
opensim-SC_OLD-f142e1f3941165f29f390132f53fc5e88b40c883.tar.gz
opensim-SC_OLD-f142e1f3941165f29f390132f53fc5e88b40c883.tar.bz2
opensim-SC_OLD-f142e1f3941165f29f390132f53fc5e88b40c883.tar.xz
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Border.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs89
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs74
4 files changed, 95 insertions, 79 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Border.cs b/OpenSim/Region/Framework/Scenes/Border.cs
index c6a6511..08c0c31 100644
--- a/OpenSim/Region/Framework/Scenes/Border.cs
+++ b/OpenSim/Region/Framework/Scenes/Border.cs
@@ -33,8 +33,7 @@ using OpenMetaverse;
33namespace OpenSim.Region.Framework.Scenes 33namespace OpenSim.Region.Framework.Scenes
34{ 34{
35 public class Border 35 public class Border
36 { 36 {
37
38 /// <summary> 37 /// <summary>
39 /// Line perpendicular to the Direction Cardinal. Z value is the 38 /// Line perpendicular to the Direction Cardinal. Z value is the
40 /// </summary> 39 /// </summary>
@@ -81,6 +80,10 @@ namespace OpenSim.Region.Framework.Scenes
81 TriggerRegionY = triggerRegionY; 80 TriggerRegionY = triggerRegionY;
82 } 81 }
83 82
83 /// <summary>
84 /// Tests to see if the given position would cross this border.
85 /// </summary>
86 /// <returns></returns>
84 public bool TestCross(Vector3 position) 87 public bool TestCross(Vector3 position)
85 { 88 {
86 bool result = false; 89 bool result = false;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 357a94b..28fce53 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2644,7 +2644,6 @@ namespace OpenSim.Region.Framework.Scenes
2644 2644
2645 } 2645 }
2646 } 2646 }
2647
2648 2647
2649 return null; 2648 return null;
2650 } 2649 }
@@ -2862,7 +2861,10 @@ namespace OpenSim.Region.Framework.Scenes
2862// "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); 2861// "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
2863 2862
2864 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2863 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2865 2864
2865 // We must currently not resume scripts at this stage since AttachmentsModule does not have the
2866 // information that this is due to a teleport/border cross rather than an ordinary attachment.
2867 // We currently do this in Scene.MakeRootAgent() instead.
2866 if (AttachmentsModule != null) 2868 if (AttachmentsModule != null)
2867 AttachmentsModule.AttachObject(sp, grp, 0, false, false, false, true); 2869 AttachmentsModule.AttachObject(sp, grp, 0, false, false, false, true);
2868 } 2870 }
@@ -2979,35 +2981,6 @@ namespace OpenSim.Region.Framework.Scenes
2979 m_eventManager.TriggerOnNewPresence(sp); 2981 m_eventManager.TriggerOnNewPresence(sp);
2980 2982
2981 sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags; 2983 sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags;
2982
2983 // The first agent upon login is a root agent by design.
2984 // For this agent we will have to rez the attachments.
2985 // All other AddNewClient calls find aCircuit.child to be true.
2986 if (aCircuit.child == false)
2987 {
2988 // We have to set SP to be a root agent here so that SP.MakeRootAgent() will later not try to
2989 // start the scripts again (since this is done in RezAttachments()).
2990 // XXX: This is convoluted.
2991 sp.IsChildAgent = false;
2992 sp.IsLoggingIn = true;
2993
2994 // We leave a 5 second pause before attempting to rez attachments to avoid a clash with
2995 // version 3 viewers that maybe doing their own attachment rezzing related to their current
2996 // outfit folder on startup. If these operations do clash, then the symptoms are invisible
2997 // attachments until one zooms in on the avatar.
2998 //
2999 // We do not pause if we are launching on the same thread anyway in order to avoid pointlessly
3000 // delaying any attachment related regression tests.
3001 if (AttachmentsModule != null)
3002 Util.FireAndForget(
3003 o =>
3004 {
3005 if (Util.FireAndForgetMethod != FireAndForgetMethod.None)
3006 Thread.Sleep(5000);
3007
3008 AttachmentsModule.RezAttachments(sp);
3009 });
3010 }
3011 } 2984 }
3012 else 2985 else
3013 { 2986 {
@@ -4344,33 +4317,33 @@ namespace OpenSim.Region.Framework.Scenes
4344// } 4317// }
4345// } 4318// }
4346 4319
4347 /// <summary> 4320// /// <summary>
4348 /// Triggered when an agent crosses into this sim. Also happens on initial login. 4321// /// Triggered when an agent crosses into this sim. Also happens on initial login.
4349 /// </summary> 4322// /// </summary>
4350 /// <param name="agentID"></param> 4323// /// <param name="agentID"></param>
4351 /// <param name="position"></param> 4324// /// <param name="position"></param>
4352 /// <param name="isFlying"></param> 4325// /// <param name="isFlying"></param>
4353 public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) 4326// public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
4354 { 4327// {
4355 ScenePresence presence = GetScenePresence(agentID); 4328// ScenePresence presence = GetScenePresence(agentID);
4356 if (presence != null) 4329// if (presence != null)
4357 { 4330// {
4358 try 4331// try
4359 { 4332// {
4360 presence.MakeRootAgent(position, isFlying); 4333// presence.MakeRootAgent(position, isFlying);
4361 } 4334// }
4362 catch (Exception e) 4335// catch (Exception e)
4363 { 4336// {
4364 m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace); 4337// m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace);
4365 } 4338// }
4366 } 4339// }
4367 else 4340// else
4368 { 4341// {
4369 m_log.ErrorFormat( 4342// m_log.ErrorFormat(
4370 "[SCENE]: Could not find presence for agent {0} crossing into scene {1}", 4343// "[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
4371 agentID, RegionInfo.RegionName); 4344// agentID, RegionInfo.RegionName);
4372 } 4345// }
4373 } 4346// }
4374 4347
4375 /// <summary> 4348 /// <summary>
4376 /// We've got an update about an agent that sees into this region, 4349 /// We've got an update about an agent that sees into this region,
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index c2f0792..42644dc 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3743,6 +3743,10 @@ namespace OpenSim.Region.Framework.Scenes
3743 /// <param name="events"></param> 3743 /// <param name="events"></param>
3744 public void SetScriptEvents(UUID scriptid, int events) 3744 public void SetScriptEvents(UUID scriptid, int events)
3745 { 3745 {
3746// m_log.DebugFormat(
3747// "[SCENE OBJECT PART]: Set script events for script with id {0} on {1}/{2} to {3} in {4}",
3748// scriptid, Name, ParentGroup.Name, events, ParentGroup.Scene.Name);
3749
3746 // scriptEvents oldparts; 3750 // scriptEvents oldparts;
3747 lock (m_scriptEvents) 3751 lock (m_scriptEvents)
3748 { 3752 {
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))