aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs11
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs113
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs1
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs4
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs33
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs1
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs1
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs2
9 files changed, 150 insertions, 20 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 4272375..725bf06 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -229,7 +229,12 @@ namespace OpenSim.Region.ClientStack.Linden
229 queue.Enqueue(ev); 229 queue.Enqueue(ev);
230 } 230 }
231 else 231 else
232 m_log.WarnFormat("[EVENTQUEUE]: (Enqueue) No queue found for agent {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName); 232 {
233 OSDMap evMap = (OSDMap)ev;
234 m_log.WarnFormat(
235 "[EVENTQUEUE]: (Enqueue) No queue found for agent {0} when placing message {1} in region {2}",
236 avatarID, evMap["message"], m_scene.Name);
237 }
233 } 238 }
234 catch (NullReferenceException e) 239 catch (NullReferenceException e)
235 { 240 {
@@ -365,14 +370,14 @@ namespace OpenSim.Region.ClientStack.Linden
365 OSDMap ev = (OSDMap)element; 370 OSDMap ev = (OSDMap)element;
366 m_log.DebugFormat( 371 m_log.DebugFormat(
367 "Eq OUT {0,-30} to {1,-20} {2,-20}", 372 "Eq OUT {0,-30} to {1,-20} {2,-20}",
368 ev["message"], m_scene.GetScenePresence(agentId).Name, m_scene.RegionInfo.RegionName); 373 ev["message"], m_scene.GetScenePresence(agentId).Name, m_scene.Name);
369 } 374 }
370 } 375 }
371 376
372 public Hashtable GetEvents(UUID requestID, UUID pAgentId) 377 public Hashtable GetEvents(UUID requestID, UUID pAgentId)
373 { 378 {
374 if (DebugLevel >= 2) 379 if (DebugLevel >= 2)
375 m_log.WarnFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.RegionInfo.RegionName); 380 m_log.WarnFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.Name);
376 381
377 Queue<OSD> queue = GetQueue(pAgentId); 382 Queue<OSD> queue = GetQueue(pAgentId);
378 if (queue == null) 383 if (queue == null)
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index 7c8c189..35045b5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -799,7 +799,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
799 } 799 }
800 800
801 [Test] 801 [Test]
802 public void TestSameSimulatorNeighbouringRegionsTeleport() 802 public void TestSameSimulatorNeighbouringRegionsTeleportV1()
803 { 803 {
804 TestHelpers.InMethod(); 804 TestHelpers.InMethod();
805// TestHelpers.EnableLogging(); 805// TestHelpers.EnableLogging();
@@ -904,5 +904,116 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
904 // Check events 904 // Check events
905 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0)); 905 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
906 } 906 }
907
908 [Test]
909 public void TestSameSimulatorNeighbouringRegionsTeleportV2()
910 {
911 TestHelpers.InMethod();
912// TestHelpers.EnableLogging();
913
914 BaseHttpServer httpServer = new BaseHttpServer(99999);
915 MainServer.AddHttpServer(httpServer);
916 MainServer.Instance = httpServer;
917
918 AttachmentsModule attModA = new AttachmentsModule();
919 AttachmentsModule attModB = new AttachmentsModule();
920 EntityTransferModule etmA = new EntityTransferModule();
921 EntityTransferModule etmB = new EntityTransferModule();
922 LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
923
924 IConfigSource config = new IniConfigSource();
925 IConfig modulesConfig = config.AddConfig("Modules");
926 modulesConfig.Set("EntityTransferModule", etmA.Name);
927 modulesConfig.Set("SimulationServices", lscm.Name);
928 IConfig entityTransferConfig = config.AddConfig("EntityTransfer");
929
930 modulesConfig.Set("InventoryAccessModule", "BasicInventoryAccessModule");
931
932 SceneHelpers sh = new SceneHelpers();
933 TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
934 TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1001, 1000);
935
936 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
937 SceneHelpers.SetupSceneModules(
938 sceneA, config, new CapabilitiesModule(), etmA, attModA, new BasicInventoryAccessModule());
939 SceneHelpers.SetupSceneModules(
940 sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule());
941
942 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1);
943
944 AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID);
945 TestClient tc = new TestClient(acd, sceneA);
946 List<TestClient> destinationTestClients = new List<TestClient>();
947 EntityTransferHelpers.SetUpInformClientOfNeighbour(tc, destinationTestClients);
948
949 ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd);
950 beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32);
951
952 Assert.That(destinationTestClients.Count, Is.EqualTo(1));
953 Assert.That(destinationTestClients[0], Is.Not.Null);
954
955 InventoryItemBase attItem = CreateAttachmentItem(sceneA, ua1.PrincipalID, "att", 0x10, 0x20);
956
957 sceneA.AttachmentsModule.RezSingleAttachmentFromInventory(
958 beforeTeleportSp, attItem.ID, (uint)AttachmentPoint.Chest);
959
960 Vector3 teleportPosition = new Vector3(10, 11, 12);
961 Vector3 teleportLookAt = new Vector3(20, 21, 22);
962
963 // Here, we need to make clientA's receipt of SendRegionTeleport trigger clientB's CompleteMovement(). This
964 // is to operate the teleport V2 mechanism where the EntityTransferModule will first request the client to
965 // CompleteMovement to the region and then call UpdateAgent to the destination region to confirm the receipt
966 // Both these operations will occur on different threads and will wait for each other.
967 // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1
968 // test protocol, where we are trying to avoid unpredictable async operations in regression tests.
969 ((TestClient)beforeTeleportSp.ControllingClient).OnTestClientSendRegionTeleport
970 += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL)
971 => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null);
972
973 m_numberOfAttachEventsFired = 0;
974 sceneA.RequestTeleportLocation(
975 beforeTeleportSp.ControllingClient,
976 sceneB.RegionInfo.RegionHandle,
977 teleportPosition,
978 teleportLookAt,
979 (uint)TeleportFlags.ViaLocation);
980
981 // Check attachments have made it into sceneB
982 ScenePresence afterTeleportSceneBSp = sceneB.GetScenePresence(ua1.PrincipalID);
983
984 // This is appearance data, as opposed to actually rezzed attachments
985 List<AvatarAttachment> sceneBAttachments = afterTeleportSceneBSp.Appearance.GetAttachments();
986 Assert.That(sceneBAttachments.Count, Is.EqualTo(1));
987 Assert.That(sceneBAttachments[0].AttachPoint, Is.EqualTo((int)AttachmentPoint.Chest));
988 Assert.That(sceneBAttachments[0].ItemID, Is.EqualTo(attItem.ID));
989 Assert.That(sceneBAttachments[0].AssetID, Is.EqualTo(attItem.AssetID));
990 Assert.That(afterTeleportSceneBSp.Appearance.GetAttachpoint(attItem.ID), Is.EqualTo((int)AttachmentPoint.Chest));
991
992 // This is the actual attachment
993 List<SceneObjectGroup> actualSceneBAttachments = afterTeleportSceneBSp.GetAttachments();
994 Assert.That(actualSceneBAttachments.Count, Is.EqualTo(1));
995 SceneObjectGroup actualSceneBAtt = actualSceneBAttachments[0];
996 Assert.That(actualSceneBAtt.Name, Is.EqualTo(attItem.Name));
997 Assert.That(actualSceneBAtt.AttachmentPoint, Is.EqualTo((uint)AttachmentPoint.Chest));
998
999 Assert.That(sceneB.GetSceneObjectGroups().Count, Is.EqualTo(1));
1000
1001 // Check attachments have been removed from sceneA
1002 ScenePresence afterTeleportSceneASp = sceneA.GetScenePresence(ua1.PrincipalID);
1003
1004 // Since this is appearance data, it is still present on the child avatar!
1005 List<AvatarAttachment> sceneAAttachments = afterTeleportSceneASp.Appearance.GetAttachments();
1006 Assert.That(sceneAAttachments.Count, Is.EqualTo(1));
1007 Assert.That(afterTeleportSceneASp.Appearance.GetAttachpoint(attItem.ID), Is.EqualTo((int)AttachmentPoint.Chest));
1008
1009 // This is the actual attachment, which should no longer exist
1010 List<SceneObjectGroup> actualSceneAAttachments = afterTeleportSceneASp.GetAttachments();
1011 Assert.That(actualSceneAAttachments.Count, Is.EqualTo(0));
1012
1013 Assert.That(sceneA.GetSceneObjectGroups().Count, Is.EqualTo(0));
1014
1015 // Check events
1016 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
1017 }
907 } 1018 }
908} 1019}
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index e0f061b..8a734e1 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -1212,7 +1212,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1212 AgentDataMap.Add("AgentID", OSD.FromUUID(dataForAgentID)); 1212 AgentDataMap.Add("AgentID", OSD.FromUUID(dataForAgentID));
1213 AgentData.Add(AgentDataMap); 1213 AgentData.Add(AgentDataMap);
1214 1214
1215
1216 OSDArray GroupData = new OSDArray(data.Length); 1215 OSDArray GroupData = new OSDArray(data.Length);
1217 OSDArray NewGroupData = new OSDArray(data.Length); 1216 OSDArray NewGroupData = new OSDArray(data.Length);
1218 1217
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index b0a29c0..78fe096 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -377,7 +377,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
377 m_log.DebugFormat("[NPC MODULE]: Found {0} {1} to remove", 377 m_log.DebugFormat("[NPC MODULE]: Found {0} {1} to remove",
378 agentID, av.Name); 378 agentID, av.Name);
379 */ 379 */
380 scene.RemoveClient(agentID, false); 380
381 scene.IncomingCloseAgent(agentID, false);
382// scene.RemoveClient(agentID, false);
381 m_avatars.Remove(agentID); 383 m_avatars.Remove(agentID);
382 384
383// m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", agentID, av.Name); 385// m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", agentID, av.Name);
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
index 0f11c4a..5f232a4 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
@@ -311,21 +311,28 @@ public class BSActorAvatarMove : BSActor
311 // Don't care about collisions with the terrain 311 // Don't care about collisions with the terrain
312 if (kvp.Key > m_physicsScene.TerrainManager.HighestTerrainID) 312 if (kvp.Key > m_physicsScene.TerrainManager.HighestTerrainID)
313 { 313 {
314 OMV.Vector3 touchPosition = kvp.Value.Position; 314 BSPhysObject collisionObject;
315 m_physicsScene.DetailLog("{0},BSCharacter.WalkUpStairs,min={1},max={2},touch={3}", 315 if (m_physicsScene.PhysObjects.TryGetValue(kvp.Key, out collisionObject))
316 m_controllingPrim.LocalID, nearFeetHeightMin, nearFeetHeightMax, touchPosition);
317 if (touchPosition.Z >= nearFeetHeightMin && touchPosition.Z <= nearFeetHeightMax)
318 { 316 {
319 // This contact is within the 'near the feet' range. 317 if (!collisionObject.IsVolumeDetect)
320 // The normal should be our contact point to the object so it is pointing away
321 // thus the difference between our facing orientation and the normal should be small.
322 OMV.Vector3 directionFacing = OMV.Vector3.UnitX * m_controllingPrim.RawOrientation;
323 OMV.Vector3 touchNormal = OMV.Vector3.Normalize(kvp.Value.SurfaceNormal);
324 float diff = Math.Abs(OMV.Vector3.Distance(directionFacing, touchNormal));
325 if (diff < BSParam.AvatarStepApproachFactor)
326 { 318 {
327 if (highestTouchPosition.Z < touchPosition.Z) 319 OMV.Vector3 touchPosition = kvp.Value.Position;
328 highestTouchPosition = touchPosition; 320 m_physicsScene.DetailLog("{0},BSCharacter.WalkUpStairs,min={1},max={2},touch={3}",
321 m_controllingPrim.LocalID, nearFeetHeightMin, nearFeetHeightMax, touchPosition);
322 if (touchPosition.Z >= nearFeetHeightMin && touchPosition.Z <= nearFeetHeightMax)
323 {
324 // This contact is within the 'near the feet' range.
325 // The normal should be our contact point to the object so it is pointing away
326 // thus the difference between our facing orientation and the normal should be small.
327 OMV.Vector3 directionFacing = OMV.Vector3.UnitX * m_controllingPrim.RawOrientation;
328 OMV.Vector3 touchNormal = OMV.Vector3.Normalize(kvp.Value.SurfaceNormal);
329 float diff = Math.Abs(OMV.Vector3.Distance(directionFacing, touchNormal));
330 if (diff < BSParam.AvatarStepApproachFactor)
331 {
332 if (highestTouchPosition.Z < touchPosition.Z)
333 highestTouchPosition = touchPosition;
334 }
335 }
329 } 336 }
330 } 337 }
331 } 338 }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 9af3dce..d584782 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -404,6 +404,7 @@ public sealed class BSCharacter : BSPhysObject
404 404
405 // Allows the detection of collisions with inherently non-physical prims. see llVolumeDetect for more 405 // Allows the detection of collisions with inherently non-physical prims. see llVolumeDetect for more
406 public override void SetVolumeDetect(int param) { return; } 406 public override void SetVolumeDetect(int param) { return; }
407 public override bool IsVolumeDetect { get { return false; } }
407 408
408 public override OMV.Vector3 GeometricCenter { get { return OMV.Vector3.Zero; } } 409 public override OMV.Vector3 GeometricCenter { get { return OMV.Vector3.Zero; } }
409 public override OMV.Vector3 CenterOfMass { get { return OMV.Vector3.Zero; } } 410 public override OMV.Vector3 CenterOfMass { get { return OMV.Vector3.Zero; } }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
index 0704591..27caf62 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
@@ -175,6 +175,7 @@ public abstract class BSPhysObject : PhysicsActor
175 public abstract bool IsSolid { get; } 175 public abstract bool IsSolid { get; }
176 public abstract bool IsStatic { get; } 176 public abstract bool IsStatic { get; }
177 public abstract bool IsSelected { get; } 177 public abstract bool IsSelected { get; }
178 public abstract bool IsVolumeDetect { get; }
178 179
179 // Materialness 180 // Materialness
180 public MaterialAttributes.Material Material { get; private set; } 181 public MaterialAttributes.Material Material { get; private set; }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index a0b6abc..6b5dea3 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -617,6 +617,10 @@ public class BSPrim : BSPhysObject
617 } 617 }
618 return; 618 return;
619 } 619 }
620 public override bool IsVolumeDetect
621 {
622 get { return _isVolumeDetect; }
623 }
620 public override void SetMaterial(int material) 624 public override void SetMaterial(int material)
621 { 625 {
622 base.SetMaterial(material); 626 base.SetMaterial(material);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 3646c98..2fb073d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -533,7 +533,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
533 m_log.Warn( 533 m_log.Warn(
534 string.Format( 534 string.Format(
535 "[SCRIPT INSTANCE]: Could not delete script state {0} for script {1} (id {2}) in part {3} (id {4}) in object {5} in {6}. Exception ", 535 "[SCRIPT INSTANCE]: Could not delete script state {0} for script {1} (id {2}) in part {3} (id {4}) in object {5} in {6}. Exception ",
536 ScriptTask.Name, ScriptTask.ItemID, Part.Name, Part.UUID, Part.ParentGroup.Name, Engine.World.Name), 536 savedState, ScriptTask.Name, ScriptTask.ItemID, Part.Name, Part.UUID, Part.ParentGroup.Name, Engine.World.Name),
537 e); 537 e);
538 } 538 }
539 } 539 }