RegisterNewRegion() public method

Register a new scene object to keep track of for revisioning. Starts the controller monitoring actions of clients within the given scene.
public RegisterNewRegion ( Scene scene ) : void
scene OpenSim.Region.Framework.Scenes.Scene /// A ///
return void
Example #1
0
        public void Initialise(Scene scene, IConfigSource source)
        {
            string databaseDir = "./";
            string database    = "FileSystemDatabase";
            int    channel     = 345;

            try
            {
                if (source.Configs["CMS"] == null)
                {
                    return;
                }

                m_enabled   = source.Configs["CMS"].GetBoolean("enabled", false);
                databaseDir = source.Configs["CMS"].GetString("directory", databaseDir);
                database    = source.Configs["CMS"].GetString("database", database);
                channel     = source.Configs["CMS"].GetInt("channel", channel);

                if (database != "FileSystemDatabase" && database != "GitDatabase")
                {
                    m_log.ErrorFormat("[Content Management]: The Database attribute must be defined as either FileSystemDatabase or GitDatabase");
                    m_enabled = false;
                }
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[Content Management]: Exception thrown while reading parameters from configuration file. Message: " + e);
                m_enabled = false;
            }

            if (!m_enabled)
            {
                m_log.Info("[Content Management]: Content Management System is not Enabled.");
                return;
            }

            lock (this)
            {
                if (!initialised) //only init once
                {
                    m_view    = new CMView();
                    m_model   = new CMModel();
                    m_control = new CMController(m_model, m_view, scene, channel);
                    m_model.Initialise(database);
                    m_view.Initialise(m_model);

                    initialised = true;
                    m_model.InitialiseDatabase(scene, databaseDir);
                }
                else
                {
                    m_model.InitialiseDatabase(scene, databaseDir);
                    m_control.RegisterNewRegion(scene);
                }
            }
        }