Ejemplo n.º 1
0
        public GridService(IConfigSource config)
            : base(config)
        {
            m_log.DebugFormat("[GRID SERVICE]: Starting...");

            m_config = config;
            IConfig gridConfig = config.Configs["GridService"];

            if (gridConfig != null)
            {
                m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true);

                string authService = gridConfig.GetString("AuthenticationService", String.Empty);

                if (authService != String.Empty)
                {
                    Object[] args = new Object[] { config };
                    m_AuthenticationService = ServerUtils.LoadPlugin <IAuthenticationService>(authService, args);
                }
                m_AllowDuplicateNames     = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames);
                m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch);
            }

            if (m_RootInstance == null)
            {
                m_RootInstance = this;

                if (MainConsole.Instance != null)
                {
                    MainConsole.Instance.Commands.AddCommand("grid", true,
                                                             "show region",
                                                             "show region <Region name>",
                                                             "Show details on a region",
                                                             String.Empty,
                                                             HandleShowRegion);

                    MainConsole.Instance.Commands.AddCommand("grid", true,
                                                             "set region flags",
                                                             "set region flags <Region name> <flags>",
                                                             "Set database flags for region",
                                                             String.Empty,
                                                             HandleSetFlags);
                }
                m_HypergridLinker = new HypergridLinker(m_config, this, m_Database);
            }
        }
Ejemplo n.º 2
0
        public GridService(IConfigSource config)
            : base(config)
        {
            m_log.DebugFormat("[GRID SERVICE]: Starting...");

            m_config = config;
            IConfig gridConfig = config.Configs["GridService"];
            if (gridConfig != null)
            {
                m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true);
                
                string authService = gridConfig.GetString("AuthenticationService", String.Empty);

                if (authService != String.Empty)
                {
                    Object[] args = new Object[] { config };
                    m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args);
                }
                m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames);
                m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch);
            }
            
            if (m_RootInstance == null)
            {
                m_RootInstance = this;

                if (MainConsole.Instance != null)
                {
                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                            "deregister region id",
                            "deregister region id <Region UUID>",
                            "Deregister a region manually.",
                            String.Empty,
                            HandleDeregisterRegion);

                    // A messy way of stopping this command being added if we are in standalone (since the simulator
                    // has an identically named command
                    //
                    // XXX: We're relying on the OpenSimulator version being registered first, which is not well defined.
                    if (MainConsole.Instance.Commands.Resolve(new string[] { "show", "regions" }).Length == 0)
                        MainConsole.Instance.Commands.AddCommand("Regions", true,
                                "show regions",
                                "show regions",
                                "Show details on all regions",
                                String.Empty,
                                HandleShowRegions);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                            "show region name",
                            "show region name <Region name>",
                            "Show details on a region",
                            String.Empty,
                            HandleShowRegion);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                            "show region at",
                            "show region at <x-coord> <y-coord>",
                            "Show details on a region at the given co-ordinate.",
                            "For example, show region at 1000 1000",
                            HandleShowRegionAt);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                            "set region flags",
                            "set region flags <Region name> <flags>",
                            "Set database flags for region",
                            String.Empty,
                            HandleSetFlags);
                }
                m_HypergridLinker = new HypergridLinker(m_config, this, m_Database);
            }
        }
Ejemplo n.º 3
0
        public GridService(IConfigSource config)
            : base(config)
        {
            m_log.DebugFormat("[GRID SERVICE]: Starting...");

            m_config = config;
            IConfig gridConfig = config.Configs["GridService"];

            bool suppressConsoleCommands = false;

            if (gridConfig != null)
            {
                m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true);
                
                string authService = gridConfig.GetString("AuthenticationService", String.Empty);

                if (authService != String.Empty)
                {
                    Object[] args = new Object[] { config };
                    m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args);
                }
                m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames);
                m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch);

                m_SuppressVarregionOverlapCheckOnRegistration = gridConfig.GetBoolean("SuppressVarregionOverlapCheckOnRegistration", m_SuppressVarregionOverlapCheckOnRegistration);

                // This service is also used locally by a simulator running in grid mode.  This switches prevents
                // inappropriate console commands from being registered
                suppressConsoleCommands = gridConfig.GetBoolean("SuppressConsoleCommands", suppressConsoleCommands);
            }

            if (m_RootInstance == null)
            {
                m_RootInstance = this;

                if (!suppressConsoleCommands && MainConsole.Instance != null)
                {
                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                            "deregister region id",
                            "deregister region id <region-id>+",
                            "Deregister a region manually.",
                            String.Empty,
                            HandleDeregisterRegion);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                            "show regions",
                            "show regions",
                            "Show details on all regions",
                            String.Empty,
                            HandleShowRegions);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                            "show region name",
                            "show region name <Region name>",
                            "Show details on a region",
                            String.Empty,
                            HandleShowRegion);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                            "show region at",
                            "show region at <x-coord> <y-coord>",
                            "Show details on a region at the given co-ordinate.",
                            "For example, show region at 1000 1000",
                            HandleShowRegionAt);

                    MainConsole.Instance.Commands.AddCommand("General", true,
                            "show grid size",
                            "show grid size",
                            "Show the current grid size (excluding hyperlink references)",
                            String.Empty,
                            HandleShowGridSize);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                             "set region flags",
                             "set region flags <Region name> <flags>",
                             "Set database flags for region",
                             String.Empty,
                             HandleSetFlags);
                }

                if (!suppressConsoleCommands)
                    SetExtraServiceURLs(config);

                m_HypergridLinker = new HypergridLinker(m_config, this, m_Database);
            }
        }
Ejemplo n.º 4
0
        public GridService(IConfigSource config)
            : base(config)
        {
            m_log.DebugFormat("[GRID SERVICE]: Starting...");

            m_config = config;
            IConfig gridConfig = config.Configs["GridService"];

            if (gridConfig != null)
            {
                m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true);

                string authService = gridConfig.GetString("AuthenticationService", String.Empty);

                if (authService != String.Empty)
                {
                    Object[] args = new Object[] { config };
                    m_AuthenticationService = ServerUtils.LoadPlugin <IAuthenticationService>(authService, args);
                }
                m_AllowDuplicateNames     = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames);
                m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch);
            }

            if (m_RootInstance == null)
            {
                m_RootInstance = this;

                if (MainConsole.Instance != null)
                {
                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                                                             "deregister region id",
                                                             "deregister region id <region-id>+",
                                                             "Deregister a region manually.",
                                                             String.Empty,
                                                             HandleDeregisterRegion);

                    // A messy way of stopping this command being added if we are in standalone (since the simulator
                    // has an identically named command
                    //
                    // XXX: We're relying on the OpenSimulator version being registered first, which is not well defined.
                    if (MainConsole.Instance.Commands.Resolve(new string[] { "show", "regions" }).Length == 0)
                    {
                        MainConsole.Instance.Commands.AddCommand("Regions", true,
                                                                 "show regions",
                                                                 "show regions",
                                                                 "Show details on all regions",
                                                                 String.Empty,
                                                                 HandleShowRegions);
                    }

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                                                             "show region name",
                                                             "show region name <Region name>",
                                                             "Show details on a region",
                                                             String.Empty,
                                                             HandleShowRegion);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                                                             "show region at",
                                                             "show region at <x-coord> <y-coord>",
                                                             "Show details on a region at the given co-ordinate.",
                                                             "For example, show region at 1000 1000",
                                                             HandleShowRegionAt);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                                                             "set region flags",
                                                             "set region flags <Region name> <flags>",
                                                             "Set database flags for region",
                                                             String.Empty,
                                                             HandleSetFlags);
                }
                m_HypergridLinker = new HypergridLinker(m_config, this, m_Database);
            }
        }
Ejemplo n.º 5
0
        public GridService(IConfigSource config)
            : base(config)
        {
            m_log.DebugFormat("[GRID SERVICE]: Starting...");

            m_config = config;
            IConfig gridConfig = config.Configs["GridService"];
            if (gridConfig != null)
            {
                m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true);
                
                string authService = gridConfig.GetString("AuthenticationService", String.Empty);

                if (authService != String.Empty)
                {
                    Object[] args = new Object[] { config };
                    m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args);
                }
                m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames);
                m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch);
            }
            
            if (m_RootInstance == null)
            {
                m_RootInstance = this;

                if (MainConsole.Instance != null)
                {
                    MainConsole.Instance.Commands.AddCommand("grid", true,
                            "show region",
                            "show region <Region name>",
                            "Show details on a region",
                            String.Empty,
                            HandleShowRegion);

                    MainConsole.Instance.Commands.AddCommand("grid", true,
                            "set region flags",
                            "set region flags <Region name> <flags>",
                            "Set database flags for region",
                            String.Empty,
                            HandleSetFlags);
                }
                m_HypergridLinker = new HypergridLinker(m_config, this, m_Database);
            }
        }
Ejemplo n.º 6
0
        public GridService(IConfigSource config)
            : base(config)
        {
            m_log.DebugFormat("[GRID SERVICE]: Starting...");

            m_config = config;
            IConfig gridConfig = config.Configs["GridService"];

            bool suppressConsoleCommands = false;

            if (gridConfig != null)
            {
                m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true);

                string authService = gridConfig.GetString("AuthenticationService", String.Empty);

                if (authService != String.Empty)
                {
                    Object[] args = new Object[] { config };
                    m_AuthenticationService = ServerUtils.LoadPlugin <IAuthenticationService>(authService, args);
                }
                m_AllowDuplicateNames     = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames);
                m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch);

                m_SuppressVarregionOverlapCheckOnRegistration = gridConfig.GetBoolean("SuppressVarregionOverlapCheckOnRegistration", m_SuppressVarregionOverlapCheckOnRegistration);

                // This service is also used locally by a simulator running in grid mode.  This switches prevents
                // inappropriate console commands from being registered
                suppressConsoleCommands = gridConfig.GetBoolean("SuppressConsoleCommands", suppressConsoleCommands);
            }

            if (m_RootInstance == null)
            {
                m_RootInstance = this;

                if (!suppressConsoleCommands && MainConsole.Instance != null)
                {
                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                                                             "deregister region id",
                                                             "deregister region id <region-id>+",
                                                             "Deregister a region manually.",
                                                             String.Empty,
                                                             HandleDeregisterRegion);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                                                             "show regions",
                                                             "show regions",
                                                             "Show details on all regions",
                                                             String.Empty,
                                                             HandleShowRegions);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                                                             "show region name",
                                                             "show region name <Region name>",
                                                             "Show details on a region",
                                                             String.Empty,
                                                             HandleShowRegion);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                                                             "show region at",
                                                             "show region at <x-coord> <y-coord>",
                                                             "Show details on a region at the given co-ordinate.",
                                                             "For example, show region at 1000 1000",
                                                             HandleShowRegionAt);

                    MainConsole.Instance.Commands.AddCommand("General", true,
                                                             "show grid size",
                                                             "show grid size",
                                                             "Show the current grid size (excluding hyperlink references)",
                                                             String.Empty,
                                                             HandleShowGridSize);

                    MainConsole.Instance.Commands.AddCommand("Regions", true,
                                                             "set region flags",
                                                             "set region flags <Region name> <flags>",
                                                             "Set database flags for region",
                                                             String.Empty,
                                                             HandleSetFlags);
                }

                if (!suppressConsoleCommands)
                {
                    SetExtraServiceURLs(config);
                }

                m_HypergridLinker = new HypergridLinker(m_config, this, m_Database);
            }
        }