* Add new unit test for simple teleport in a standalone.

* Does not yet check results.
0.6.2-post-fixes
Justin Clarke Casey 2009-01-15 21:27:55 +00:00
parent 0ec96d294a
commit 093adb2113
10 changed files with 49 additions and 20 deletions

View File

@ -5824,6 +5824,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
break;
case PacketType.TeleportLocationRequest:
TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack;
// Console.WriteLine(tpLocReq.ToString());

View File

@ -250,6 +250,7 @@ namespace OpenSim.Region.Communications.Local
{
return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(agentID);
}
return false;
}

View File

@ -75,7 +75,6 @@ namespace OpenSim.Region.Environment.Modules.Communications.Local
return;
Init(scene);
}
public void PostInitialise()
@ -119,17 +118,17 @@ namespace OpenSim.Region.Environment.Modules.Communications.Local
#region IInterregionComms
public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit)
{
{
foreach (Scene s in m_sceneList)
{
{
if (s.RegionInfo.RegionHandle == regionHandle)
{
//m_log.Debug("[LOCAL COMMS]: Found region to send SendCreateChildAgent");
// m_log.DebugFormat("[LOCAL COMMS]: Found region {0} to send SendCreateChildAgent", regionHandle);
s.NewUserConnection(aCircuit);
return true;
}
}
//m_log.Debug("[LOCAL COMMS]: region not found for SendCreateChildAgent");
// m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for SendCreateChildAgent", regionHandle);
return false;
}

View File

@ -3129,6 +3129,7 @@ namespace OpenSim.Region.Environment.Scenes
remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found.");
return;
}
RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, teleportFlags);
}
@ -3149,7 +3150,8 @@ namespace OpenSim.Region.Environment.Scenes
if (m_scenePresences.ContainsKey(remoteClient.AgentId))
sp = m_scenePresences[remoteClient.AgentId];
}
if (sp!= null)
if (sp != null)
{
m_sceneGridService.RequestTeleportToLocation(sp, regionHandle,
position, lookAt, teleportFlags);

View File

@ -701,6 +701,7 @@ namespace OpenSim.Region.Environment.Scenes
position, avatar.Name, avatar.UUID, emergencyPos);
position = emergencyPos;
}
// TODO: Get proper AVG Height
float localAVHeight = 1.56f;
float posZLimit = (float)avatar.Scene.GetLandHeight((int)position.X, (int)position.Y);
@ -713,7 +714,6 @@ namespace OpenSim.Region.Environment.Scenes
// Only send this if the event queue is null
if (eq == null)
avatar.ControllingClient.SendTeleportLocationStart();
avatar.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
avatar.Teleport(position);

View File

@ -42,7 +42,6 @@ using OpenSim.Region.Interfaces;
using OpenSim.Region.Physics.Manager;
using OSD = OpenMetaverse.StructuredData.OSD;
namespace OpenSim.Region.Environment.Scenes
{
enum ScriptControlled : uint
@ -2757,7 +2756,6 @@ namespace OpenSim.Region.Environment.Scenes
static ScenePresence()
{
Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
DefaultTexture = textu.ToBytes();
}

View File

@ -25,17 +25,17 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using NUnit.Framework.SyntaxHelpers;
using System;
using System.Threading;
using System.Text;
using System.Collections.Generic;
using Nini.Config;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Region.Environment.Scenes;
using OpenMetaverse;
namespace OpenSim.Region.Environment.Scenes.Tests
{

View File

@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Net;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
@ -32,6 +33,7 @@ using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Servers;
using OpenSim.Region.Physics.Manager;
using OpenSim.Region.Environment;
using OpenSim.Region.Environment.Scenes;
using OpenSim.Tests.Common.Mock;
@ -48,18 +50,31 @@ namespace OpenSim.Region.Environment.Scenes.Tests
/// <returns></returns>
public static TestScene SetupScene()
{
RegionInfo regInfo = new RegionInfo(1000, 1000, null, null);
regInfo.RegionName = "Unit test region";
regInfo.ExternalHostName = "1.2.3.4";
return SetupScene("Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager());
}
/// <summary>
/// Set up a test scene
/// </summary>
/// <param name="name">Name of the region</param>
/// <param name="id">ID of the region</param>
/// <param name="x">X co-ordinate of the region</param>
/// <param name="y">Y co-ordinate of the region</param>
/// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
/// <returns></returns>
public static TestScene SetupScene(string name, UUID id, uint x, uint y, CommunicationsManager cm)
{
RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");
regInfo.RegionName = name;
regInfo.RegionID = id;
AgentCircuitManager acm = new AgentCircuitManager();
CommunicationsManager cm = new TestCommunicationsManager();
SceneCommunicationService scs = new SceneCommunicationService(cm);
SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin());
AssetCache ac = new AssetCache(assetService);
StorageManager sm = new OpenSim.Region.Environment.StorageManager("OpenSim.Data.Null.dll", "", "");
StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", "");
IConfigSource configSource = new IniConfigSource();
TestScene testScene = new TestScene(
@ -70,7 +85,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests
PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();
physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
testScene.PhysicsScene = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", configSource, "test");
testScene.PhysicsScene
= physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", configSource, "test");
return testScene;
}
@ -81,7 +97,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
/// <param name="scene"></param>
/// <param name="agentId"></param>
/// <returns></returns>
public static IClientAPI AddRootAgent(Scene scene, UUID agentId)
public static TestClient AddRootAgent(Scene scene, UUID agentId)
{
string firstName = "testfirstname";
@ -102,7 +118,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
scene.NewUserConnection(agent);
// Stage 2: add the new client as a child agent to the scene
IClientAPI client = new TestClient(agent);
TestClient client = new TestClient(agent);
scene.AddNewClient(client);
// Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance,

View File

@ -365,6 +365,17 @@ namespace OpenSim.Tests.Common.Mock
m_firstName = agentData.firstname;
m_lastName = agentData.lastname;
}
/// <summary>
/// Attempt a teleport to the given region.
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="position"></param>
/// <param name="lookAt"></param>
public void Teleport(ulong regionHandle, Vector3 position, Vector3 lookAt)
{
OnTeleportLocationRequest(this, regionHandle, position, lookAt, 16);
}
public virtual void ActivateGesture(UUID assetId, UUID gestureId)
{

View File

@ -69,7 +69,8 @@ namespace OpenSim.Tests.Common.Mock
m_userAdminService = lus;
LocalBackEndServices gs = new LocalBackEndServices();
m_gridService = gs;
m_gridService = gs;
m_interRegion = gs;
}
}
}