aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs10
-rw-r--r--OpenSim/Region/Framework/Interfaces/IHttpRequests.cs3
-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
6 files changed, 106 insertions, 81 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index eaaf7a3..3c1247f 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -54,6 +54,10 @@ namespace OpenSim.Region.Framework.Interfaces
54 /// RezAttachments. This should only be called upon login on the first region. 54 /// RezAttachments. This should only be called upon login on the first region.
55 /// Attachment rezzings on crossings and TPs are done in a different way. 55 /// Attachment rezzings on crossings and TPs are done in a different way.
56 /// </summary> 56 /// </summary>
57 /// <remarks>
58 /// This is only actually necessary for viewers which do not have a current outfit folder (these viewers make
59 /// their own attachment calls on login) and agents which have attachments but no viewer (e.g. NPCs).
60 /// </remarks>
57 /// <param name="sp"></param> 61 /// <param name="sp"></param>
58 void RezAttachments(IScenePresence sp); 62 void RezAttachments(IScenePresence sp);
59 63
@@ -77,14 +81,16 @@ namespace OpenSim.Region.Framework.Interfaces
77 void DeleteAttachmentsFromScene(IScenePresence sp, bool silent); 81 void DeleteAttachmentsFromScene(IScenePresence sp, bool silent);
78 82
79 /// <summary> 83 /// <summary>
80 /// Attach an object to an avatar 84 /// Attach an object to an avatar.
81 /// </summary> 85 /// </summary>
82 /// <param name="sp"></param> 86 /// <param name="sp"></param>
83 /// <param name="grp"></param> 87 /// <param name="grp"></param>
84 /// <param name="AttachmentPt"></param> 88 /// <param name="AttachmentPt"></param>
85 /// <param name="silent"></param> 89 /// <param name="silent"></param>
90 /// <param name="addToInventory">If true then add object to user inventory</param>
91 /// <param name="append">Append to attachment point rather than replace.</param>
86 /// <returns>true if the object was successfully attached, false otherwise</returns> 92 /// <returns>true if the object was successfully attached, false otherwise</returns>
87 bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent, bool useAttachmentInfo, bool temp, bool append); 93 bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent, bool useAttachmentInfo, bool addToInventory, bool append);
88 94
89 /// <summary> 95 /// <summary>
90 /// Rez an attachment from user inventory and change inventory status to match. 96 /// Rez an attachment from user inventory and change inventory status to match.
diff --git a/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs b/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs
index de0f2a3..eb6c5ac 100644
--- a/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs
+++ b/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs
@@ -36,6 +36,9 @@ namespace OpenSim.Region.Framework.Interfaces
36 HTTP_MIMETYPE = 1, 36 HTTP_MIMETYPE = 1,
37 HTTP_BODY_MAXLENGTH = 2, 37 HTTP_BODY_MAXLENGTH = 2,
38 HTTP_VERIFY_CERT = 3, 38 HTTP_VERIFY_CERT = 3,
39 HTTP_VERBOSE_THROTTLE = 4,
40 HTTP_CUSTOM_HEADER = 5,
41 HTTP_PRAGMA_NO_CACHE = 6
39 } 42 }
40 43
41 public interface IHttpRequestModule 44 public interface IHttpRequestModule
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))