Example #1
0
        public void PostInitialize()
        {
            //m_log.Info("[LOADREGIONS]: Load Regions addin being initialized");

            IRegionLoader regionLoader;

            if (m_openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
            {
                m_log.Info("[LOADREGIONS]: Loading region configurations from filesystem");
                regionLoader = new RegionLoaderFileSystem();
            }
            else
            {
                m_log.Info("[LOADREGIONSPLUGIN]: Loading region configurations from web");
                regionLoader = new RegionLoaderWebServer();
            }

            regionLoader.SetIniConfigSource(m_openSim.ConfigSource.Source);
            RegionInfo[] regionsToLoad = regionLoader.LoadRegions();

            m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule());
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new InstantMessageModule());
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule());
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule());
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule());
            if (!CheckRegionsForSanity(regionsToLoad))
            {
                m_log.Error("[LOADREGIONS]: Halting startup due to conflicts in region configurations");
                Environment.Exit(1);
            }

            List <IScene> loadedRegions = new List <IScene>();

            for (int i = 0; i < regionsToLoad.Length; i++)
            {
                IScene scene;
                m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
                            Thread.CurrentThread.ManagedThreadId.ToString() +
                            ")");
                m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
                if (scene != null)
                {
                    loadedRegions.Add(scene);
                    m_newRegionCreatedHandler = OnNewRegionCreated;
                    if (m_newRegionCreatedHandler != null)
                    {
                        m_newRegionCreatedHandler(scene);
                    }
                }
            }

            m_openSim.ModuleLoader.PostInitialize();
            m_openSim.ModuleLoader.ClearCache();

            foreach (var region in loadedRegions)
            {
                region.InformNeighborsImUp();
            }
        }
Example #2
0
        public void PostInitialise()
        {
            IRegionLoader regionLoader;

            if (m_openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
            {
                m_log.Info("[Load Regions]: Loading region configurations from filesystem");
                regionLoader = new RegionLoaderFileSystem();
            }
            else
            {
                m_log.Info("[Load Regions]: Loading region configurations from web");
                regionLoader = new RegionLoaderWebServer();
            }

            m_log.Info("[Load Regions]: Loading region configurations...");

            regionLoader.SetIniConfigSource(m_openSim.ConfigSource.Source);
            RegionInfo[] regionsToLoad = regionLoader.LoadRegions();

            m_log.Info("[Load Regions]: Loading specific shared modules...");
            m_log.Info("[Load Regions]: DynamicTextureModule...");
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule());
            m_log.Info("[Load Regions]: LoadImageURLModule...");
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule());
            m_log.Info("[Load Regions]: XMLRPCModule...");
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule());
            m_log.Info("[Load Regions]: AssetTransactionModule...");
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule());
            m_log.Info("[Load Regions]: Done.");

            if (!CheckRegionsForSanity(regionsToLoad))
            {
                m_log.Error("[Load Regions]: Halting startup due to conflicts in region configurations");
                Environment.Exit(1);
            }

            for (int i = 0; i < regionsToLoad.Length; i++)
            {
                IScene scene;
                m_log.Debug("[Load Regions]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + Thread.CurrentThread.ManagedThreadId.ToString() + ")");
                m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
                m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
                regionsToLoad[i].EstateSettings.Save();

                if (scene != null)
                {
                    m_newRegionCreatedHandler = OnNewRegionCreated;

                    if (m_newRegionCreatedHandler != null)
                    {
                        m_newRegionCreatedHandler(scene);
                    }
                }
            }

            m_openSim.ModuleLoader.PostInitialise();
            m_openSim.ModuleLoader.ClearCache();
        }
Example #3
0
        public void PostInitialise()
        {
            //m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");

            IRegionLoader regionLoader;
            if (m_openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
            {
                m_log.Info("[LOAD REGIONS PLUGIN]: Loading region configurations from filesystem");
                regionLoader = new RegionLoaderFileSystem();
            }
            else
            {
                m_log.Info("[LOAD REGIONS PLUGIN]: Loading region configurations from web");
                regionLoader = new RegionLoaderWebServer();
            }

            regionLoader.SetIniConfigSource(m_openSim.ConfigSource.Source);
            RegionInfo[] regionsToLoad = regionLoader.LoadRegions();

            m_log.Info("[LOAD REGIONS PLUGIN]: Loading specific shared modules...");
            m_log.Info("[LOAD REGIONS PLUGIN]: DynamicTextureModule...");
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule());
            m_log.Info("[LOAD REGIONS PLUGIN]: LoadImageURLModule...");
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule());
            m_log.Info("[LOAD REGIONS PLUGIN]: XMLRPCModule...");
            m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule());
//            m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule...");
//            m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule());
            m_log.Info("[LOAD REGIONS PLUGIN]: Done.");

            if (!CheckRegionsForSanity(regionsToLoad))
            {
                m_log.Error("[LOAD REGIONS PLUGIN]: Halting startup due to conflicts in region configurations");
                Environment.Exit(1);
            }

            for (int i = 0; i < regionsToLoad.Length; i++)
            {
                IScene scene;
                m_log.Debug("[LOAD REGIONS PLUGIN]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
                            Thread.CurrentThread.ManagedThreadId.ToString() +
                            ")");
                
                m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
                m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
                regionsToLoad[i].EstateSettings.Save();
                
                if (scene != null)
                {
                    m_newRegionCreatedHandler = OnNewRegionCreated;
                    if (m_newRegionCreatedHandler != null)
                    {
                        m_newRegionCreatedHandler(scene);
                    }
                }
            }

            m_openSim.ModuleLoader.PostInitialise();
            m_openSim.ModuleLoader.ClearCache();
        }
Example #4
0
        public void PostInitialise()
        {
            //m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");

            IRegionLoader regionLoader;

            if (m_openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
            {
                m_log.Info("[LOAD REGIONS PLUGIN]: Loading region configurations from filesystem");
                regionLoader = new RegionLoaderFileSystem();
            }
            else
            {
                m_log.Info("[LOAD REGIONS PLUGIN]: Loading region configurations from web");
                regionLoader = new RegionLoaderWebServer();
            }

            regionLoader.SetIniConfigSource(m_openSim.ConfigSource.Source);
            RegionInfo[] regionsToLoad = regionLoader.LoadRegions();

            m_log.Info("[LOAD REGIONS PLUGIN]: Loading specific shared modules...");
            //m_log.Info("[LOAD REGIONS PLUGIN]: DynamicTextureModule...");
            //m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule());
            //m_log.Info("[LOAD REGIONS PLUGIN]: LoadImageURLModule...");
            //m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule());
            //m_log.Info("[LOAD REGIONS PLUGIN]: XMLRPCModule...");
            //m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule());
//            m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule...");
//            m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule());
            m_log.Info("[LOAD REGIONS PLUGIN]: Done.");

            if (!CheckRegionsForSanity(regionsToLoad))
            {
                m_log.Error("[LOAD REGIONS PLUGIN]: Halting startup due to conflicts in region configurations");
                Environment.Exit(1);
            }

            List <IScene> createdScenes = new List <IScene>();

            for (int i = 0; i < regionsToLoad.Length; i++)
            {
                IScene scene;
                m_log.Debug("[LOAD REGIONS PLUGIN]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
                            Thread.CurrentThread.ManagedThreadId.ToString() +
                            ")");

                bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);

                m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
                createdScenes.Add(scene);

                if (changed)
                {
                    m_openSim.EstateDataService.StoreEstateSettings(regionsToLoad[i].EstateSettings);
                }
            }

            foreach (IScene scene in createdScenes)
            {
                scene.Start();

                m_newRegionCreatedHandler = OnNewRegionCreated;
                if (m_newRegionCreatedHandler != null)
                {
                    m_newRegionCreatedHandler(scene);
                }
            }

            foreach (IScene scene in createdScenes)
            {
                scene.TriggerOnAllInitialScenesStarted();
            }
        }
Example #5
0
        public void PostInitialise()
        {
            List<IRegionLoader> regionLoaders = AuroraModuleLoader.PickupModules<IRegionLoader>();
            foreach (IRegionLoader loader in regionLoaders)
            {
                loader.Initialise(m_openSim.ConfigSource, this, m_openSim);
                m_log.Info("[LOADREGIONSPLUGIN]: Loading region configurations from " + loader.Name + "...");

                RegionInfo[] regionsToLoad = loader.LoadRegions();
                if (regionsToLoad == null)
                    continue;

                if (!CheckRegionsForSanity(regionsToLoad))
                {
                    m_log.Error("[LOADREGIONS]: Halting startup due to conflicts in region configurations");
                    throw new Exception();
                }

                SceneManager manager = m_openSim.ApplicationRegistry.Get<SceneManager>();
                manager.AllRegions += regionsToLoad.Length;
                Util.NumberofScenes += regionsToLoad.Length;

                for (int i = 0; i < regionsToLoad.Length; i++)
                {
                    IScene scene = null;
                    m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName);
                    manager.CreateRegion(regionsToLoad[i], true, out scene);
                    if (scene != null)
                    {
                        m_newRegionCreatedHandler = OnNewRegionCreated;
                        if (m_newRegionCreatedHandler != null)
                        {
                            m_newRegionCreatedHandler(scene);
                        }
                    }
                }
            }
        }