Пример #1
0
 public void Initialize(IOpenSimBase openSim)
 {
     m_OpenSimBase = openSim;
     IConfig statsConfig = openSim.ConfigSource.Configs["Stats"];
     if (statsConfig != null)
         userStatsURI = statsConfig.GetString("Stats_URI", String.Empty);
 }
Пример #2
0
        public override void Initialize(string defaultPrompt, IConfigSource source, IOpenSimBase baseOpenSim)
        {
            m_Config = source;
            uint m_consolePort = 0;

            if (source.Configs["Console"] != null)
            {
                if (source.Configs["Console"].GetString("Console", String.Empty) != Name)
                    return;
                m_consolePort = (uint)source.Configs["Console"].GetInt("remote_console_port", 0);
                m_UserName = source.Configs["Console"].GetString("RemoteConsoleUser", String.Empty);
                m_Password = source.Configs["Console"].GetString("RemoteConsolePass", String.Empty);
            }
            else
                return;

            baseOpenSim.ApplicationRegistry.RegisterInterface<ICommandConsole>(this);

            if (m_consolePort == 0)
                SetServer(MainServer.Instance);
            else
                SetServer(MainServer.GetHttpServer(m_consolePort));

            m_Commands.AddCommand("console", false, "help", "help [<command>]",
                    "Get general command list or more detailed help on a specific command", base.Help);
        }
        public void Initialise(IConfigSource configSource, IRegionCreator creator, IOpenSimBase openSim)
        {
            m_configSource = configSource;
            m_creator = creator;
            m_openSim = (OpenSimBase)openSim;
            MainConsole.Instance.Commands.AddCommand("base", false, "export database regions", "export database regions", "Exports regions in the database to an .ini file", Export);

            IConfig config = configSource.Configs["RegionStartup"];
            if (config != null)
                m_default = config.GetString("Default") == Name;
        }
 public void Initialise(IConfigSource configSource, IRegionCreator creator, IOpenSimBase openSim)
 {
     m_configSource = configSource;
     m_openSim = (OpenSimBase)openSim;
     IConfig config = configSource.Configs["RegionStartup"];
     if (config != null)
     {
         m_default = config.GetString("Default", Name) == Name; //.ini loader defaults
         m_regionConfigPath = config.GetString("RegionsDirectory", m_regionConfigPath).Trim();
     }
 }
Пример #5
0
        public override void Initialize(string defaultPrompt, IConfigSource source, IOpenSimBase baseOpenSim)
        {
            if (source.Configs["Console"] != null)
            {
                if (source.Configs["Console"].GetString("Console", Name) != Name)
                    return;
            }
            else
                return;

            baseOpenSim.ApplicationRegistry.RegisterInterface<ICommandConsole>(this);

            m_Commands.AddCommand("console", false, "help", "help [<command>]",
                    "Get general command list or more detailed help on a specific command", base.Help);
        }
 public void AddRegion(IOpenSimBase baseOS, string[] cmd)
 {
     if (!m_default)
         return;
     RegionManager manager = new RegionManager(true, (OpenSimBase)baseOS);
     System.Windows.Forms.Application.Run(manager);
 }
Пример #7
0
        public void Initialize(IOpenSimBase openSim)
        {
            m_OpenSimBase = openSim;
            m_localScenes = new List<Scene>();

            m_config = openSim.ConfigSource;

            string StorageDLL = "";

            IConfig dbConfig = m_config.Configs["DatabaseService"];
            IConfig simDataConfig = m_config.Configs["SimulationDataStore"];

            //Default to the database service config
            if (dbConfig != null)
            {
                StorageDLL = dbConfig.GetString("StorageProvider", String.Empty);
            }
            if (simDataConfig != null)
            {
                StorageDLL = simDataConfig.GetString("LocalServiceModule", String.Empty);
            }
            if (StorageDLL == String.Empty)
                StorageDLL = "OpenSim.Data.Null.dll";

            m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(StorageDLL, new object[] { m_config });

            //Register us!
            m_OpenSimBase.ApplicationRegistry.RegisterInterface<SceneManager>(this);
        }
Пример #8
0
 public void Initialize(IOpenSimBase openSim)
 {
     m_openSim = (OpenSimBase)openSim;
     MainConsole.Instance.Commands.AddCommand("base", false, "open region manager", "open region manager", "Opens the region manager", OpenRegionManager);
     m_openSim.ApplicationRegistry.RegisterInterface<IRegionCreator>(this);
 }
        public void Initialize (IOpenSimBase openSim)
        {
            m_openSim = (OpenSimBase)openSim;
            m_openSim.ApplicationRegistry.RegisterInterface<IRegionModulesController>(this);
            //m_log.DebugFormat("[REGIONMODULES]: Initializing...");

            // Who we are
            /*string id = AddinManager.CurrentAddin.Id;

            // Make friendly name
            int pos = id.LastIndexOf(".");
            if (pos == -1)
                m_name = id;
            else
                m_name = id.Substring(pos + 1);

            // The [Modules] section in the ini file
            IConfig modulesConfig =
                    m_openSim.ConfigSource.Configs["Modules"];
            if (modulesConfig == null)
                modulesConfig = m_openSim.ConfigSource.AddConfig("Modules");*/

            // Scan modules and load all that aren't disabled
            m_sharedInstances = Aurora.Framework.AuroraModuleLoader.PickupModules<ISharedRegionModule>();
            /*foreach (TypeExtensionNode node in
                    AddinManager.GetExtensionNodes("/OpenSim/RegionModules"))
            {
                if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
                {
                    // Get the config string
                    string moduleString =
                            modulesConfig.GetString("Setup_" + node.Id, String.Empty);

                    // We have a selector
                    if (moduleString != String.Empty)
                    {
                        // Allow disabling modules even if they don't have
                        // support for it
                        if (moduleString == "disabled")
                            continue;

                        // Split off port, if present
                        string[] moduleParts = moduleString.Split(new char[] { '/' }, 2);
                        // Format is [port/][class]
                        string className = moduleParts[0];
                        if (moduleParts.Length > 1)
                            className = moduleParts[1];

                        // Match the class name if given
                        if (className != String.Empty &&
                                node.Type.ToString() != className)
                            continue;
                    }

                    //m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
                    m_sharedModules.Add(node);
                }
                else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
                {
                    // Get the config string
                    string moduleString =
                            modulesConfig.GetString("Setup_" + node.Id, String.Empty);

                    // We have a selector
                    if (moduleString != String.Empty)
                    {
                        // Allow disabling modules even if they don't have
                        // support for it
                        if (moduleString == "disabled")
                            continue;

                        // Split off port, if present
                        string[] moduleParts = moduleString.Split(new char[] { '/' }, 2);
                        // Format is [port/][class]
                        string className = moduleParts[0];
                        if (moduleParts.Length > 1)
                            className = moduleParts[1];

                        // Match the class name if given
                        if (className != String.Empty &&
                                node.Type.ToString() != className)
                            continue;
                    }

                    //m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
                    m_nonSharedModules.Add(node);
                }
                else
                    m_log.DebugFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
            }*/

            /*// Load and init the module. We try a constructor with a port
            // if a port was given, fall back to one without if there is
            // no port or the more specific constructor fails.
            // This will be removed, so that any module capable of using a port
            // must provide a constructor with a port in the future.
            // For now, we do this so migration is easy.
            //
            foreach (TypeExtensionNode node in m_sharedModules)
            {
                ISharedRegionModule module = (ISharedRegionModule)Activator.CreateInstance(
                            node.Type);

                // OK, we're up and running
                m_sharedInstances.Add(module);
                module.Initialise(m_openSim.ConfigSource);
            }*/
            foreach (ISharedRegionModule module in m_sharedInstances)
            {
                module.Initialise(m_openSim.ConfigSource);
            }
        }
        public void AddRegion(IOpenSimBase baseOS, string[] cmd)
        {
            if (!m_default)
                return;
            if (cmd.Length < 4)
            {
                MainConsole.Instance.Output("Usage: create region <region name> <region_file.ini>");
                return;
            }
            else if (cmd[3].EndsWith(".ini"))
            {
                string regionFile = String.Format("{0}/{1}", m_regionConfigPath, cmd[3]);
                // Allow absolute and relative specifiers
                if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith(".."))
                    regionFile = cmd[3];

                IScene scene;
                m_log.Debug("[LOADREGIONS]: Creating Region: " + cmd[2]);
                SceneManager manager = m_openSim.ApplicationRegistry.Get<SceneManager>();
                manager.CreateRegion(new RegionInfo(cmd[2], regionFile, false, m_configSource, cmd[2]), true, out scene);
            }
            else
            {
                MainConsole.Instance.Output("Usage: create region <region name> <region_file.ini>");
                return;
            }
        }
Пример #11
0
 public ConsolePluginInitialiser(string defaultPrompt, IConfigSource source, IOpenSimBase baseOpenSim)
 {
     m_baseOpenSim = baseOpenSim;
     m_source = source;
     m_defaultPrompt = defaultPrompt;
 }
Пример #12
0
 public void AddRegion(IOpenSimBase baseOS, string[] cmd)
 {
     //Can't add regions to remote locations
 }
Пример #13
0
 public void Initialise(IConfigSource configSource, IRegionCreator creator, IOpenSimBase openSim)
 {
     m_configSource = configSource;
 }
Пример #14
0
 public UXSimStatusHandler(IOpenSimBase sim, string userStatsURI)
 {
     m_opensim = sim;
     osUXStatsURI = userStatsURI;
 }
Пример #15
0
        public void Initialize(IOpenSimBase iopenSim)
        {
            IOpenSimBase openSim = (IOpenSimBase)iopenSim;
            m_configSource = openSim.ConfigSource;
            try
            {
                if (m_configSource.Configs["RemoteAdmin"] == null ||
                    !m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false))
                {
                    // No config or disabled
                }
                else
                {
                    m_enabled = true;
                    m_config = m_configSource.Configs["RemoteAdmin"];
                    m_log.Info("[RADMIN]: Remote Admin Plugin Enabled");
                    m_requiredPassword = m_config.GetString("access_password", String.Empty);
                    int port = m_config.GetInt("port", 0);

                    m_application = openSim;
                    m_httpServer = MainServer.GetHttpServer((uint)port);

                    Dictionary<string, XmlRpcMethod> availableMethods = new Dictionary<string, XmlRpcMethod>();
                    availableMethods["admin_create_region"] = XmlRpcCreateRegionMethod;
                    availableMethods["admin_delete_region"] = XmlRpcDeleteRegionMethod;
                    availableMethods["admin_close_region"] = XmlRpcCloseRegionMethod;
                    availableMethods["admin_modify_region"] = XmlRpcModifyRegionMethod;
                    availableMethods["admin_region_query"] = XmlRpcRegionQueryMethod;
                    availableMethods["admin_shutdown"] = XmlRpcShutdownMethod;
                    availableMethods["admin_broadcast"] = XmlRpcAlertMethod;
                    availableMethods["admin_restart"] = XmlRpcRestartMethod;
                    availableMethods["admin_load_heightmap"] = XmlRpcLoadHeightmapMethod;
                    // User management
                    availableMethods["admin_create_user"] = XmlRpcCreateUserMethod;
                    availableMethods["admin_create_user_email"] = XmlRpcCreateUserMethod;
                    availableMethods["admin_exists_user"] = XmlRpcUserExistsMethod;
                    availableMethods["admin_update_user"] = XmlRpcUpdateUserAccountMethod;
                    // Region state management
                    availableMethods["admin_load_xml"] = XmlRpcLoadXMLMethod;
                    availableMethods["admin_save_xml"] = XmlRpcSaveXMLMethod;
                    availableMethods["admin_load_oar"] = XmlRpcLoadOARMethod;
                    availableMethods["admin_save_oar"] = XmlRpcSaveOARMethod;
                    // Estate access list management
                    availableMethods["admin_acl_clear"] = XmlRpcAccessListClear;
                    availableMethods["admin_acl_add"] = XmlRpcAccessListAdd;
                    availableMethods["admin_acl_remove"] = XmlRpcAccessListRemove;
                    availableMethods["admin_acl_list"] = XmlRpcAccessListList;

                    // Either enable full remote functionality or just selected features
                    string enabledMethods = m_config.GetString("enabled_methods", "all");

                    // To get this, you must explicitly specify "all" or
                    // mention it in a whitelist. It won't be available
                    // If you just leave the option out!
                    //
                    if (!String.IsNullOrEmpty(enabledMethods))
                        availableMethods["admin_console_command"] = XmlRpcConsoleCommandMethod;

                    // The assumption here is that simply enabling Remote Admin as before will produce the same
                    // behavior - enable all methods unless the whitelist is in place for backward-compatibility.
                    if (enabledMethods.ToLower() == "all" || String.IsNullOrEmpty(enabledMethods))
                    {
                        foreach (string method in availableMethods.Keys)
                        {
                            m_httpServer.AddXmlRPCHandler(method, availableMethods[method], false);
                        }
                    }
                    else
                    {
                        foreach (string enabledMethod in enabledMethods.Split('|'))
                        {
                            m_httpServer.AddXmlRPCHandler(enabledMethod, availableMethods[enabledMethod]);
                        }
                    }
                }
            }
            catch (NullReferenceException)
            {
                // Ignore.
            }
        }
Пример #16
0
 public ApplicationPluginInitialiser(IOpenSimBase s)
 {
     m_server = s;
 }