remove unused code to share services between scenes in SceneSetupHelpers - this is done differently elsewhere

0.7.1-dev
Justin Clark-Casey (justincc) 2011-02-19 00:07:16 +00:00
parent 60fe3d48ee
commit 9d668b09ca
1 changed files with 16 additions and 52 deletions

View File

@ -132,24 +132,11 @@ namespace OpenSim.Tests.Common.Setup
public static TestScene SetupScene(
string name, UUID id, uint x, uint y, String realServices)
{
bool newScene = false;
Console.WriteLine("Setting up test scene {0}", name);
// REFACTORING PROBLEM!
//// If cm is the same as our last commsManager used, this means the tester wants to link
//// regions. In this case, don't use the sameshared region modules and dont initialize them again.
//// Also, no need to start another MainServer and MainConsole instance.
//if (cm == null || cm != commsManager)
//{
// System.Console.WriteLine("Starting a brand new scene");
// newScene = true;
MainConsole.Instance = new MockConsole("TEST PROMPT");
// MainServer.Instance = new BaseHttpServer(980);
// commsManager = cm;
//}
// We must set up a console otherwise setup of some modules may fail
MainConsole.Instance = new MockConsole("TEST PROMPT");
RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");
regInfo.RegionName = name;
regInfo.RegionID = id;
@ -164,50 +151,27 @@ namespace OpenSim.Tests.Common.Setup
TestScene testScene = new TestScene(
regInfo, acm, scs, simDataService, estateDataService, null, false, false, false, configSource, null);
// INonSharedRegionModule capsModule = new CapabilitiesModule();
// capsModule.Initialise(new IniConfigSource());
// testScene.AddRegionModule(capsModule.Name, capsModule);
// capsModule.AddRegion(testScene);
IRegionModule godsModule = new GodsModule();
godsModule.Initialise(testScene, new IniConfigSource());
testScene.AddModule(godsModule.Name, godsModule);
realServices = realServices.ToLower();
// IConfigSource config = new IniConfigSource();
// If we have a brand new scene, need to initialize shared region modules
if ((m_assetService == null && m_inventoryService == null) || newScene)
{
if (realServices.Contains("asset"))
StartAssetService(testScene, true);
else
StartAssetService(testScene, false);
// For now, always started a 'real' authentication service
StartAuthenticationService(testScene, true);
if (realServices.Contains("inventory"))
StartInventoryService(testScene, true);
else
StartInventoryService(testScene, false);
StartGridService(testScene, true);
StartUserAccountService(testScene);
StartPresenceService(testScene);
}
// If not, make sure the shared module gets references to this new scene
if (realServices.Contains("asset"))
StartAssetService(testScene, true);
else
{
m_assetService.AddRegion(testScene);
m_assetService.RegionLoaded(testScene);
m_inventoryService.AddRegion(testScene);
m_inventoryService.RegionLoaded(testScene);
m_userAccountService.AddRegion(testScene);
m_userAccountService.RegionLoaded(testScene);
m_presenceService.AddRegion(testScene);
m_presenceService.RegionLoaded(testScene);
StartAssetService(testScene, false);
}
// For now, always started a 'real' authentication service
StartAuthenticationService(testScene, true);
if (realServices.Contains("inventory"))
StartInventoryService(testScene, true);
else
StartInventoryService(testScene, false);
StartGridService(testScene, true);
StartUserAccountService(testScene);
StartPresenceService(testScene);
m_inventoryService.PostInitialise();
m_assetService.PostInitialise();