Beispiel #1
0
        public void LoadRegionFromConfig(OpenSimBase openSim, ulong regionhandle)
        {
            m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");

            IRegionLoader regionLoader;

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

            regionLoader.SetIniConfigSource(openSim.ConfigSource.Source);
            RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
            for (int i = 0; i < regionsToLoad.Length; i++)
            {
                if (regionhandle == regionsToLoad[i].RegionHandle)
                {
                    IScene scene;
                    m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
                                Thread.CurrentThread.ManagedThreadId.ToString() + ")");
                    openSim.CreateRegion(regionsToLoad[i], true, out scene);
                }
            }
        }
Beispiel #2
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();
            }
        }
Beispiel #3
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();
        }
        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();
            }
        }
Beispiel #5
0
        public void LoadRegionFromConfig(OpenSimBase openSim, ulong regionhandle)
        {
            m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");

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

            regionLoader.SetIniConfigSource(openSim.ConfigSource.Source);
            RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
            for (int i = 0; i < regionsToLoad.Length; i++)
            {
                if (regionhandle == regionsToLoad[i].RegionHandle)
                {
                    IScene scene;
                    m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
                                Thread.CurrentThread.ManagedThreadId.ToString() + ")");
                    openSim.CreateRegion(regionsToLoad[i], true, out scene);
                }
            }
        }