* Add new unit test for simple teleport in a standalone.
* Does not yet check results.0.6.2-post-fixes
parent
0ec96d294a
commit
093adb2113
|
@ -5824,6 +5824,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PacketType.TeleportLocationRequest:
|
case PacketType.TeleportLocationRequest:
|
||||||
TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack;
|
TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack;
|
||||||
// Console.WriteLine(tpLocReq.ToString());
|
// Console.WriteLine(tpLocReq.ToString());
|
||||||
|
|
|
@ -250,6 +250,7 @@ namespace OpenSim.Region.Communications.Local
|
||||||
{
|
{
|
||||||
return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(agentID);
|
return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(agentID);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,6 @@ namespace OpenSim.Region.Environment.Modules.Communications.Local
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Init(scene);
|
Init(scene);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
|
@ -119,17 +118,17 @@ namespace OpenSim.Region.Environment.Modules.Communications.Local
|
||||||
#region IInterregionComms
|
#region IInterregionComms
|
||||||
|
|
||||||
public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit)
|
public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit)
|
||||||
{
|
{
|
||||||
foreach (Scene s in m_sceneList)
|
foreach (Scene s in m_sceneList)
|
||||||
{
|
{
|
||||||
if (s.RegionInfo.RegionHandle == regionHandle)
|
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);
|
s.NewUserConnection(aCircuit);
|
||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3129,6 +3129,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found.");
|
remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, teleportFlags);
|
RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, teleportFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3149,7 +3150,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (m_scenePresences.ContainsKey(remoteClient.AgentId))
|
if (m_scenePresences.ContainsKey(remoteClient.AgentId))
|
||||||
sp = m_scenePresences[remoteClient.AgentId];
|
sp = m_scenePresences[remoteClient.AgentId];
|
||||||
}
|
}
|
||||||
if (sp!= null)
|
|
||||||
|
if (sp != null)
|
||||||
{
|
{
|
||||||
m_sceneGridService.RequestTeleportToLocation(sp, regionHandle,
|
m_sceneGridService.RequestTeleportToLocation(sp, regionHandle,
|
||||||
position, lookAt, teleportFlags);
|
position, lookAt, teleportFlags);
|
||||||
|
|
|
@ -701,6 +701,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
position, avatar.Name, avatar.UUID, emergencyPos);
|
position, avatar.Name, avatar.UUID, emergencyPos);
|
||||||
position = emergencyPos;
|
position = emergencyPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Get proper AVG Height
|
// TODO: Get proper AVG Height
|
||||||
float localAVHeight = 1.56f;
|
float localAVHeight = 1.56f;
|
||||||
float posZLimit = (float)avatar.Scene.GetLandHeight((int)position.X, (int)position.Y);
|
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
|
// Only send this if the event queue is null
|
||||||
if (eq == null)
|
if (eq == null)
|
||||||
avatar.ControllingClient.SendTeleportLocationStart();
|
avatar.ControllingClient.SendTeleportLocationStart();
|
||||||
|
|
||||||
|
|
||||||
avatar.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
|
avatar.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
|
||||||
avatar.Teleport(position);
|
avatar.Teleport(position);
|
||||||
|
|
|
@ -42,7 +42,6 @@ using OpenSim.Region.Interfaces;
|
||||||
using OpenSim.Region.Physics.Manager;
|
using OpenSim.Region.Physics.Manager;
|
||||||
using OSD = OpenMetaverse.StructuredData.OSD;
|
using OSD = OpenMetaverse.StructuredData.OSD;
|
||||||
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
enum ScriptControlled : uint
|
enum ScriptControlled : uint
|
||||||
|
@ -2757,7 +2756,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
static ScenePresence()
|
static ScenePresence()
|
||||||
{
|
{
|
||||||
|
|
||||||
Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
|
Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
|
||||||
DefaultTexture = textu.ToBytes();
|
DefaultTexture = textu.ToBytes();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,17 +25,17 @@
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using NUnit.Framework.SyntaxHelpers;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using NUnit.Framework.SyntaxHelpers;
|
||||||
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
using OpenMetaverse;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes.Tests
|
namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
using System.Net;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
|
@ -32,6 +33,7 @@ using OpenSim.Framework.Communications;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
using OpenSim.Region.Physics.Manager;
|
using OpenSim.Region.Physics.Manager;
|
||||||
|
using OpenSim.Region.Environment;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
using OpenSim.Tests.Common.Mock;
|
using OpenSim.Tests.Common.Mock;
|
||||||
|
|
||||||
|
@ -48,18 +50,31 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static TestScene SetupScene()
|
public static TestScene SetupScene()
|
||||||
{
|
{
|
||||||
RegionInfo regInfo = new RegionInfo(1000, 1000, null, null);
|
return SetupScene("Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager());
|
||||||
regInfo.RegionName = "Unit test region";
|
}
|
||||||
regInfo.ExternalHostName = "1.2.3.4";
|
|
||||||
|
/// <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();
|
AgentCircuitManager acm = new AgentCircuitManager();
|
||||||
CommunicationsManager cm = new TestCommunicationsManager();
|
|
||||||
SceneCommunicationService scs = new SceneCommunicationService(cm);
|
SceneCommunicationService scs = new SceneCommunicationService(cm);
|
||||||
|
|
||||||
SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin());
|
SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin());
|
||||||
AssetCache ac = new AssetCache(assetService);
|
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();
|
IConfigSource configSource = new IniConfigSource();
|
||||||
|
|
||||||
TestScene testScene = new TestScene(
|
TestScene testScene = new TestScene(
|
||||||
|
@ -70,7 +85,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
|
|
||||||
PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();
|
PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();
|
||||||
physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
|
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;
|
return testScene;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +97,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
/// <param name="agentId"></param>
|
/// <param name="agentId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static IClientAPI AddRootAgent(Scene scene, UUID agentId)
|
public static TestClient AddRootAgent(Scene scene, UUID agentId)
|
||||||
{
|
{
|
||||||
string firstName = "testfirstname";
|
string firstName = "testfirstname";
|
||||||
|
|
||||||
|
@ -102,7 +118,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
scene.NewUserConnection(agent);
|
scene.NewUserConnection(agent);
|
||||||
|
|
||||||
// Stage 2: add the new client as a child agent to the scene
|
// 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);
|
scene.AddNewClient(client);
|
||||||
|
|
||||||
// Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance,
|
// Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance,
|
||||||
|
|
|
@ -365,6 +365,17 @@ namespace OpenSim.Tests.Common.Mock
|
||||||
m_firstName = agentData.firstname;
|
m_firstName = agentData.firstname;
|
||||||
m_lastName = agentData.lastname;
|
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)
|
public virtual void ActivateGesture(UUID assetId, UUID gestureId)
|
||||||
{
|
{
|
||||||
|
|
|
@ -69,7 +69,8 @@ namespace OpenSim.Tests.Common.Mock
|
||||||
m_userAdminService = lus;
|
m_userAdminService = lus;
|
||||||
|
|
||||||
LocalBackEndServices gs = new LocalBackEndServices();
|
LocalBackEndServices gs = new LocalBackEndServices();
|
||||||
m_gridService = gs;
|
m_gridService = gs;
|
||||||
|
m_interRegion = gs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue