Example #1
0
        public void StartRegions(out bool newRegion)
        {
            List <KeyValuePair <ISimulationDataStore, RegionInfo> > regions = new List <KeyValuePair <ISimulationDataStore, RegionInfo> >();
            List <string> regionFiles = m_selectedDataService.FindRegionInfos(out newRegion);

            if (newRegion)
            {
                ISimulationDataStore store = m_selectedDataService.Copy();
                regions.Add(new KeyValuePair <ISimulationDataStore, RegionInfo>(store, store.CreateNewRegion(m_SimBase)));
            }
            else
            {
                foreach (string fileName in regionFiles)
                {
                    ISimulationDataStore store = m_selectedDataService.Copy();
                    regions.Add(new KeyValuePair <ISimulationDataStore, RegionInfo>(store,
                                                                                    store.LoadRegionInfo(fileName, m_SimBase)));
                }
            }

            foreach (KeyValuePair <ISimulationDataStore, RegionInfo> kvp in regions)
            {
                StartRegion(kvp.Key, kvp.Value);
            }
        }
Example #2
0
        public void StartRegion(out bool newRegion)
        {
            RegionInfo regionInfo = m_simulationDataService.LoadRegionInfo(m_OpenSimBase, out newRegion);

            MainConsole.Instance.InfoFormat("[SceneManager]: Starting region \"{0}\" at @ {1},{2}",
                                            regionInfo.RegionName,
                                            regionInfo.RegionLocX / 256, regionInfo.RegionLocY / 256);
            ISceneLoader sceneLoader = m_OpenSimBase.ApplicationRegistry.RequestModuleInterface <ISceneLoader>();

            if (sceneLoader == null)
            {
                throw new Exception("No Scene Loader Interface!");
            }

            //Get the new scene from the interface
            m_scene = sceneLoader.CreateScene(regionInfo);

            MainConsole.Instance.ConsoleScene = m_scene;
            m_simulationDataService.SetRegion(m_scene);

            if (OnAddedScene != null)
            {
                OnAddedScene(m_scene);
            }

            StartModules(m_scene);

            if (OnFinishedAddingScene != null)
            {
                OnFinishedAddingScene(m_scene);
            }

            //Start the heartbeats
            m_scene.StartHeartbeat();
            //Tell the scene that the startup is complete
            // Note: this event is added in the scene constructor
            m_scene.FinishedStartup("Startup", new List <string>());
        }