aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-15 21:27:55 +0000
committerJustin Clarke Casey2009-01-15 21:27:55 +0000
commit093adb2113d748f28554393cc8a6fe53502126dc (patch)
tree5565cca869b7a83845efc129f21e5f1219c16adf /OpenSim/Region/Environment
parentSmall bit of refactoring related to the hypergrid link loading from xml files. (diff)
downloadopensim-SC_OLD-093adb2113d748f28554393cc8a6fe53502126dc.zip
opensim-SC_OLD-093adb2113d748f28554393cc8a6fe53502126dc.tar.gz
opensim-SC_OLD-093adb2113d748f28554393cc8a6fe53502126dc.tar.bz2
opensim-SC_OLD-093adb2113d748f28554393cc8a6fe53502126dc.tar.xz
* Add new unit test for simple teleport in a standalone.
* Does not yet check results.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/EntityManagerTests.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs32
6 files changed, 34 insertions, 19 deletions
diff --git a/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs b/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs
index efc5c39..5fcb4bc 100644
--- a/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs
+++ b/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs
@@ -75,7 +75,6 @@ namespace OpenSim.Region.Environment.Modules.Communications.Local
75 return; 75 return;
76 76
77 Init(scene); 77 Init(scene);
78
79 } 78 }
80 79
81 public void PostInitialise() 80 public void PostInitialise()
@@ -119,17 +118,17 @@ namespace OpenSim.Region.Environment.Modules.Communications.Local
119 #region IInterregionComms 118 #region IInterregionComms
120 119
121 public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit) 120 public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit)
122 { 121 {
123 foreach (Scene s in m_sceneList) 122 foreach (Scene s in m_sceneList)
124 { 123 {
125 if (s.RegionInfo.RegionHandle == regionHandle) 124 if (s.RegionInfo.RegionHandle == regionHandle)
126 { 125 {
127 //m_log.Debug("[LOCAL COMMS]: Found region to send SendCreateChildAgent"); 126// m_log.DebugFormat("[LOCAL COMMS]: Found region {0} to send SendCreateChildAgent", regionHandle);
128 s.NewUserConnection(aCircuit); 127 s.NewUserConnection(aCircuit);
129 return true; 128 return true;
130 } 129 }
131 } 130 }
132 //m_log.Debug("[LOCAL COMMS]: region not found for SendCreateChildAgent"); 131// m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for SendCreateChildAgent", regionHandle);
133 return false; 132 return false;
134 } 133 }
135 134
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 94ca07c..fad90fa 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -3129,6 +3129,7 @@ namespace OpenSim.Region.Environment.Scenes
3129 remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found."); 3129 remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found.");
3130 return; 3130 return;
3131 } 3131 }
3132
3132 RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, teleportFlags); 3133 RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, teleportFlags);
3133 } 3134 }
3134 3135
@@ -3149,7 +3150,8 @@ namespace OpenSim.Region.Environment.Scenes
3149 if (m_scenePresences.ContainsKey(remoteClient.AgentId)) 3150 if (m_scenePresences.ContainsKey(remoteClient.AgentId))
3150 sp = m_scenePresences[remoteClient.AgentId]; 3151 sp = m_scenePresences[remoteClient.AgentId];
3151 } 3152 }
3152 if (sp!= null) 3153
3154 if (sp != null)
3153 { 3155 {
3154 m_sceneGridService.RequestTeleportToLocation(sp, regionHandle, 3156 m_sceneGridService.RequestTeleportToLocation(sp, regionHandle,
3155 position, lookAt, teleportFlags); 3157 position, lookAt, teleportFlags);
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index ab4e7d8..65e62ef 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -701,6 +701,7 @@ namespace OpenSim.Region.Environment.Scenes
701 position, avatar.Name, avatar.UUID, emergencyPos); 701 position, avatar.Name, avatar.UUID, emergencyPos);
702 position = emergencyPos; 702 position = emergencyPos;
703 } 703 }
704
704 // TODO: Get proper AVG Height 705 // TODO: Get proper AVG Height
705 float localAVHeight = 1.56f; 706 float localAVHeight = 1.56f;
706 float posZLimit = (float)avatar.Scene.GetLandHeight((int)position.X, (int)position.Y); 707 float posZLimit = (float)avatar.Scene.GetLandHeight((int)position.X, (int)position.Y);
@@ -713,7 +714,6 @@ namespace OpenSim.Region.Environment.Scenes
713 // Only send this if the event queue is null 714 // Only send this if the event queue is null
714 if (eq == null) 715 if (eq == null)
715 avatar.ControllingClient.SendTeleportLocationStart(); 716 avatar.ControllingClient.SendTeleportLocationStart();
716
717 717
718 avatar.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags); 718 avatar.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
719 avatar.Teleport(position); 719 avatar.Teleport(position);
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 00e5548..d2d8335 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -42,7 +42,6 @@ using OpenSim.Region.Interfaces;
42using OpenSim.Region.Physics.Manager; 42using OpenSim.Region.Physics.Manager;
43using OSD = OpenMetaverse.StructuredData.OSD; 43using OSD = OpenMetaverse.StructuredData.OSD;
44 44
45
46namespace OpenSim.Region.Environment.Scenes 45namespace OpenSim.Region.Environment.Scenes
47{ 46{
48 enum ScriptControlled : uint 47 enum ScriptControlled : uint
@@ -2757,7 +2756,6 @@ namespace OpenSim.Region.Environment.Scenes
2757 2756
2758 static ScenePresence() 2757 static ScenePresence()
2759 { 2758 {
2760
2761 Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); 2759 Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
2762 DefaultTexture = textu.ToBytes(); 2760 DefaultTexture = textu.ToBytes();
2763 } 2761 }
diff --git a/OpenSim/Region/Environment/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Environment/Scenes/Tests/EntityManagerTests.cs
index 5923a2c..cc9cc03 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/EntityManagerTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/EntityManagerTests.cs
@@ -25,17 +25,17 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using NUnit.Framework.SyntaxHelpers;
29using System; 28using System;
30using System.Threading; 29using System.Threading;
31using System.Text; 30using System.Text;
32using System.Collections.Generic; 31using System.Collections.Generic;
33using Nini.Config; 32using Nini.Config;
34using NUnit.Framework; 33using NUnit.Framework;
34using NUnit.Framework.SyntaxHelpers;
35using OpenMetaverse;
35using OpenSim.Framework; 36using OpenSim.Framework;
36using OpenSim.Framework.Communications; 37using OpenSim.Framework.Communications;
37using OpenSim.Region.Environment.Scenes; 38using OpenSim.Region.Environment.Scenes;
38using OpenMetaverse;
39 39
40namespace OpenSim.Region.Environment.Scenes.Tests 40namespace OpenSim.Region.Environment.Scenes.Tests
41{ 41{
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
index a9a9ecd..3c4049d 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System.Net;
28using Nini.Config; 29using Nini.Config;
29using OpenMetaverse; 30using OpenMetaverse;
30using OpenSim.Framework; 31using OpenSim.Framework;
@@ -32,6 +33,7 @@ using OpenSim.Framework.Communications;
32using OpenSim.Framework.Communications.Cache; 33using OpenSim.Framework.Communications.Cache;
33using OpenSim.Framework.Servers; 34using OpenSim.Framework.Servers;
34using OpenSim.Region.Physics.Manager; 35using OpenSim.Region.Physics.Manager;
36using OpenSim.Region.Environment;
35using OpenSim.Region.Environment.Scenes; 37using OpenSim.Region.Environment.Scenes;
36using OpenSim.Tests.Common.Mock; 38using OpenSim.Tests.Common.Mock;
37 39
@@ -48,18 +50,31 @@ namespace OpenSim.Region.Environment.Scenes.Tests
48 /// <returns></returns> 50 /// <returns></returns>
49 public static TestScene SetupScene() 51 public static TestScene SetupScene()
50 { 52 {
51 RegionInfo regInfo = new RegionInfo(1000, 1000, null, null); 53 return SetupScene("Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager());
52 regInfo.RegionName = "Unit test region"; 54 }
53 regInfo.ExternalHostName = "1.2.3.4"; 55
56 /// <summary>
57 /// Set up a test scene
58 /// </summary>
59 /// <param name="name">Name of the region</param>
60 /// <param name="id">ID of the region</param>
61 /// <param name="x">X co-ordinate of the region</param>
62 /// <param name="y">Y co-ordinate of the region</param>
63 /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
64 /// <returns></returns>
65 public static TestScene SetupScene(string name, UUID id, uint x, uint y, CommunicationsManager cm)
66 {
67 RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");
68 regInfo.RegionName = name;
69 regInfo.RegionID = id;
54 70
55 AgentCircuitManager acm = new AgentCircuitManager(); 71 AgentCircuitManager acm = new AgentCircuitManager();
56 CommunicationsManager cm = new TestCommunicationsManager();
57 SceneCommunicationService scs = new SceneCommunicationService(cm); 72 SceneCommunicationService scs = new SceneCommunicationService(cm);
58 73
59 SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin()); 74 SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin());
60 AssetCache ac = new AssetCache(assetService); 75 AssetCache ac = new AssetCache(assetService);
61 76
62 StorageManager sm = new OpenSim.Region.Environment.StorageManager("OpenSim.Data.Null.dll", "", ""); 77 StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", "");
63 IConfigSource configSource = new IniConfigSource(); 78 IConfigSource configSource = new IniConfigSource();
64 79
65 TestScene testScene = new TestScene( 80 TestScene testScene = new TestScene(
@@ -70,7 +85,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests
70 85
71 PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); 86 PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();
72 physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); 87 physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
73 testScene.PhysicsScene = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", configSource, "test"); 88 testScene.PhysicsScene
89 = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", configSource, "test");
74 90
75 return testScene; 91 return testScene;
76 } 92 }
@@ -81,7 +97,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
81 /// <param name="scene"></param> 97 /// <param name="scene"></param>
82 /// <param name="agentId"></param> 98 /// <param name="agentId"></param>
83 /// <returns></returns> 99 /// <returns></returns>
84 public static IClientAPI AddRootAgent(Scene scene, UUID agentId) 100 public static TestClient AddRootAgent(Scene scene, UUID agentId)
85 { 101 {
86 string firstName = "testfirstname"; 102 string firstName = "testfirstname";
87 103
@@ -102,7 +118,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
102 scene.NewUserConnection(agent); 118 scene.NewUserConnection(agent);
103 119
104 // Stage 2: add the new client as a child agent to the scene 120 // Stage 2: add the new client as a child agent to the scene
105 IClientAPI client = new TestClient(agent); 121 TestClient client = new TestClient(agent);
106 scene.AddNewClient(client); 122 scene.AddNewClient(client);
107 123
108 // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance, 124 // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance,