aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs4
-rw-r--r--OpenSim/Framework/Capabilities/CapsHandlers.cs2
-rw-r--r--OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs9
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs56
6 files changed, 65 insertions, 20 deletions
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index da953bb..0db7bb9 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -142,7 +142,7 @@ namespace OpenSim.Framework.Capabilities
142 142
143 m_httpListenPort = httpPort; 143 m_httpListenPort = httpPort;
144 144
145 if (httpServer.UseSSL) 145 if (httpServer != null && httpServer.UseSSL)
146 { 146 {
147 m_httpListenPort = httpServer.SSLPort; 147 m_httpListenPort = httpServer.SSLPort;
148 httpListen = httpServer.SSLCommonName; 148 httpListen = httpServer.SSLCommonName;
@@ -151,7 +151,7 @@ namespace OpenSim.Framework.Capabilities
151 151
152 m_agentID = agent; 152 m_agentID = agent;
153 m_dumpAssetsToFile = dumpAssetsToFile; 153 m_dumpAssetsToFile = dumpAssetsToFile;
154 m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, httpServer.UseSSL); 154 m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, (httpServer == null) ? false : httpServer.UseSSL);
155 m_regionName = regionName; 155 m_regionName = regionName;
156 } 156 }
157 157
diff --git a/OpenSim/Framework/Capabilities/CapsHandlers.cs b/OpenSim/Framework/Capabilities/CapsHandlers.cs
index f000aed..864e6dd 100644
--- a/OpenSim/Framework/Capabilities/CapsHandlers.cs
+++ b/OpenSim/Framework/Capabilities/CapsHandlers.cs
@@ -74,7 +74,7 @@ namespace OpenSim.Framework.Capabilities
74 m_httpListenerHostName = httpListenerHostname; 74 m_httpListenerHostName = httpListenerHostname;
75 m_httpListenerPort = httpListenerPort; 75 m_httpListenerPort = httpListenerPort;
76 m_useSSL = https; 76 m_useSSL = https;
77 if (m_useSSL) 77 if (httpListener != null && m_useSSL)
78 { 78 {
79 m_httpListenerHostName = httpListener.SSLCommonName; 79 m_httpListenerHostName = httpListener.SSLCommonName;
80 m_httpListenerPort = httpListener.SSLPort; 80 m_httpListenerPort = httpListener.SSLPort;
diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
index a6f5d97..c023a6f 100644
--- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
@@ -109,9 +109,9 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
109 Caps caps 109 Caps caps
110 = new Caps(m_scene, 110 = new Caps(m_scene,
111 m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName, 111 m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName,
112 MainServer.Instance.Port, 112 (MainServer.Instance == null) ? 0: MainServer.Instance.Port,
113 capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName); 113 capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);
114 114
115 caps.RegisterHandlers(); 115 caps.RegisterHandlers();
116 116
117 m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); 117 m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps);
@@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
121 caps.TaskScriptUpdatedCall = m_scene.CapsUpdateTaskInventoryScriptAsset; 121 caps.TaskScriptUpdatedCall = m_scene.CapsUpdateTaskInventoryScriptAsset;
122 caps.CAPSFetchInventoryDescendents = m_scene.HandleFetchInventoryDescendentsCAPS; 122 caps.CAPSFetchInventoryDescendents = m_scene.HandleFetchInventoryDescendentsCAPS;
123 caps.GetClient = m_scene.SceneContents.GetControllingClient; 123 caps.GetClient = m_scene.SceneContents.GetControllingClient;
124 124
125 m_capsHandlers[agentId] = caps; 125 m_capsHandlers[agentId] = caps;
126 } 126 }
127 127
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index d4f9f18..54b3260 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -130,11 +130,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
130 { 130 {
131 TestHelper.InMethod(); 131 TestHelper.InMethod();
132 //log4net.Config.XmlConfigurator.Configure(); 132 //log4net.Config.XmlConfigurator.Configure();
133 133
134 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 134 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
135 135
136 TestScene scene = SceneSetupHelpers.SetupScene(); 136 TestScene scene = SceneSetupHelpers.SetupScene();
137 137
138 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. 138 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
139 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; 139 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
140 sogd.Enabled = false; 140 sogd.Enabled = false;
@@ -147,7 +147,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
147 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 147 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
148 148
149 Assert.That(retrievedPart, Is.Not.Null); 149 Assert.That(retrievedPart, Is.Not.Null);
150 150
151 sogd.InventoryDeQueueAndDelete(); 151 sogd.InventoryDeQueueAndDelete();
152 152
153 SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); 153 SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
index 501207e..e39a362 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
@@ -104,8 +104,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
104 agent.AgentID = agent1; 104 agent.AgentID = agent1;
105 agent.firstname = firstName; 105 agent.firstname = firstName;
106 agent.lastname = "testlastname"; 106 agent.lastname = "testlastname";
107 agent.SessionID = UUID.Zero; 107 agent.SessionID = UUID.Random();
108 agent.SecureSessionID = UUID.Zero; 108 agent.SecureSessionID = UUID.Random();
109 agent.circuitcode = 123; 109 agent.circuitcode = 123;
110 agent.BaseFolder = UUID.Zero; 110 agent.BaseFolder = UUID.Zero;
111 agent.InventoryFolder = UUID.Zero; 111 agent.InventoryFolder = UUID.Zero;
@@ -114,6 +114,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
114 agent.ChildrenCapSeeds = new Dictionary<ulong, string>(); 114 agent.ChildrenCapSeeds = new Dictionary<ulong, string>();
115 agent.child = true; 115 agent.child = true;
116 116
117 if (scene.PresenceService == null)
118 Console.WriteLine("Presence Service is null");
119
120 scene.PresenceService.LoginAgent(agent.AgentID.ToString(), agent.SessionID, agent.SecureSessionID);
121
117 string reason; 122 string reason;
118 scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason); 123 scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason);
119 testclient = new TestClient(agent, scene); 124 testclient = new TestClient(agent, scene);
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index 4a356e2..eaa0d33 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -46,6 +46,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication;
46using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; 46using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory;
47using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; 47using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
48using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; 48using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
49using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
49using OpenSim.Services.Interfaces; 50using OpenSim.Services.Interfaces;
50using OpenSim.Tests.Common.Mock; 51using OpenSim.Tests.Common.Mock;
51 52
@@ -63,6 +64,7 @@ namespace OpenSim.Tests.Common.Setup
63 private static ISharedRegionModule m_inventoryService = null; 64 private static ISharedRegionModule m_inventoryService = null;
64 private static ISharedRegionModule m_gridService = null; 65 private static ISharedRegionModule m_gridService = null;
65 private static ISharedRegionModule m_userAccountService = null; 66 private static ISharedRegionModule m_userAccountService = null;
67 private static ISharedRegionModule m_presenceService = null;
66 68
67 /// <summary> 69 /// <summary>
68 /// Set up a test scene 70 /// Set up a test scene
@@ -180,7 +182,7 @@ namespace OpenSim.Tests.Common.Setup
180 else 182 else
181 StartAssetService(testScene, false); 183 StartAssetService(testScene, false);
182 184
183 // For now, always started a 'real' authenication service 185 // For now, always started a 'real' authentication service
184 StartAuthenticationService(testScene, true); 186 StartAuthenticationService(testScene, true);
185 187
186 if (realServices.Contains("inventory")) 188 if (realServices.Contains("inventory"))
@@ -188,10 +190,9 @@ namespace OpenSim.Tests.Common.Setup
188 else 190 else
189 StartInventoryService(testScene, false); 191 StartInventoryService(testScene, false);
190 192
191 if (realServices.Contains("grid")) 193 StartGridService(testScene, true);
192 StartGridService(testScene, true);
193
194 StartUserAccountService(testScene); 194 StartUserAccountService(testScene);
195 StartPresenceService(testScene);
195 } 196 }
196 // If not, make sure the shared module gets references to this new scene 197 // If not, make sure the shared module gets references to this new scene
197 else 198 else
@@ -202,11 +203,15 @@ namespace OpenSim.Tests.Common.Setup
202 m_inventoryService.RegionLoaded(testScene); 203 m_inventoryService.RegionLoaded(testScene);
203 m_userAccountService.AddRegion(testScene); 204 m_userAccountService.AddRegion(testScene);
204 m_userAccountService.RegionLoaded(testScene); 205 m_userAccountService.RegionLoaded(testScene);
206 m_presenceService.AddRegion(testScene);
207 m_presenceService.RegionLoaded(testScene);
208
205 } 209 }
206 210
207 m_inventoryService.PostInitialise(); 211 m_inventoryService.PostInitialise();
208 m_assetService.PostInitialise(); 212 m_assetService.PostInitialise();
209 m_userAccountService.PostInitialise(); 213 m_userAccountService.PostInitialise();
214 m_presenceService.PostInitialise();
210 testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); 215 testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random();
211 testScene.SetModuleInterfaces(); 216 testScene.SetModuleInterfaces();
212 217
@@ -225,7 +230,11 @@ namespace OpenSim.Tests.Common.Setup
225 m_inventoryService = null; 230 m_inventoryService = null;
226 m_gridService = null; 231 m_gridService = null;
227 m_userAccountService = null; 232 m_userAccountService = null;
228 233 m_presenceService = null;
234
235 testScene.RegionInfo.EstateSettings = new EstateSettings();
236 testScene.LoginsDisabled = false;
237
229 return testScene; 238 return testScene;
230 } 239 }
231 240
@@ -337,6 +346,32 @@ namespace OpenSim.Tests.Common.Setup
337 } 346 }
338 347
339 /// <summary> 348 /// <summary>
349 /// Start a presence service
350 /// </summary>
351 /// <param name="testScene"></param>
352 private static void StartPresenceService(Scene testScene)
353 {
354 IConfigSource config = new IniConfigSource();
355 config.AddConfig("Modules");
356 config.AddConfig("PresenceService");
357 config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector");
358 config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
359 config.Configs["PresenceService"].Set(
360 "LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService");
361
362 if (m_presenceService == null)
363 {
364 ISharedRegionModule presenceService = new LocalPresenceServicesConnector();
365 presenceService.Initialise(config);
366 m_presenceService = presenceService;
367 }
368
369 m_presenceService.AddRegion(testScene);
370 m_presenceService.RegionLoaded(testScene);
371 testScene.AddRegionModule(m_presenceService.Name, m_presenceService);
372 }
373
374 /// <summary>
340 /// Setup modules for a scene using their default settings. 375 /// Setup modules for a scene using their default settings.
341 /// </summary> 376 /// </summary>
342 /// <param name="scene"></param> 377 /// <param name="scene"></param>
@@ -446,9 +481,14 @@ namespace OpenSim.Tests.Common.Setup
446 { 481 {
447 string reason; 482 string reason;
448 483
449 // We emulate the proper login sequence here by doing things in three stages 484 // We emulate the proper login sequence here by doing things in four stages
485
486 // Stage 0: log the presence
487 scene.PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID);
488
450 // Stage 1: simulate login by telling the scene to expect a new user connection 489 // Stage 1: simulate login by telling the scene to expect a new user connection
451 scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason); 490 if (!scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason))
491 Console.WriteLine("NewUserConnection failed: " + reason);
452 492
453 // Stage 2: add the new client as a child agent to the scene 493 // Stage 2: add the new client as a child agent to the scene
454 TestClient client = new TestClient(agentData, scene); 494 TestClient client = new TestClient(agentData, scene);
@@ -459,7 +499,7 @@ namespace OpenSim.Tests.Common.Setup
459 //scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false); OBSOLETE 499 //scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false); OBSOLETE
460 500
461 ScenePresence scp = scene.GetScenePresence(agentData.AgentID); 501 ScenePresence scp = scene.GetScenePresence(agentData.AgentID);
462 scp.MakeRootAgent(new Vector3(90,90,90), true); 502 scp.MakeRootAgent(new Vector3(90, 90, 90), true);
463 503
464 return client; 504 return client;
465 } 505 }