aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs
blob: e3cfac75e180e597f7bc1329126f9f8d5460c180 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Text;

using OpenSim.Framework.Configuration;

namespace OpenSim.Framework.Configuration.HTTP
{
    public class RemoteConfigSettings
    {
        private ConfigurationMember configMember;

        public string baseConfigURL = "";
        public RemoteConfigSettings(string filename)
        {
            configMember = new ConfigurationMember(filename, "REMOTE CONFIG SETTINGS", loadConfigurationOptions, handleIncomingConfiguration);
            configMember.forceConfigurationPluginLibrary("OpenSim.Framework.Configuration.XML.dll");
            configMember.performConfigurationRetrieve();
        }

        public void loadConfigurationOptions()
        {
            configMember.addConfigurationOption("base_config_url", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "URL Containing Configuration Files", "http://localhost/", false);
        }
        public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
        {
            if (configuration_key == "base_config_url")
            {
                baseConfigURL = (string)configuration_result;
            }
            return true;
        }
    }
}