diff options
Diffstat (limited to 'OpenSim/Server/Handlers')
-rw-r--r-- | OpenSim/Server/Handlers/Base/ServerConnector.cs | 67 | ||||
-rw-r--r-- | OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs | 21 | ||||
-rw-r--r-- | OpenSim/Server/Handlers/Properties/AssemblyInfo.cs | 4 |
3 files changed, 81 insertions, 11 deletions
diff --git a/OpenSim/Server/Handlers/Base/ServerConnector.cs b/OpenSim/Server/Handlers/Base/ServerConnector.cs index 71876da..72014db 100644 --- a/OpenSim/Server/Handlers/Base/ServerConnector.cs +++ b/OpenSim/Server/Handlers/Base/ServerConnector.cs | |||
@@ -39,8 +39,75 @@ namespace OpenSim.Server.Handlers.Base | |||
39 | 39 | ||
40 | public class ServiceConnector : IServiceConnector | 40 | public class ServiceConnector : IServiceConnector |
41 | { | 41 | { |
42 | public virtual string ConfigURL | ||
43 | { | ||
44 | get { return String.Empty; } | ||
45 | } | ||
46 | |||
47 | public virtual string ConfigName | ||
48 | { | ||
49 | get; | ||
50 | protected set; | ||
51 | } | ||
52 | |||
53 | public virtual string ConfigFile | ||
54 | { | ||
55 | get; | ||
56 | protected set; | ||
57 | } | ||
58 | |||
59 | public virtual IConfigSource Config | ||
60 | { | ||
61 | get; | ||
62 | protected set; | ||
63 | } | ||
64 | |||
65 | public ServiceConnector() | ||
66 | { | ||
67 | } | ||
68 | |||
42 | public ServiceConnector(IConfigSource config, IHttpServer server, string configName) | 69 | public ServiceConnector(IConfigSource config, IHttpServer server, string configName) |
43 | { | 70 | { |
44 | } | 71 | } |
72 | |||
73 | // We call this from our plugin module to get our configuration | ||
74 | public IConfig GetConfig() | ||
75 | { | ||
76 | IConfig config = null; | ||
77 | config = ServerUtils.GetConfig(ConfigFile, ConfigName); | ||
78 | |||
79 | // Our file is not here? We can get one to bootstrap our plugin module | ||
80 | if ( config == null ) | ||
81 | { | ||
82 | IConfigSource remotesource = GetConfigSource(); | ||
83 | |||
84 | if (remotesource != null) | ||
85 | { | ||
86 | IniConfigSource initialconfig = new IniConfigSource(); | ||
87 | initialconfig.Merge (remotesource); | ||
88 | initialconfig.Save(ConfigFile); | ||
89 | } | ||
90 | |||
91 | config = remotesource.Configs[ConfigName]; | ||
92 | } | ||
93 | |||
94 | return config; | ||
95 | } | ||
96 | |||
97 | // We get our remote initial configuration for bootstrapping in case | ||
98 | // we have no configuration in our main file or in an existing | ||
99 | // modular config file. This is the last resort to bootstrap the | ||
100 | // configuration, likely a new plugin loading for the first time. | ||
101 | private IConfigSource GetConfigSource() | ||
102 | { | ||
103 | IConfigSource source = null; | ||
104 | |||
105 | source = ServerUtils.LoadInitialConfig(ConfigURL); | ||
106 | |||
107 | if (source == null) | ||
108 | System.Console.WriteLine(String.Format ("Config Url: {0} Not found!", ConfigURL)); | ||
109 | |||
110 | return source; | ||
111 | } | ||
45 | } | 112 | } |
46 | } | 113 | } |
diff --git a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs index 965a54e..346af32 100644 --- a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs +++ b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs | |||
@@ -170,14 +170,6 @@ namespace OpenSim.Server.Handlers.Grid | |||
170 | public string JsonGetGridInfoMethod(string request, string path, string param, | 170 | public string JsonGetGridInfoMethod(string request, string path, string param, |
171 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 171 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
172 | { | 172 | { |
173 | string HomeURI = String.Empty; | ||
174 | IConfig cfg = m_Config.Configs["LoginService"]; | ||
175 | |||
176 | if (null != cfg) | ||
177 | { | ||
178 | HomeURI = cfg.GetString("SRV_HomeURI", HomeURI); | ||
179 | } | ||
180 | |||
181 | OSDMap map = new OSDMap(); | 173 | OSDMap map = new OSDMap(); |
182 | 174 | ||
183 | foreach (string k in _info.Keys) | 175 | foreach (string k in _info.Keys) |
@@ -185,9 +177,20 @@ namespace OpenSim.Server.Handlers.Grid | |||
185 | map[k] = OSD.FromString(_info[k].ToString()); | 177 | map[k] = OSD.FromString(_info[k].ToString()); |
186 | } | 178 | } |
187 | 179 | ||
180 | string HomeURI = Util.GetConfigVarFromSections<string>(m_Config, "HomeURI", | ||
181 | new string[] { "Startup", "Hypergrid" }, String.Empty); | ||
182 | |||
188 | if (!String.IsNullOrEmpty(HomeURI)) | 183 | if (!String.IsNullOrEmpty(HomeURI)) |
184 | map["home"] = OSD.FromString(HomeURI); | ||
185 | else // Legacy. Remove soon! | ||
189 | { | 186 | { |
190 | map["home"] = OSD.FromString(HomeURI); | 187 | IConfig cfg = m_Config.Configs["LoginService"]; |
188 | |||
189 | if (null != cfg) | ||
190 | HomeURI = cfg.GetString("SRV_HomeURI", HomeURI); | ||
191 | |||
192 | if (!String.IsNullOrEmpty(HomeURI)) | ||
193 | map["home"] = OSD.FromString(HomeURI); | ||
191 | } | 194 | } |
192 | 195 | ||
193 | return OSDParser.SerializeJsonString(map).ToString(); | 196 | return OSDParser.SerializeJsonString(map).ToString(); |
diff --git a/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs b/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs index 53e9737..3295ffd 100644 --- a/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs +++ b/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs | |||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices; | |||
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | [assembly: AssemblyVersion("0.7.5.*")] | 32 | [assembly: AssemblyVersion("0.7.6.*")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | |