aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2013-09-16 22:32:53 +0100
committerMelanie2013-09-16 22:32:53 +0100
commit72206a0e294865bf0c93ea16910276a188d51ce6 (patch)
treef7769826d78863b2e0e416fe529f0c55065e0acd /OpenSim/Region
parentMerge branch 'master' into careminster (diff)
parentMono 2.0 fix - call ToArray() explicitly (diff)
downloadopensim-SC_OLD-72206a0e294865bf0c93ea16910276a188d51ce6.zip
opensim-SC_OLD-72206a0e294865bf0c93ea16910276a188d51ce6.tar.gz
opensim-SC_OLD-72206a0e294865bf0c93ea16910276a188d51ce6.tar.bz2
opensim-SC_OLD-72206a0e294865bf0c93ea16910276a188d51ce6.tar.xz
Merge branch 'avination-current' into careminster
Conflicts: OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs40
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs57
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs12
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/KeyframeMotion.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs56
14 files changed, 140 insertions, 87 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 0f3bac4..4891c1a 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -196,7 +196,9 @@ namespace OpenSim
196 196
197 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); 197 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
198 198
199 string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule"); 199 string permissionModules = Util.GetConfigVarFromSections<string>(Config, "permissionmodules",
200 new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule");
201
200 m_permsModules = new List<string>(permissionModules.Split(',')); 202 m_permsModules = new List<string>(permissionModules.Split(','));
201 203
202 managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty); 204 managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty);
@@ -392,29 +394,19 @@ namespace OpenSim
392 } 394 }
393 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 395 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
394 396
395 // XPTO: Fix this 397 if (m_securePermissionsLoading)
396// if (m_securePermissionsLoading) 398 {
397// { 399 foreach (string s in m_permsModules)
398// foreach (string s in m_permsModules) 400 {
399// { 401 if (!scene.RegionModules.ContainsKey(s))
400// if (!scene.RegionModules.ContainsKey(s)) 402 {
401// { 403 m_log.Fatal("[MODULES]: Required module " + s + " not found.");
402// bool found = false; 404 Environment.Exit(0);
403// foreach (IRegionModule m in modules) 405 }
404// { 406 }
405// if (m.Name == s) 407
406// { 408 m_log.InfoFormat("[SCENE]: Secure permissions loading enabled, modules loaded: {0}", String.Join(" ", m_permsModules.ToArray()));
407// found = true; 409 }
408// }
409// }
410// if (!found)
411// {
412// m_log.Fatal("[MODULES]: Required module " + s + " not found.");
413// Environment.Exit(0);
414// }
415// }
416// }
417// }
418 410
419 scene.SetModuleInterfaces(); 411 scene.SetModuleInterfaces();
420// First Step of bootreport sequence 412// First Step of bootreport sequence
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index c8e1e83..e053054 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -77,6 +77,8 @@ namespace OpenSim.Region.ClientStack.Linden
77 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); 77 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>();
78 private static Thread[] m_workerThreads = null; 78 private static Thread[] m_workerThreads = null;
79 79
80 private string m_Url = "localhost";
81
80 private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue = 82 private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue =
81 new OpenMetaverse.BlockingQueue<aPollRequest>(); 83 new OpenMetaverse.BlockingQueue<aPollRequest>();
82 84
@@ -88,6 +90,9 @@ namespace OpenSim.Region.ClientStack.Linden
88 90
89 public void Initialise(IConfigSource source) 91 public void Initialise(IConfigSource source)
90 { 92 {
93 IConfig config = source.Configs["ClientStack.LindenCaps"];
94 if (config != null)
95 m_Url = config.GetString("Cap_GetTexture", "localhost");
91 } 96 }
92 97
93 public void AddRegion(Scene s) 98 public void AddRegion(Scene s)
@@ -345,32 +350,38 @@ namespace OpenSim.Region.ClientStack.Linden
345 350
346 private void RegisterCaps(UUID agentID, Caps caps) 351 private void RegisterCaps(UUID agentID, Caps caps)
347 { 352 {
348 m_URL = "/CAPS/" + UUID.Random() + "/"; 353 if (m_Url == "localhost")
349
350 // Register this as a poll service
351 PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene);
352
353 args.Type = PollServiceEventArgs.EventType.Texture;
354 MainServer.Instance.AddPollServiceHTTPHandler(m_URL, args);
355
356 string hostName = m_scene.RegionInfo.ExternalHostName;
357 uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
358 string protocol = "http";
359
360 if (MainServer.Instance.UseSSL)
361 { 354 {
362 hostName = MainServer.Instance.SSLCommonName; 355 string capUrl = "/CAPS/" + UUID.Random() + "/";
363 port = MainServer.Instance.SSLPort;
364 protocol = "https";
365 }
366 356
367 IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>(); 357 // Register this as a poll service
368 if (handler != null) 358 PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene);
369 handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", m_URL); 359
360 args.Type = PollServiceEventArgs.EventType.Texture;
361 MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);
362
363 string hostName = m_scene.RegionInfo.ExternalHostName;
364 uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
365 string protocol = "http";
366
367 if (MainServer.Instance.UseSSL)
368 {
369 hostName = MainServer.Instance.SSLCommonName;
370 port = MainServer.Instance.SSLPort;
371 protocol = "https";
372 }
373 IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>();
374 if (handler != null)
375 handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", capUrl);
376 else
377 caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl));
378 m_pollservices[agentID] = args;
379 m_capsDict[agentID] = capUrl;
380 }
370 else 381 else
371 caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, m_URL)); 382 {
372 m_pollservices[agentID] = args; 383 caps.RegisterHandler("GetTexture", m_Url);
373 m_capsDict[agentID] = m_URL; 384 }
374 } 385 }
375 386
376 private void DeregisterCaps(UUID agentID, Caps caps) 387 private void DeregisterCaps(UUID agentID, Caps caps)
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index dc28be8..36edd0b 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -4004,6 +4004,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4004 part.Shape.ProfileHollow = 27500; 4004 part.Shape.ProfileHollow = 27500;
4005 } 4005 }
4006 } 4006 }
4007 else if (update.Entity is ScenePresence)
4008 {
4009 ScenePresence presence = (ScenePresence)update.Entity;
4010
4011 // If ParentUUID is not UUID.Zero and ParentID is 0, this
4012 // avatar is in the process of crossing regions while
4013 // sat on an object. In this state, we don't want any
4014 // updates because they will visually orbit the avatar.
4015 // Update will be forced once crossing is completed anyway.
4016 if (presence.ParentUUID != UUID.Zero && presence.ParentID == 0)
4017 continue;
4018 }
4007 4019
4008 ++updatesThisCall; 4020 ++updatesThisCall;
4009 4021
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
index 343cdb5..c52d586 100644
--- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
@@ -182,6 +182,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
182 try 182 try
183 { 183 {
184 ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); 184 ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
185 if (obj == null)
186 return;
185 if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0 187 if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0
186 || avatar.Scene.RegionInfo.RegionSettings.AllowDamage) 188 || avatar.Scene.RegionInfo.RegionSettings.AllowDamage)
187 { 189 {
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index f8e93e1..50855fe 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -42,8 +42,8 @@ using PermissionMask = OpenSim.Framework.PermissionMask;
42 42
43namespace OpenSim.Region.CoreModules.World.Permissions 43namespace OpenSim.Region.CoreModules.World.Permissions
44{ 44{
45 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "PermissionsModule")] 45 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DefaultPermissionsModule")]
46 public class PermissionsModule : INonSharedRegionModule, IPermissionsModule 46 public class DefaultPermissionsModule : INonSharedRegionModule, IPermissionsModule
47 { 47 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
@@ -348,7 +348,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
348 348
349 public string Name 349 public string Name
350 { 350 {
351 get { return "PermissionsModule"; } 351 get { return "DefaultPermissionsModule"; }
352 } 352 }
353 353
354 public Type ReplaceableInterface 354 public Type ReplaceableInterface
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
index 29652aa..c0057ee 100644
--- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
+++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
@@ -632,7 +632,7 @@ namespace OpenSim.Region.Framework.Scenes
632 632
633 // Do the frame processing 633 // Do the frame processing
634 double steps = (double)m_currentFrame.TimeMS / tickDuration; 634 double steps = (double)m_currentFrame.TimeMS / tickDuration;
635 635
636 if (steps <= 0.0) 636 if (steps <= 0.0)
637 { 637 {
638 m_group.RootPart.Velocity = Vector3.Zero; 638 m_group.RootPart.Velocity = Vector3.Zero;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 18e7eb8..d6d2df4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2820,8 +2820,10 @@ namespace OpenSim.Region.Framework.Scenes
2820 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); 2820 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject));
2821 newObject.ResumeScripts(); 2821 newObject.ResumeScripts();
2822 2822
2823 if (newObject.RootPart.KeyframeMotion != null) 2823 // AddSceneObject already does this and doing it again messes
2824 newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject); 2824 // up region crossings, so don't.
2825 //if (newObject.RootPart.KeyframeMotion != null)
2826 // newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject);
2825 } 2827 }
2826 2828
2827 // Do this as late as possible so that listeners have full access to the incoming object 2829 // Do this as late as possible so that listeners have full access to the incoming object
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9e3d875..6deb870 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -591,6 +591,7 @@ namespace OpenSim.Region.Framework.Scenes
591 avinfo.ParentID = av.ParentID; 591 avinfo.ParentID = av.ParentID;
592 avsToCross.Add(avinfo); 592 avsToCross.Add(avinfo);
593 593
594 av.PrevSitOffset = av.OffsetPosition;
594 av.ParentID = 0; 595 av.ParentID = 0;
595 } 596 }
596 597
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 88ecda2..183d8d1 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -265,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes
265 265
266 private int m_movementAnimationUpdateCounter = 0; 266 private int m_movementAnimationUpdateCounter = 0;
267 267
268 private Vector3 m_prevSitOffset; 268 public Vector3 PrevSitOffset { get; set; }
269 269
270 protected AvatarAppearance m_appearance; 270 protected AvatarAppearance m_appearance;
271 271
@@ -997,7 +997,7 @@ namespace OpenSim.Region.Framework.Scenes
997// ParentPosition = part.GetWorldPosition(); 997// ParentPosition = part.GetWorldPosition();
998 ParentID = part.LocalId; 998 ParentID = part.LocalId;
999 ParentPart = part; 999 ParentPart = part;
1000 m_pos = m_prevSitOffset; 1000 m_pos = PrevSitOffset;
1001// pos = ParentPosition; 1001// pos = ParentPosition;
1002 pos = part.GetWorldPosition(); 1002 pos = part.GetWorldPosition();
1003 } 1003 }
@@ -2414,6 +2414,7 @@ namespace OpenSim.Region.Framework.Scenes
2414 2414
2415 if (ParentID != 0) 2415 if (ParentID != 0)
2416 { 2416 {
2417 PrevSitOffset = m_pos; // Save sit offset
2417 SceneObjectPart part = ParentPart; 2418 SceneObjectPart part = ParentPart;
2418 UnRegisterSeatControls(part.ParentGroup.UUID); 2419 UnRegisterSeatControls(part.ParentGroup.UUID);
2419 2420
@@ -3649,7 +3650,7 @@ namespace OpenSim.Region.Framework.Scenes
3649 cAgent.Appearance = new AvatarAppearance(Appearance); 3650 cAgent.Appearance = new AvatarAppearance(Appearance);
3650 3651
3651 cAgent.ParentPart = ParentUUID; 3652 cAgent.ParentPart = ParentUUID;
3652 cAgent.SitOffset = m_pos; 3653 cAgent.SitOffset = PrevSitOffset;
3653 3654
3654 lock (scriptedcontrols) 3655 lock (scriptedcontrols)
3655 { 3656 {
@@ -3692,7 +3693,7 @@ namespace OpenSim.Region.Framework.Scenes
3692 CameraLeftAxis = cAgent.LeftAxis; 3693 CameraLeftAxis = cAgent.LeftAxis;
3693 CameraUpAxis = cAgent.UpAxis; 3694 CameraUpAxis = cAgent.UpAxis;
3694 ParentUUID = cAgent.ParentPart; 3695 ParentUUID = cAgent.ParentPart;
3695 m_prevSitOffset = cAgent.SitOffset; 3696 PrevSitOffset = cAgent.SitOffset;
3696 3697
3697 // When we get to the point of re-computing neighbors everytime this 3698 // When we get to the point of re-computing neighbors everytime this
3698 // changes, then start using the agent's drawdistance rather than the 3699 // changes, then start using the agent's drawdistance rather than the
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
index 5b5fb92..95b30d5 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
@@ -83,8 +83,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
83 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); 83 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
84 84
85 TestScene scene = new SceneHelpers().SetupScene(); 85 TestScene scene = new SceneHelpers().SetupScene();
86 SceneHelpers.SetupSceneModules(scene, new PermissionsModule()); 86 IConfigSource configSource = new IniConfigSource();
87 TestClient client = (TestClient)SceneHelpers.AddScenePresence(scene, userId).ControllingClient; 87 IConfig config = configSource.AddConfig("Startup");
88 config.Set("serverside_object_permissions", true);
89 SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() });
90 IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
88 91
89 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. 92 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
90 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; 93 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
@@ -106,9 +109,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
106 109
107 SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); 110 SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId);
108 Assert.That(retrievedPart2, Is.Null); 111 Assert.That(retrievedPart2, Is.Null);
109
110 Assert.That(client.ReceivedKills.Count, Is.EqualTo(1));
111 Assert.That(client.ReceivedKills[0], Is.EqualTo(soLocalId));
112 } 112 }
113 113
114 /// <summary> 114 /// <summary>
@@ -135,7 +135,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
135 SceneHelpers.SetupSceneModules(sceneB, config, etmB); 135 SceneHelpers.SetupSceneModules(sceneB, config, etmB);
136 136
137 // We need this for derez 137 // We need this for derez
138 SceneHelpers.SetupSceneModules(sceneA, new PermissionsModule()); 138 //SceneHelpers.SetupSceneModules(sceneA, new PermissionsModule());
139 139
140 UserAccount uaA = UserAccountHelpers.CreateUserWithInventory(sceneA, "Andy", "AAA", 0x1, ""); 140 UserAccount uaA = UserAccountHelpers.CreateUserWithInventory(sceneA, "Andy", "AAA", 0x1, "");
141 UserAccount uaB = UserAccountHelpers.CreateUserWithInventory(sceneA, "Brian", "BBB", 0x2, ""); 141 UserAccount uaB = UserAccountHelpers.CreateUserWithInventory(sceneA, "Brian", "BBB", 0x2, "");
@@ -155,12 +155,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
155 uint soLocalId = so.LocalId; 155 uint soLocalId = so.LocalId;
156 156
157 sceneA.DeleteSceneObject(so, false); 157 sceneA.DeleteSceneObject(so, false);
158
159 Assert.That(clientA.ReceivedKills.Count, Is.EqualTo(1));
160 Assert.That(clientA.ReceivedKills[0], Is.EqualTo(soLocalId));
161
162 Assert.That(childClientsB[0].ReceivedKills.Count, Is.EqualTo(1));
163 Assert.That(childClientsB[0].ReceivedKills[0], Is.EqualTo(soLocalId));
164 } 158 }
165 159
166 /// <summary> 160 /// <summary>
@@ -179,7 +173,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests
179 UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); 173 UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001");
180 174
181 TestScene scene = new SceneHelpers().SetupScene(); 175 TestScene scene = new SceneHelpers().SetupScene();
182 SceneHelpers.SetupSceneModules(scene, new PermissionsModule()); 176 IConfigSource configSource = new IniConfigSource();
177 IConfig config = configSource.AddConfig("Startup");
178 config.Set("serverside_object_permissions", true);
179 SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() });
183 IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; 180 IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
184 181
185 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. 182 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
@@ -262,4 +259,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests
262// Assert.That(retrievedPart, Is.Null); 259// Assert.That(retrievedPart, Is.Null);
263 } 260 }
264 } 261 }
265} \ No newline at end of file 262}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
index c7eaff9..e7a1fe0 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
@@ -71,7 +71,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
71 71
72 SceneHelpers.SetupSceneModules( 72 SceneHelpers.SetupSceneModules(
73 scene, configSource, new object[] 73 scene, configSource, new object[]
74 { new PermissionsModule(), 74 { new DefaultPermissionsModule(),
75 new GroupsModule(), 75 new GroupsModule(),
76 new MockGroupsServicesConnector() }); 76 new MockGroupsServicesConnector() });
77 77
@@ -82,4 +82,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests
82 groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true); 82 groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true);
83 } 83 }
84 } 84 }
85} \ No newline at end of file 85}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
index 8c25dbc..fff542b 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
@@ -282,7 +282,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
282 // We need to set up the permisions module on scene B so that our later use of agent limit to deny 282 // We need to set up the permisions module on scene B so that our later use of agent limit to deny
283 // QueryAccess won't succeed anyway because administrators are always allowed in and the default 283 // QueryAccess won't succeed anyway because administrators are always allowed in and the default
284 // IsAdministrator if no permissions module is present is true. 284 // IsAdministrator if no permissions module is present is true.
285 SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new PermissionsModule(), etmB }); 285 SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new DefaultPermissionsModule(), etmB });
286 286
287 // Shared scene modules 287 // Shared scene modules
288 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); 288 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
@@ -447,7 +447,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
447 // We need to set up the permisions module on scene B so that our later use of agent limit to deny 447 // We need to set up the permisions module on scene B so that our later use of agent limit to deny
448 // QueryAccess won't succeed anyway because administrators are always allowed in and the default 448 // QueryAccess won't succeed anyway because administrators are always allowed in and the default
449 // IsAdministrator if no permissions module is present is true. 449 // IsAdministrator if no permissions module is present is true.
450 SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new PermissionsModule(), etmB }); 450 SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new DefaultPermissionsModule(), etmB });
451 451
452 // Shared scene modules 452 // Shared scene modules
453 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); 453 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
@@ -660,4 +660,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests
660// TestHelpers.DisableLogging(); 660// TestHelpers.DisableLogging();
661 } 661 }
662 } 662 }
663} \ No newline at end of file 663}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 2fb073d..2427cbe 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -231,6 +231,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
231 ItemID = ScriptTask.ItemID; 231 ItemID = ScriptTask.ItemID;
232 AssetID = ScriptTask.AssetID; 232 AssetID = ScriptTask.AssetID;
233 } 233 }
234 LocalID = part.LocalId;
234 235
235 PrimName = part.ParentGroup.Name; 236 PrimName = part.ParentGroup.Name;
236 StartParam = startParam; 237 StartParam = startParam;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 9d1e143..27d7674 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1316,13 +1316,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1316 1316
1317 ScriptInstance instance = null; 1317 ScriptInstance instance = null;
1318 // Create the object record 1318 // Create the object record
1319 UUID appDomain = assetID;
1320
1321
1322
1319 lockScriptsForRead(true); 1323 lockScriptsForRead(true);
1320 if ((!m_Scripts.ContainsKey(itemID)) || 1324 if ((!m_Scripts.ContainsKey(itemID)) ||
1321 (m_Scripts[itemID].AssetID != assetID)) 1325 (m_Scripts[itemID].AssetID != assetID))
1322 { 1326 {
1323 lockScriptsForRead(false); 1327 lockScriptsForRead(false);
1324 1328 instance = new ScriptInstance(this, part,
1325 UUID appDomain = assetID; 1329 item,
1330 startParam, postOnRez,
1331 m_MaxScriptQueue);
1332
1333
1326 1334
1327 if (part.ParentGroup.IsAttachment) 1335 if (part.ParentGroup.IsAttachment)
1328 appDomain = part.ParentGroup.RootPart.UUID; 1336 appDomain = part.ParentGroup.RootPart.UUID;
@@ -1345,9 +1353,39 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1345 sandbox = AppDomain.CreateDomain( 1353 sandbox = AppDomain.CreateDomain(
1346 m_Scene.RegionInfo.RegionID.ToString(), 1354 m_Scene.RegionInfo.RegionID.ToString(),
1347 evidence, appSetup); 1355 evidence, appSetup);
1348 m_AppDomains[appDomain].AssemblyResolve += 1356 if (m_AppDomains.ContainsKey(appDomain))
1349 new ResolveEventHandler( 1357 {
1350 AssemblyResolver.OnAssemblyResolve); 1358 m_AppDomains[appDomain].AssemblyResolve +=
1359 new ResolveEventHandler(
1360 AssemblyResolver.OnAssemblyResolve);
1361 if (m_DomainScripts.ContainsKey(appDomain))
1362 {
1363 m_DomainScripts[appDomain].Add(itemID);
1364 }
1365 else
1366 {
1367 m_DomainScripts.Add(appDomain, new List<UUID>());
1368 m_DomainScripts[appDomain].Add(itemID);
1369 }
1370 }
1371 else
1372 {
1373 m_AppDomains.Add(appDomain, sandbox);
1374 m_AppDomains[appDomain].AssemblyResolve +=
1375 new ResolveEventHandler(
1376 AssemblyResolver.OnAssemblyResolve);
1377 if (m_DomainScripts.ContainsKey(appDomain))
1378 {
1379 m_DomainScripts[appDomain].Add(itemID);
1380 }
1381 else
1382 {
1383 m_DomainScripts.Add(appDomain, new List<UUID>());
1384 m_DomainScripts[appDomain].Add(itemID);
1385 }
1386
1387 }
1388
1351 } 1389 }
1352 else 1390 else
1353 { 1391 {
@@ -1373,12 +1411,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1373 return false; 1411 return false;
1374 } 1412 }
1375 } 1413 }
1376 m_DomainScripts[appDomain].Add(itemID); 1414
1377
1378 instance = new ScriptInstance(this, part,
1379 item,
1380 startParam, postOnRez,
1381 m_MaxScriptQueue);
1382 1415
1383 instance.Load(m_AppDomains[appDomain], assembly, stateSource); 1416 instance.Load(m_AppDomains[appDomain], assembly, stateSource);
1384// m_log.DebugFormat( 1417// m_log.DebugFormat(
@@ -1502,6 +1535,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1502 if (handlerObjectRemoved != null) 1535 if (handlerObjectRemoved != null)
1503 { 1536 {
1504 SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); 1537 SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
1538 if (part != null)
1505 handlerObjectRemoved(part.UUID); 1539 handlerObjectRemoved(part.UUID);
1506 } 1540 }
1507 1541