From f24289c47f81caf92c7cb91428008ce1bd038301 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 25 Apr 2012 01:09:23 +0100
Subject: Comment out AvatarService.SetAvatar debug log line for now
---
OpenSim/Services/AvatarService/AvatarService.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Services/AvatarService/AvatarService.cs b/OpenSim/Services/AvatarService/AvatarService.cs
index c59a9e0..423c781 100644
--- a/OpenSim/Services/AvatarService/AvatarService.cs
+++ b/OpenSim/Services/AvatarService/AvatarService.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Services.AvatarService
if (kvp.Key.StartsWith("_"))
count++;
- m_log.DebugFormat("[AVATAR SERVICE]: SetAvatar for {0}, attachs={1}", principalID, count);
+// m_log.DebugFormat("[AVATAR SERVICE]: SetAvatar for {0}, attachs={1}", principalID, count);
m_Database.Delete("PrincipalID", principalID.ToString());
AvatarBaseData av = new AvatarBaseData();
--
cgit v1.1
From a65ca24701ac34415bf76f4d9094ab42ae721c9a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 25 Apr 2012 01:51:40 +0100
Subject: Add regression test TestSameRegionTeleport()
---
.../EntityTransfer/EntityTransferModule.cs | 2 +-
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 ++++
.../Scenes/Tests/ScenePresenceTeleportTests.cs | 36 ++++++++++++++++++++++
3 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index feb783f..221e0bd 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -192,7 +192,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_log.WarnFormat(
"[ENTITY TRANSFER MODULE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
position, sp.Name, sp.UUID, emergencyPos);
-
+
position = emergencyPos;
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index b5f789b..9005acd 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -990,6 +990,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public void Teleport(Vector3 pos)
{
+// m_log.DebugFormat("[SCENE PRESENCE]: Moving {0} to {1} in {2}", Name, pos, Scene.RegionInfo.RegionName);
+
bool isFlying = Flying;
RemoveFromPhysicalScene();
Velocity = Vector3.Zero;
@@ -1002,6 +1004,10 @@ namespace OpenSim.Region.Framework.Scenes
public void TeleportWithMomentum(Vector3 pos)
{
+// m_log.DebugFormat(
+// "[SCENE PRESENCE]: Moving {0} to {1} with existing momentum {2} in {3} ",
+// Name, pos, Velocity, Scene.RegionInfo.RegionName);
+
bool isFlying = Flying;
RemoveFromPhysicalScene();
CheckLandingPoint(ref pos);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
index bebc10c..eb7bfbd 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
@@ -33,6 +33,7 @@ using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers;
+using OpenSim.Region.CoreModules.Framework.EntityTransfer;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
using OpenSim.Tests.Common;
@@ -47,6 +48,41 @@ namespace OpenSim.Region.Framework.Scenes.Tests
[TestFixture]
public class ScenePresenceTeleportTests
{
+ [Test]
+ public void TestSameRegionTeleport()
+ {
+ TestHelpers.InMethod();
+// log4net.Config.XmlConfigurator.Configure();
+
+ EntityTransferModule etm = new EntityTransferModule();
+
+ IConfigSource config = new IniConfigSource();
+ config.AddConfig("Modules");
+ // Not strictly necessary since FriendsModule assumes it is the default (!)
+ config.Configs["Modules"].Set("EntityTransferModule", etm.Name);
+
+ TestScene scene = SceneHelpers.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
+ SceneHelpers.SetupSceneModules(scene, config, etm);
+
+ Vector3 teleportPosition = new Vector3(10, 11, 12);
+ Vector3 teleportLookAt = new Vector3(20, 21, 22);
+
+ ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
+ sp.AbsolutePosition = new Vector3(30, 31, 32);
+ scene.RequestTeleportLocation(
+ sp.ControllingClient,
+ scene.RegionInfo.RegionHandle,
+ teleportPosition,
+ teleportLookAt,
+ (uint)TeleportFlags.ViaLocation);
+
+ Assert.That(sp.AbsolutePosition, Is.EqualTo(teleportPosition));
+
+ // Lookat is sent to the client only - sp.Lookat does not yield the same thing (calculation from camera
+ // position instead).
+// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
+ }
+
///
/// Test a teleport between two regions that are not neighbours and do not share any neighbours in common.
///
--
cgit v1.1
From 683cfc6f827c15ee70e4651cbcc7b94a01d2f8e3 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 25 Apr 2012 02:07:55 +0100
Subject: refactor: Combine ScenePresence.Teleport() and TeleportWithMomentum()
These are identical apart from setting Velocity = zero, which has no practical effect anyway since this is zeroed when the avatar is added back to the physics scene.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 16 ----------------
.../OptionalModules/Scripting/Minimodule/SPAvatar.cs | 2 +-
2 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9005acd..8cb4921 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -994,22 +994,6 @@ namespace OpenSim.Region.Framework.Scenes
bool isFlying = Flying;
RemoveFromPhysicalScene();
- Velocity = Vector3.Zero;
- CheckLandingPoint(ref pos);
- AbsolutePosition = pos;
- AddToPhysicalScene(isFlying);
-
- SendTerseUpdateToAllClients();
- }
-
- public void TeleportWithMomentum(Vector3 pos)
- {
-// m_log.DebugFormat(
-// "[SCENE PRESENCE]: Moving {0} to {1} with existing momentum {2} in {3} ",
-// Name, pos, Velocity, Scene.RegionInfo.RegionName);
-
- bool isFlying = Flying;
- RemoveFromPhysicalScene();
CheckLandingPoint(ref pos);
AbsolutePosition = pos;
AddToPhysicalScene(isFlying);
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs
index 922eaaf..d192309 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
public Vector3 WorldPosition
{
get { return GetSP().AbsolutePosition; }
- set { GetSP().TeleportWithMomentum(value); }
+ set { GetSP().Teleport(value); }
}
public bool IsChildAgent
--
cgit v1.1