public TestScene(
     RegionInfo regInfo, AgentCircuitManager authen,
     SceneCommunicationService sceneGridService, StorageManager storeManager,
     ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
     bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
     : base(regInfo, authen, sceneGridService, storeManager, moduleLoader,
            dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion)
 {
 }
Exemple #2
0
//        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager,
            StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version)
        {
            HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager);

            return
                new HGScene(
                    regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager,
                    m_moduleLoader, false, m_configSettings.PhysicalPrim,
                    m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
        }
        protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager)
        {
            SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);

            return new Scene(
                regionInfo, m_commsManager, sceneGridService,
                storageManager, m_moduleLoader, m_configSettings.PhysicalPrim,
                m_configSettings.See_into_region_from_neighbor, m_config.Source);
        }
Exemple #4
0
        protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
                                             AgentCircuitManager circuitManager)
        {
            bool hgrid = ConfigSource.Source.Configs["Startup"].GetBoolean("hypergrid", false);
            if (hgrid)
                return HGCommands.CreateScene(regionInfo, circuitManager, m_commsManager, 
                storageManager, m_moduleLoader, m_configSettings, m_config, m_version);

            SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);

            return new Scene(
                regionInfo, circuitManager, m_commsManager, sceneGridService,
                storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim,
                m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
        }
        /// <summary>
        /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions
        /// or a different, to get a brand new scene with new shared region modules.
        /// </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>
        /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
        /// <returns></returns>
        public static TestScene SetupScene(
            string name, UUID id, uint x, uint y, TestCommunicationsManager cm, String realServices)
        {
            bool newScene = false;

            Console.WriteLine("Setting up test scene {0}", name);
            
            // 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 LocalConsole("TEST PROMPT");
                MainServer.Instance = new BaseHttpServer(980);
                commsManager = cm;
            }

            // We must set up a console otherwise setup of some modules may fail
            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();
            SceneCommunicationService scs = new SceneCommunicationService(cm);

            StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", "");
            IConfigSource configSource = new IniConfigSource();

            TestScene testScene = new TestScene(
                regInfo, acm, cm, scs, sm, 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);
                if (realServices.Contains("inventory"))
                    StartInventoryService(testScene, true);
                else
                    StartInventoryService(testScene, false);
                if (realServices.Contains("grid"))
                    StartGridService(testScene, true);

            }
            // If not, make sure the shared module gets references to this new scene
            else
            {
                m_assetService.AddRegion(testScene);
                m_assetService.RegionLoaded(testScene);
                m_inventoryService.AddRegion(testScene);
                m_inventoryService.RegionLoaded(testScene);
            }
            m_inventoryService.PostInitialise();
            m_assetService.PostInitialise();

            testScene.CommsManager.UserService.SetInventoryService(testScene.InventoryService);

            testScene.SetModuleInterfaces();

            testScene.LandChannel = new TestLandChannel(testScene);
            testScene.LoadWorldMap();

            PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();
            physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
            testScene.PhysicsScene
                = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher",   new IniConfigSource(), "test");
            
            return testScene;
        }
Exemple #6
0
        /// <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>
        /// <param name="startServices">Start associated threads for the services used by the scene</param>
        /// <returns></returns>
        public static TestScene SetupScene(
            string name, UUID id, uint x, uint y, TestCommunicationsManager cm, bool startServices)
        {
            Console.WriteLine("Setting up test scene {0}", name);
            
            MainServer.Instance = new BaseHttpServer(980);
            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();
            SceneCommunicationService scs = new SceneCommunicationService(cm);

            StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", "");
            IConfigSource configSource = new IniConfigSource();

            TestScene testScene = new TestScene(
                regInfo, acm, cm, scs, sm, 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);

            ISharedRegionModule assetService = new LocalAssetServicesConnector();
            IniConfigSource config = new IniConfigSource();
            config.AddConfig("Modules");
            config.AddConfig("AssetService");
            config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector");
            config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
            config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
            assetService.Initialise(config); 
            assetService.AddRegion(testScene);
            assetService.RegionLoaded(testScene);
            testScene.AddRegionModule(assetService.Name, assetService);
            assetService.PostInitialise();

            ISharedRegionModule inventoryService = new LocalInventoryServicesConnector();
            config = new IniConfigSource();
            config.AddConfig("Modules");
            config.AddConfig("InventoryService");
            config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector");
            config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
            config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
            inventoryService.Initialise(config);
            inventoryService.AddRegion(testScene);
            inventoryService.RegionLoaded(testScene);
            testScene.AddRegionModule(inventoryService.Name, inventoryService);
            inventoryService.PostInitialise();
 
            testScene.SetModuleInterfaces();

            testScene.LandChannel = new TestLandChannel();
            testScene.LoadWorldMap();

            PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();
            physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
            testScene.PhysicsScene
                = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", configSource, "test");

            return testScene;
        }
 protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
                                      AgentCircuitManager circuitManager);        
        protected override void StartupSpecific()
        {
            m_storageManager = CreateStorageManager();

            m_clientStackManager = CreateClientStackManager();

            Initialize();

            m_httpServer 
                = new BaseHttpServer(
                    m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort, 
                    m_networkServersInfo.HttpSSLCN);
            
            if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
            {
                m_log.Error("[HTTP]: HTTP Server config failed.   HTTP Server and HTTPS server must be on different ports");
            }

            m_log.Info("[REGION]: Starting HTTP server");
            m_httpServer.Start();

            base.StartupSpecific();
        }
        /// <summary>
        /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions
        /// or a different, to get a brand new scene with new shared region modules.
        /// </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>
        /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
        /// <returns></returns>
        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
            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();
            SceneCommunicationService scs = new SceneCommunicationService();

            StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", "");
            IConfigSource configSource = new IniConfigSource();

            TestScene testScene = new TestScene(
                regInfo, acm, scs, sm, 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);
                
                if (realServices.Contains("inventory"))
                    StartInventoryService(testScene, true);
                else
                    StartInventoryService(testScene, false);
                
                if (realServices.Contains("grid"))
                    StartGridService(testScene, true);
                
                StartUserAccountService(testScene, realServices.Contains("useraccounts"));
            }
            // If not, make sure the shared module gets references to this new scene
            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_inventoryService.PostInitialise();
            m_assetService.PostInitialise();
            m_userAccountService.PostInitialise();
            testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random();
            testScene.SetModuleInterfaces();

            testScene.LandChannel = new TestLandChannel(testScene);
            testScene.LoadWorldMap();

            PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();
            physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
            testScene.PhysicsScene
                = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher",   new IniConfigSource(), "test");

            // It's really not a good idea to use static variables as they carry over between tests, leading to
            // problems that are extremely hard to debug.  Really, these static fields need to be eliminated -
            // tests using multiple regions that need to share modules need to find another solution.
            m_assetService = null;
            m_inventoryService = null;
            m_gridService = null;
            m_userAccountService = null;
            
            return testScene;
        }
 protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager);        
        protected override void StartupSpecific()
        {
            m_storageManager = CreateStorageManager();

            m_clientStackManager = CreateClientStackManager();

            Initialize();

            // Main HTTP server first
            m_httpServer = new BaseHttpServer(m_httpServerPort, null);
            m_httpServer.HostName = m_networkServersInfo.HostName; 
            MainServer.AddHttpServer(m_httpServer);

            m_log.InfoFormat("[REGION]: Starting HTTP server on {0}:{1}", m_httpServer.HostName, m_httpServerPort);
            m_httpServer.Start();

            // If specified configure an ssl server for use as well
            // you need a Cert Request/Signed pair installed in the MY store with the CN specified
            if (m_networkServersInfo.HttpUsesSSL)
            {
                if (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)
                {
                    m_log.Error("[HTTP]: HTTP Server config failed.   HTTP Server and HTTPS server must be on different ports");
                }
                else
                {
                    /// XXX Should also support specifying an IP Address
                    BaseHttpServer secureServer = new BaseHttpServer(m_networkServersInfo.httpSSLPort, null);
                    secureServer.HostName = m_networkServersInfo.HostName;

                    if (m_networkServersInfo.HttpSSLCN != null)
                        secureServer.SetSecureParams(m_networkServersInfo.HttpSSLCN, m_networkServersInfo.sslProtocol);
                    else
                        secureServer.SetSecureParams(m_networkServersInfo.HttpSSLCert, m_networkServersInfo.HttpSSLPassword, m_networkServersInfo.sslProtocol);

                    MainServer.AddHttpServer(secureServer);

                    m_log.Info("[REGION]: Starting HTTPS server");
                    secureServer.Start();
                }
            }

            base.StartupSpecific();
        }