コード例 #1
0
        public RegionInfo[] LoadRegions()
        {
            //Grab old region files
            if (m_default)
            {
                FindOldRegionFiles();
            }

            IRegionInfoConnector conn = DataManager.RequestPlugin <IRegionInfoConnector>();

            if (conn == null)
            {
                return(null);
            }
            RegionInfo[] infos = conn.GetRegionInfos(true);
            if (infos.Length == 0 && m_default)
            {
                //Load up the GUI to make a new region
                RegionManager manager = new RegionManager(true, false, m_openSim);
                System.Windows.Forms.Application.Run(manager);
                return(LoadRegions());
            }
            else if (infos.Length == 0)
            {
                return(null);
            }
            else
            {
                return(infos);
            }
        }
コード例 #2
0
        /// <summary>
        /// Save the database configs
        /// </summary>
        /// <param name="regionInfo"></param>
        private void SaveChangesDatabase(RegionInfo regionInfo)
        {
            IRegionInfoConnector connector = Aurora.DataManager.DataManager.RequestPlugin <IRegionInfoConnector>();

            if (connector != null)
            {
                connector.UpdateRegionInfo(regionInfo);
            }
        }
コード例 #3
0
        public void DeleteRegion(RegionInfo regionInfo)
        {
            IRegionInfoConnector connector = Aurora.DataManager.DataManager.RequestPlugin <IRegionInfoConnector>();

            if (connector != null)
            {
                connector.Delete(regionInfo);
            }
        }
コード例 #4
0
ファイル: RegionManager.cs プロジェクト: mugginsm/Aurora-Sim
 public RegionManager(bool killOnCreate, bool openCreatePageFirst, ISimulationBase baseOpenSim)
 {
     m_OpenSimBase = baseOpenSim;
     m_connector = Aurora.DataManager.DataManager.RequestPlugin<IRegionInfoConnector>();
     KillAfterRegionCreation = killOnCreate;
     InitializeComponent();
     if (openCreatePageFirst)
         tabControl1.SelectedTab = tabPage2;
     RefreshCurrentRegions();
 }
コード例 #5
0
 public RegionManager(bool killOnCreate, bool openCreatePageFirst, ISimulationBase baseOpenSim)
 {
     m_OpenSimBase           = baseOpenSim;
     m_connector             = Aurora.DataManager.DataManager.RequestPlugin <IRegionInfoConnector>();
     KillAfterRegionCreation = killOnCreate;
     InitializeComponent();
     if (openCreatePageFirst)
     {
         tabControl1.SelectedTab = tabPage2;
     }
     RefreshCurrentRegions();
 }
コード例 #6
0
 public RegionManager(bool killOnCreate, bool openCreatePageFirst, ISimulationBase baseOpenSim)
 {
     m_OpenSimBase = baseOpenSim;
     m_sceneManager = m_OpenSimBase.ApplicationRegistry.RequestModuleInterface<SceneManager> ();
     m_connector = DataManager.DataManager.RequestPlugin<IRegionInfoConnector>();
     KillAfterRegionCreation = killOnCreate;
     InitializeComponent();
     if (openCreatePageFirst)
         tabControl1.SelectedTab = tabPage2;
     CStartupType.SelectedIndex = 1;
     RefreshCurrentRegions();
     GetDefaultRegions ();
     m_timer.Interval = 100;
     m_timer.Tick += m_timer_Tick;
     m_timer.Start ();
 }
コード例 #7
0
        public RegionInfo[] LoadRegions()
        {
            //Grab old region files
            if (m_default)
            {
                FindOldRegionFiles();
            }

            IRegionInfoConnector conn = DataManager.RequestPlugin <IRegionInfoConnector>();

            if (conn == null)
            {
                return(null);
            }
            RegionInfo[] infos = conn.GetRegionInfos(true);
            return(infos.Length == 0 ? null : infos);
        }
コード例 #8
0
 public RegionManager(bool killOnCreate, bool openCreatePageFirst, ISimulationBase baseOpenSim)
 {
     m_OpenSimBase           = baseOpenSim;
     m_sceneManager          = m_OpenSimBase.ApplicationRegistry.RequestModuleInterface <SceneManager> ();
     m_connector             = DataManager.DataManager.RequestPlugin <IRegionInfoConnector>();
     KillAfterRegionCreation = killOnCreate;
     InitializeComponent();
     if (openCreatePageFirst)
     {
         tabControl1.SelectedTab = tabPage2;
     }
     CStartupType.SelectedIndex = 1;
     RefreshCurrentRegions();
     GetDefaultRegions();
     m_timer.Interval = 100;
     m_timer.Tick    += m_timer_Tick;
     m_timer.Start();
 }
コード例 #9
0
        public void SaveWindLightSettings(float MinEffectiveHeight, RegionLightShareData wl)
        {
            UUID oldUUID = UUID.Random();

            if (m_WindlightSettings.ContainsKey(wl.minEffectiveAltitude))
            {
                oldUUID = m_WindlightSettings[wl.minEffectiveAltitude].UUID;
            }

            m_WindlightSettings[wl.minEffectiveAltitude] = wl;
            wl.UUID = oldUUID;
            IRegionInfoConnector RegionInfoConnector = Aurora.DataManager.DataManager.RequestPlugin <IRegionInfoConnector>();

            if (RegionInfoConnector != null)
            {
                RegionInfoConnector.StoreRegionWindlightSettings(wl.regionID, oldUUID, wl);
            }
            m_scene.ForEachScenePresence(SendProfileToClient);
        }
コード例 #10
0
        public void AddRegion(Scene scene)
        {
            if (!m_enableWindlight)
            {
                return;
            }

            m_scene = scene;
            m_scene.RegisterModuleInterface <IWindLightSettingsModule>(this);
            IRegionInfoConnector RegionInfoConnector = Aurora.DataManager.DataManager.RequestPlugin <IRegionInfoConnector>();

            if (RegionInfoConnector != null)
            {
                m_WindlightSettings = RegionInfoConnector.LoadRegionWindlightSettings(m_scene.RegionInfo.RegionID);
            }

            scene.EventManager.OnClientClosed              += EventManager_OnClientClosed;
            scene.EventManager.OnRegisterCaps              += OnRegisterCaps;
            scene.EventManager.OnMakeRootAgent             += SendProfileToClient;
            scene.EventManager.OnSignificantClientMovement += OnSignificantClientMovement;
            scene.EventManager.OnAvatarEnteringNewParcel   += AvatarEnteringNewParcel;
        }
コード例 #11
0
        public void UpdateRegionInfo(string oldName, RegionInfo regionInfo)
        {
            IRegionInfoConnector connector = Aurora.DataManager.DataManager.RequestPlugin <IRegionInfoConnector>();

            if (connector != null)
            {
                //Make sure we have this region in the database
                if (connector.GetRegionInfo(oldName) == null)
                {
                    return;
                }
                RegionInfo copy = new RegionInfo();
                //Make an exact copy
                copy.UnpackRegionInfoData(regionInfo.PackRegionInfoData(true));

                //Fix the name of the region so we can delete the old one
                copy.RegionName = oldName;
                DeleteRegion(copy);
                //Now add the new one
                connector.UpdateRegionInfo(regionInfo);
            }
        }
コード例 #12
0
        private void FindOldRegionFiles()
        {
            try
            {
                //Load the file loader and set it up and make sure that we pull any regions from it
                RegionLoaderFileSystem system = new RegionLoaderFileSystem();
                system.Initialise(m_configSource, m_openSim);
                RegionInfo[] regionsToConvert = system.LoadRegions();
                if (regionsToConvert == null)
                {
                    return;
                }

                //Now load all the regions into the database
                IRegionInfoConnector conn = DataManager.RequestPlugin <IRegionInfoConnector>();
                foreach (RegionInfo info in regionsToConvert)
                {
                    conn.UpdateRegionInfo(info);
                }

                //Make sure all the regions got saved
                bool foundAll = true;
                foreach (RegionInfo info in regionsToConvert)
                {
                    if (conn.GetRegionInfo(info.RegionID) == null)
                    {
                        foundAll = false;
                    }
                }
                //Something went really wrong here... so lets not destroy anything
                if (foundAll && regionsToConvert.Length != 0)
                {
                    MessageBox.Show("All region .ini and .xml files have been successfully converted to the new region loader style.");
                }
            }
            catch
            {
            }
        }
コード例 #13
0
        public void AddRegion(IScene scene)
        {
            if (!m_enableWindlight)
            {
                return;
            }

            m_scene = scene;
            m_scene.RegisterModuleInterface <IWindLightSettingsModule>(this);
            m_scene.StackModuleInterface <IAuroraBackupModule>(this);
            IRegionInfoConnector RegionInfoConnector = DataManager.DataManager.RequestPlugin <IRegionInfoConnector>();

            if (RegionInfoConnector != null)
            {
                m_WindlightSettings = RegionInfoConnector.LoadRegionWindlightSettings(m_scene.RegionInfo.RegionID);
            }

            scene.EventManager.OnRemovePresence            += OnRemovePresence;
            scene.EventManager.OnRegisterCaps              += OnRegisterCaps;
            scene.EventManager.OnMakeRootAgent             += OnMakeRootAgent;
            scene.EventManager.OnSignificantClientMovement += OnSignificantClientMovement;
            scene.EventManager.OnAvatarEnteringNewParcel   += AvatarEnteringNewParcel;
        }
コード例 #14
0
        public RegionInfo[] LoadRegions()
        {
            //Grab old region files
            if (m_default)
            {
                FindOldRegionFiles();
            }

            IRegionInfoConnector conn = DataManager.RequestPlugin <IRegionInfoConnector>();

            if (conn == null)
            {
                return(null);
            }
            RegionInfo[] infos = conn.GetRegionInfos(true);
            if (infos.Length == 0 && m_default)
            {
                //Load up the GUI to make a new region
                try
                {
                    if (m_noGUI)
                    {
                        RegionLoaderFileSystem system = new RegionLoaderFileSystem();
                        system.Initialise(m_configSource, m_openSim);
                        system.AddRegion(new string[0]);
                    }
                    else
                    {
                        bool   done = false, errored = false;
                        Thread t = new Thread(delegate()
                        {
                            try
                            {
                                RegionManager manager = new RegionManager(true, true, m_openSim);
                                Application.Run(manager);
                                done = true;
                            }
                            catch
                            {
                                errored = true;
                            }
                        });
                        t.SetApartmentState(ApartmentState.STA);
                        t.Start();
                        while (!done)
                        {
                            if (errored)
                            {
                                throw new Exception();
                            }
                        }
                        Thread.Sleep(100);
                    }
                }
                catch
                {
                    //Probably no winforms
                    RegionLoaderFileSystem system = new RegionLoaderFileSystem();
                    system.Initialise(m_configSource, m_openSim);
                    system.AddRegion(new string[0]);
                }
                return(LoadRegions());
            }
            return(infos.Length == 0 ? null : infos);
        }
コード例 #15
0
        private void FindOldRegionFiles()
        {
            try
            {
                //Load the file loader and set it up and make sure that we pull any regions from it
                RegionLoaderFileSystem system = new RegionLoaderFileSystem();
                system.Initialise(m_configSource, m_openSim);
                RegionInfo[] regionsToConvert = system.InternalLoadRegions(true);
                if (regionsToConvert == null)
                {
                    return;
                }

                bool changed = false;
                //Now load all the regions into the database
                IRegionInfoConnector conn = DataManager.RequestPlugin <IRegionInfoConnector>();
                foreach (RegionInfo info in regionsToConvert)
                {
                    RegionInfo alreadyExists;
                    if ((alreadyExists = conn.GetRegionInfo(info.RegionID)) == null)
                    {
                        changed = true;
                        if (!info.UDPPorts.Contains(info.InternalEndPoint.Port))
                        {
                            info.UDPPorts.Add(info.InternalEndPoint.Port);
                        }
                        info.Disabled = false;
                        conn.UpdateRegionInfo(info);
                    }
                    else
                    {
                        //Update some atributes...
                        alreadyExists.RegionName  = info.RegionName;
                        alreadyExists.RegionLocX  = info.RegionLocX;
                        alreadyExists.RegionLocY  = info.RegionLocY;
                        alreadyExists.RegionSizeX = info.RegionSizeX;
                        alreadyExists.RegionSizeY = info.RegionSizeY;
                        alreadyExists.Disabled    = false;
                        if (!alreadyExists.UDPPorts.Contains(info.InternalEndPoint.Port))
                        {
                            alreadyExists.UDPPorts.Add(info.InternalEndPoint.Port);
                        }
                        conn.UpdateRegionInfo(alreadyExists);
                    }
                }

                //Make sure all the regions got saved
                bool foundAll = true;
                foreach (RegionInfo info in regionsToConvert)
                {
                    if (conn.GetRegionInfo(info.RegionID) == null)
                    {
                        foundAll = false;
                    }
                }
                //We found some new ones, they are all loaded
                if (foundAll && regionsToConvert.Length != 0 && changed)
                {
                    try
                    {
                        MessageBox.Show("All region .ini and .xml files have been successfully converted to the new region loader style.");
                        MessageBox.Show("To change your region settings, type 'open region manager' on the console, and a GUI will pop up for you to use.");
                        DialogResult t = Utilities.InputBox("Remove .ini files", "Do you want to remove your old .ini files?");
                        if (t == DialogResult.OK)
                        {
                            system.DeleteAllRegionFiles();
                        }
                    }
                    catch
                    {
                        //For people who only have consoles, no winforms
                        MainConsole.Instance.Output("All region .ini and .xml files have been successfully converted to the new region loader style.");
                        MainConsole.Instance.Output("To change your region settings, well, you don't have Mono-Winforms installed. Get that, stick with just modifying the .ini files, or get something to modify the region database that isn't a GUI.");
                    }
                }
            }
            catch
            {
            }
        }
コード例 #16
0
 public void Initialize(ISimulationBase simBase)
 {
     _regionInfoConnector = Aurora.DataManager.DataManager.RequestPlugin <IRegionInfoConnector>();
     _sceneManager        = m_registry.RequestModuleInterface <ISceneManager>();
 }
コード例 #17
0
ファイル: RegionManagement.cs プロジェクト: andsim/Aurora-Sim
 public void Initialize(ISimulationBase simBase)
 {
     _regionInfoConnector = Aurora.DataManager.DataManager.RequestPlugin<IRegionInfoConnector>();
     _sceneManager = m_registry.RequestModuleInterface<ISceneManager>();
 }