aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDr Scofield2008-08-28 07:37:16 +0000
committerDr Scofield2008-08-28 07:37:16 +0000
commit4a3523bc67d16e9f5e07c65ab8fba88f49423171 (patch)
tree5bdd0951e6ee82086c6609224d0c6338e6923c46 /OpenSim
parentAdded some exceptions for bad profile cut parameters (diff)
downloadopensim-SC_OLD-4a3523bc67d16e9f5e07c65ab8fba88f49423171.zip
opensim-SC_OLD-4a3523bc67d16e9f5e07c65ab8fba88f49423171.tar.gz
opensim-SC_OLD-4a3523bc67d16e9f5e07c65ab8fba88f49423171.tar.bz2
opensim-SC_OLD-4a3523bc67d16e9f5e07c65ab8fba88f49423171.tar.xz
this fixes the crash reported by mantis #2046: user server crashing if
no OpenSim.ini file found by GridInfoService. GridInfoService now will just issue a warning that GridInfo will NOT be available to your users if no OpenSim.ini file is available. due to the static nature of UserConfig (configuration options hardcoded) i don't think it's currently an option to move GridInfo into user_server.xml but if anyone wants to look into this i'd be delighted...
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/GridInfoService.cs27
1 files changed, 21 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/GridInfoService.cs b/OpenSim/Framework/Communications/GridInfoService.cs
index ad60638..ce66c82 100644
--- a/OpenSim/Framework/Communications/GridInfoService.cs
+++ b/OpenSim/Framework/Communications/GridInfoService.cs
@@ -57,6 +57,27 @@ namespace OpenSim.Framework.Communications
57 /// </remarks> 57 /// </remarks>
58 public GridInfoService(IConfigSource configSource) 58 public GridInfoService(IConfigSource configSource)
59 { 59 {
60 loadGridInfo(configSource);
61 }
62
63 /// <summary>
64 /// Default constructor, uses OpenSim.ini.
65 /// </summary>
66 public GridInfoService()
67 {
68 try
69 {
70 IConfigSource configSource = new IniConfigSource(Path.Combine(Util.configDir(), "OpenSim.ini"));
71 loadGridInfo(configSource);
72 }
73 catch (FileNotFoundException)
74 {
75 _log.Warn("[GridInfoService] no OpenSim.ini file found --- GridInfoServices WILL NOT BE AVAILABLE to your users");
76 }
77 }
78
79 private void loadGridInfo(IConfigSource configSource)
80 {
60 _info["platform"] = "OpenSim"; 81 _info["platform"] = "OpenSim";
61 try 82 try
62 { 83 {
@@ -98,13 +119,7 @@ namespace OpenSim.Framework.Communications
98 _log.Debug("[GridInfoService] cannot get grid info from config source, using minimal defaults"); 119 _log.Debug("[GridInfoService] cannot get grid info from config source, using minimal defaults");
99 } 120 }
100 _log.InfoFormat("[GridInfoService] Grid info service initialized with {0} keys", _info.Count); 121 _log.InfoFormat("[GridInfoService] Grid info service initialized with {0} keys", _info.Count);
101 }
102 122
103 /// <summary>
104 /// Default constructor, uses OpenSim.ini.
105 /// </summary>
106 public GridInfoService() : this(new IniConfigSource(Path.Combine(Util.configDir(), "OpenSim.ini")))
107 {
108 } 123 }
109 124
110 private void IssueWarning() 125 private void IssueWarning()