aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/Application.cs2
-rw-r--r--OpenSim/Region/Application/ConfigurationLoader.cs24
-rw-r--r--OpenSim/Region/Application/IApplicationPlugin.cs2
-rw-r--r--OpenSim/Region/Application/OpenSim.cs315
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs95
-rw-r--r--OpenSim/Region/Application/Properties/AssemblyInfo.cs36
6 files changed, 414 insertions, 60 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 6215055..e441cc8 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -130,7 +130,7 @@ namespace OpenSim
130 if (workerThreads < workerThreadsMin) 130 if (workerThreads < workerThreadsMin)
131 { 131 {
132 workerThreads = workerThreadsMin; 132 workerThreads = workerThreadsMin;
133 m_log.InfoFormat("[OPENSIM MAIN]: Bumping up to max worker threads to {0}",workerThreads); 133 m_log.InfoFormat("[OPENSIM MAIN]: Bumping up max worker threads to {0}",workerThreads);
134 } 134 }
135 if (workerThreads > workerThreadsMax) 135 if (workerThreads > workerThreadsMax)
136 { 136 {
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs
index 52e520c..b19e549 100644
--- a/OpenSim/Region/Application/ConfigurationLoader.cs
+++ b/OpenSim/Region/Application/ConfigurationLoader.cs
@@ -82,8 +82,7 @@ namespace OpenSim
82 82
83 List<string> sources = new List<string>(); 83 List<string> sources = new List<string>();
84 84
85 string masterFileName = 85 string masterFileName = startupConfig.GetString("inimaster", "OpenSimDefaults.ini");
86 startupConfig.GetString("inimaster", "OpenSimDefaults.ini");
87 86
88 if (masterFileName == "none") 87 if (masterFileName == "none")
89 masterFileName = String.Empty; 88 masterFileName = String.Empty;
@@ -207,25 +206,14 @@ namespace OpenSim
207 Environment.Exit(1); 206 Environment.Exit(1);
208 } 207 }
209 208
209 // Merge OpSys env vars
210 m_log.Info("[CONFIG]: Loading environment variables for Config");
211 Util.MergeEnvironmentToConfig(m_config.Source);
212
210 // Make sure command line options take precedence 213 // Make sure command line options take precedence
211 m_config.Source.Merge(argvSource); 214 m_config.Source.Merge(argvSource);
212 215
213 IConfig enVars = m_config.Source.Configs["Environment"]; 216 m_config.Source.ReplaceKeyValues();
214
215 if( enVars != null )
216 {
217 string[] env_keys = enVars.GetKeys();
218
219 foreach ( string key in env_keys )
220 {
221 envConfigSource.AddEnv(key, string.Empty);
222 }
223
224 envConfigSource.LoadEnv();
225 m_config.Source.Merge(envConfigSource);
226 }
227
228 m_config.Source.ExpandKeyValues();
229 217
230 ReadConfigSettings(); 218 ReadConfigSettings();
231 219
diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs
index 6e6d48c..a3fa66c 100644
--- a/OpenSim/Region/Application/IApplicationPlugin.cs
+++ b/OpenSim/Region/Application/IApplicationPlugin.cs
@@ -26,12 +26,14 @@
26 */ 26 */
27 27
28using OpenSim.Framework; 28using OpenSim.Framework;
29using Mono.Addins;
29 30
30namespace OpenSim 31namespace OpenSim
31{ 32{
32 /// <summary> 33 /// <summary>
33 /// OpenSimulator Application Plugin framework interface 34 /// OpenSimulator Application Plugin framework interface
34 /// </summary> 35 /// </summary>
36 [TypeExtensionPoint(NodeName="Plugin", NodeType = typeof(PluginExtensionNode), Path="/OpenSim/Startup")]
35 public interface IApplicationPlugin : IPlugin 37 public interface IApplicationPlugin : IPlugin
36 { 38 {
37 /// <summary> 39 /// <summary>
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 1e6ef3b..a350510 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -45,6 +45,7 @@ using OpenSim.Framework.Servers;
45using OpenSim.Framework.Monitoring; 45using OpenSim.Framework.Monitoring;
46using OpenSim.Region.Framework.Interfaces; 46using OpenSim.Region.Framework.Interfaces;
47using OpenSim.Region.Framework.Scenes; 47using OpenSim.Region.Framework.Scenes;
48using OpenSim.Services.Interfaces;
48 49
49namespace OpenSim 50namespace OpenSim
50{ 51{
@@ -114,8 +115,13 @@ namespace OpenSim
114 if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod)) 115 if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod))
115 Util.FireAndForgetMethod = asyncCallMethod; 116 Util.FireAndForgetMethod = asyncCallMethod;
116 117
118<<<<<<< HEAD
119 stpMinThreads = startupConfig.GetInt("MinPoolThreads", 15);
120 stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 300);
121=======
117 stpMinThreads = startupConfig.GetInt("MinPoolThreads", 2 ); 122 stpMinThreads = startupConfig.GetInt("MinPoolThreads", 2 );
118 stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 25); 123 stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 25);
124>>>>>>> avn/ubitvar
119 m_consolePrompt = startupConfig.GetString("ConsolePrompt", @"Region (\R) "); 125 m_consolePrompt = startupConfig.GetString("ConsolePrompt", @"Region (\R) ");
120 } 126 }
121 127
@@ -155,7 +161,7 @@ namespace OpenSim
155 ((RemoteConsole)m_console).ReadConfig(Config); 161 ((RemoteConsole)m_console).ReadConfig(Config);
156 break; 162 break;
157 default: 163 default:
158 m_console = new LocalConsole("Region"); 164 m_console = new LocalConsole("Region", Config.Configs["Startup"]);
159 break; 165 break;
160 } 166 }
161 } 167 }
@@ -267,13 +273,20 @@ namespace OpenSim
267 SavePrimsXml2); 273 SavePrimsXml2);
268 274
269 m_console.Commands.AddCommand("Archiving", false, "load oar", 275 m_console.Commands.AddCommand("Archiving", false, "load oar",
276<<<<<<< HEAD
277=======
270 278
279>>>>>>> avn/ubitvar
271 "load oar [--merge] [--skip-assets]" 280 "load oar [--merge] [--skip-assets]"
272 + " [--default-user \"User Name\"]" 281 + " [--default-user \"User Name\"]"
273 + " [--force-terrain] [--force-parcels]" 282 + " [--force-terrain] [--force-parcels]"
274 + " [--no-objects]" 283 + " [--no-objects]"
275 + " [--rotation degrees] [--rotation-center \"<x,y,z>\"]" 284 + " [--rotation degrees] [--rotation-center \"<x,y,z>\"]"
285<<<<<<< HEAD
286 + " [--displacement \"<x,y,z>\"]"
287=======
276 + " [--displacement \"<x,y,z>\"]" 288 + " [--displacement \"<x,y,z>\"]"
289>>>>>>> avn/ubitvar
277 + " [<OAR path>]", 290 + " [<OAR path>]",
278 "Load a region's data from an OAR archive.", 291 "Load a region's data from an OAR archive.",
279 "--merge will merge the OAR with the existing scene (suppresses terrain and parcel info loading).\n" 292 "--merge will merge the OAR with the existing scene (suppresses terrain and parcel info loading).\n"
@@ -386,7 +399,7 @@ namespace OpenSim
386 399
387 m_console.Commands.AddCommand("Regions", false, "restart", 400 m_console.Commands.AddCommand("Regions", false, "restart",
388 "restart", 401 "restart",
389 "Restart all sims in this instance", 402 "Restart the currently selected region(s) in this instance",
390 RunCommand); 403 RunCommand);
391 404
392 m_console.Commands.AddCommand("General", false, "command-script", 405 m_console.Commands.AddCommand("General", false, "command-script",
@@ -403,6 +416,27 @@ namespace OpenSim
403 "delete-region <name>", 416 "delete-region <name>",
404 "Delete a region from disk", 417 "Delete a region from disk",
405 RunCommand); 418 RunCommand);
419
420 m_console.Commands.AddCommand("Estates", false, "estate create",
421 "estate create <owner UUID> <estate name>",
422 "Creates a new estate with the specified name, owned by the specified user."
423 + " Estate name must be unique.",
424 CreateEstateCommand);
425
426 m_console.Commands.AddCommand("Estates", false, "estate set owner",
427 "estate set owner <estate-id>[ <UUID> | <Firstname> <Lastname> ]",
428 "Sets the owner of the specified estate to the specified UUID or user. ",
429 SetEstateOwnerCommand);
430
431 m_console.Commands.AddCommand("Estates", false, "estate set name",
432 "estate set name <estate-id> <new name>",
433 "Sets the name of the specified estate to the specified value. New name must be unique.",
434 SetEstateNameCommand);
435
436 m_console.Commands.AddCommand("Estates", false, "estate link region",
437 "estate link region <estate ID> <region ID>",
438 "Attaches the specified region to the specified estate.",
439 EstateLinkRegionCommand);
406 } 440 }
407 441
408 protected override void ShutdownSpecific() 442 protected override void ShutdownSpecific()
@@ -563,7 +597,7 @@ namespace OpenSim
563 { 597 {
564 scene.ForEachSOG(delegate(SceneObjectGroup sog) 598 scene.ForEachSOG(delegate(SceneObjectGroup sog)
565 { 599 {
566 if (sog.AttachmentPoint == 0) 600 if (!sog.IsAttachment)
567 { 601 {
568 sog.RootPart.UpdateRotation(rot * sog.GroupRotation); 602 sog.RootPart.UpdateRotation(rot * sog.GroupRotation);
569 Vector3 offset = sog.AbsolutePosition - center; 603 Vector3 offset = sog.AbsolutePosition - center;
@@ -592,7 +626,7 @@ namespace OpenSim
592 { 626 {
593 scene.ForEachSOG(delegate(SceneObjectGroup sog) 627 scene.ForEachSOG(delegate(SceneObjectGroup sog)
594 { 628 {
595 if (sog.AttachmentPoint == 0) 629 if (!sog.IsAttachment)
596 { 630 {
597 if (sog.RootPart.AbsolutePosition.Z < minZ) 631 if (sog.RootPart.AbsolutePosition.Z < minZ)
598 minZ = sog.RootPart.AbsolutePosition.Z; 632 minZ = sog.RootPart.AbsolutePosition.Z;
@@ -604,7 +638,7 @@ namespace OpenSim
604 { 638 {
605 scene.ForEachSOG(delegate(SceneObjectGroup sog) 639 scene.ForEachSOG(delegate(SceneObjectGroup sog)
606 { 640 {
607 if (sog.AttachmentPoint == 0) 641 if (!sog.IsAttachment)
608 { 642 {
609 Vector3 tmpRootPos = sog.RootPart.AbsolutePosition; 643 Vector3 tmpRootPos = sog.RootPart.AbsolutePosition;
610 tmpRootPos.Z -= minZ; 644 tmpRootPos.Z -= minZ;
@@ -644,7 +678,7 @@ namespace OpenSim
644 { 678 {
645 scene.ForEachSOG(delegate(SceneObjectGroup sog) 679 scene.ForEachSOG(delegate(SceneObjectGroup sog)
646 { 680 {
647 if (sog.AttachmentPoint == 0) 681 if (!sog.IsAttachment)
648 sog.UpdateGroupPosition(sog.AbsolutePosition + offset); 682 sog.UpdateGroupPosition(sog.AbsolutePosition + offset);
649 }); 683 });
650 }); 684 });
@@ -711,7 +745,9 @@ namespace OpenSim
711 CreateRegion(regInfo, true, out scene); 745 CreateRegion(regInfo, true, out scene);
712 746
713 if (changed) 747 if (changed)
714 regInfo.EstateSettings.Save(); 748 m_estateDataService.StoreEstateSettings(regInfo.EstateSettings);
749
750 scene.Start();
715 } 751 }
716 752
717 /// <summary> 753 /// <summary>
@@ -902,7 +938,7 @@ namespace OpenSim
902 938
903 foreach (IRegionModuleBase module in scene.RegionModules.Values) 939 foreach (IRegionModuleBase module in scene.RegionModules.Values)
904 { 940 {
905 if (module.GetType().GetInterface("ISharedRegionModule") != null) 941 if (module.GetType().GetInterface("ISharedRegionModule") == null)
906 nonSharedModules.Add(module); 942 nonSharedModules.Add(module);
907 else 943 else
908 sharedModules.Add(module); 944 sharedModules.Add(module);
@@ -920,17 +956,30 @@ namespace OpenSim
920 break; 956 break;
921 957
922 case "regions": 958 case "regions":
959 ConsoleDisplayTable cdt = new ConsoleDisplayTable();
960 cdt.AddColumn("Name", ConsoleDisplayUtil.RegionNameSize);
961 cdt.AddColumn("ID", ConsoleDisplayUtil.UuidSize);
962 cdt.AddColumn("Position", ConsoleDisplayUtil.CoordTupleSize);
963 cdt.AddColumn("Size", 11);
964 cdt.AddColumn("Port", ConsoleDisplayUtil.PortSize);
965 cdt.AddColumn("Ready?", 6);
966 cdt.AddColumn("Estate", ConsoleDisplayUtil.EstateNameSize);
923 SceneManager.ForEachScene( 967 SceneManager.ForEachScene(
924 delegate(Scene scene) 968 scene =>
925 { 969 {
926 MainConsole.Instance.Output(String.Format( 970 RegionInfo ri = scene.RegionInfo;
927 "Region Name: {0}, Region XLoc: {1}, Region YLoc: {2}, Region Port: {3}, Estate Name: {4}", 971 cdt.AddRow(
928 scene.RegionInfo.RegionName, 972 ri.RegionName,
929 scene.RegionInfo.RegionLocX, 973 ri.RegionID,
930 scene.RegionInfo.RegionLocY, 974 string.Format("{0},{1}", ri.RegionLocX, ri.RegionLocY),
931 scene.RegionInfo.InternalEndPoint.Port, 975 string.Format("{0}x{1}", ri.RegionSizeX, ri.RegionSizeY),
932 scene.RegionInfo.EstateSettings.EstateName)); 976 ri.InternalEndPoint.Port,
933 }); 977 scene.Ready ? "Yes" : "No",
978 ri.EstateSettings.EstateName);
979 }
980 );
981
982 MainConsole.Instance.Output(cdt.ToString());
934 break; 983 break;
935 984
936 case "ratings": 985 case "ratings":
@@ -979,7 +1028,7 @@ namespace OpenSim
979 aCircuit.child ? "child" : "root", 1028 aCircuit.child ? "child" : "root",
980 aCircuit.circuitcode.ToString(), 1029 aCircuit.circuitcode.ToString(),
981 aCircuit.IPAddress != null ? aCircuit.IPAddress.ToString() : "not set", 1030 aCircuit.IPAddress != null ? aCircuit.IPAddress.ToString() : "not set",
982 aCircuit.Viewer); 1031 Util.GetViewerName(aCircuit));
983 }); 1032 });
984 1033
985 MainConsole.Instance.Output(cdt.ToString()); 1034 MainConsole.Instance.Output(cdt.ToString());
@@ -1172,6 +1221,232 @@ namespace OpenSim
1172 SceneManager.SaveCurrentSceneToArchive(cmdparams); 1221 SceneManager.SaveCurrentSceneToArchive(cmdparams);
1173 } 1222 }
1174 1223
1224 protected void CreateEstateCommand(string module, string[] args)
1225 {
1226 string response = null;
1227 UUID userID;
1228
1229 if (args.Length == 2)
1230 {
1231 response = "No user specified.";
1232 }
1233 else if (!UUID.TryParse(args[2], out userID))
1234 {
1235 response = String.Format("{0} is not a valid UUID", args[2]);
1236 }
1237 else if (args.Length == 3)
1238 {
1239 response = "No estate name specified.";
1240 }
1241 else
1242 {
1243 Scene scene = SceneManager.CurrentOrFirstScene;
1244
1245 // TODO: Is there a better choice here?
1246 UUID scopeID = UUID.Zero;
1247 UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, userID);
1248 if (account == null)
1249 {
1250 response = String.Format("Could not find user {0}", userID);
1251 }
1252 else
1253 {
1254 // concatenate it all to "name"
1255 StringBuilder sb = new StringBuilder(args[3]);
1256 for (int i = 4; i < args.Length; i++)
1257 sb.Append (" " + args[i]);
1258 string estateName = sb.ToString().Trim();
1259
1260 // send it off for processing.
1261 IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
1262 response = estateModule.CreateEstate(estateName, userID);
1263 if (response == String.Empty)
1264 {
1265 List<int> estates = scene.EstateDataService.GetEstates(estateName);
1266 response = String.Format("Estate {0} created as \"{1}\"", estates.ElementAt(0), estateName);
1267 }
1268 }
1269 }
1270
1271 // give the user some feedback
1272 if (response != null)
1273 MainConsole.Instance.Output(response);
1274 }
1275
1276 protected void SetEstateOwnerCommand(string module, string[] args)
1277 {
1278 string response = null;
1279
1280 Scene scene = SceneManager.CurrentOrFirstScene;
1281 IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
1282
1283 if (args.Length == 3)
1284 {
1285 response = "No estate specified.";
1286 }
1287 else
1288 {
1289 int estateId;
1290 if (!int.TryParse(args[3], out estateId))
1291 {
1292 response = String.Format("\"{0}\" is not a valid ID for an Estate", args[3]);
1293 }
1294 else
1295 {
1296 if (args.Length == 4)
1297 {
1298 response = "No user specified.";
1299 }
1300 else
1301 {
1302 UserAccount account = null;
1303
1304 // TODO: Is there a better choice here?
1305 UUID scopeID = UUID.Zero;
1306
1307 string s1 = args[4];
1308 if (args.Length == 5)
1309 {
1310 // attempt to get account by UUID
1311 UUID u;
1312 if (UUID.TryParse(s1, out u))
1313 {
1314 account = scene.UserAccountService.GetUserAccount(scopeID, u);
1315 if (account == null)
1316 response = String.Format("Could not find user {0}", s1);
1317 }
1318 else
1319 {
1320 response = String.Format("Invalid UUID {0}", s1);
1321 }
1322 }
1323 else
1324 {
1325 // attempt to get account by Firstname, Lastname
1326 string s2 = args[5];
1327 account = scene.UserAccountService.GetUserAccount(scopeID, s1, s2);
1328 if (account == null)
1329 response = String.Format("Could not find user {0} {1}", s1, s2);
1330 }
1331
1332 // If it's valid, send it off for processing.
1333 if (account != null)
1334 response = estateModule.SetEstateOwner(estateId, account);
1335
1336 if (response == String.Empty)
1337 {
1338 response = String.Format("Estate owner changed to {0} ({1} {2})", account.PrincipalID, account.FirstName, account.LastName);
1339 }
1340 }
1341 }
1342 }
1343
1344 // give the user some feedback
1345 if (response != null)
1346 MainConsole.Instance.Output(response);
1347 }
1348
1349 protected void SetEstateNameCommand(string module, string[] args)
1350 {
1351 string response = null;
1352
1353 Scene scene = SceneManager.CurrentOrFirstScene;
1354 IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
1355
1356 if (args.Length == 3)
1357 {
1358 response = "No estate specified.";
1359 }
1360 else
1361 {
1362 int estateId;
1363 if (!int.TryParse(args[3], out estateId))
1364 {
1365 response = String.Format("\"{0}\" is not a valid ID for an Estate", args[3]);
1366 }
1367 else
1368 {
1369 if (args.Length == 4)
1370 {
1371 response = "No name specified.";
1372 }
1373 else
1374 {
1375 // everything after the estate ID is "name"
1376 StringBuilder sb = new StringBuilder(args[4]);
1377 for (int i = 5; i < args.Length; i++)
1378 sb.Append (" " + args[i]);
1379
1380 string estateName = sb.ToString();
1381
1382 // send it off for processing.
1383 response = estateModule.SetEstateName(estateId, estateName);
1384
1385 if (response == String.Empty)
1386 {
1387 response = String.Format("Estate {0} renamed to \"{1}\"", estateId, estateName);
1388 }
1389 }
1390 }
1391 }
1392
1393 // give the user some feedback
1394 if (response != null)
1395 MainConsole.Instance.Output(response);
1396 }
1397
1398 private void EstateLinkRegionCommand(string module, string[] args)
1399 {
1400 int estateId =-1;
1401 UUID regionId = UUID.Zero;
1402 Scene scene = null;
1403 string response = null;
1404
1405 if (args.Length == 3)
1406 {
1407 response = "No estate specified.";
1408 }
1409 else if (!int.TryParse(args [3], out estateId))
1410 {
1411 response = String.Format("\"{0}\" is not a valid ID for an Estate", args [3]);
1412 }
1413 else if (args.Length == 4)
1414 {
1415 response = "No region specified.";
1416 }
1417 else if (!UUID.TryParse(args[4], out regionId))
1418 {
1419 response = String.Format("\"{0}\" is not a valid UUID for a Region", args [4]);
1420 }
1421 else if (!SceneManager.TryGetScene(regionId, out scene))
1422 {
1423 // region may exist, but on a different sim.
1424 response = String.Format("No access to Region \"{0}\"", args [4]);
1425 }
1426
1427 if (response != null)
1428 {
1429 MainConsole.Instance.Output(response);
1430 return;
1431 }
1432
1433 // send it off for processing.
1434 IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
1435 response = estateModule.SetRegionEstate(scene.RegionInfo, estateId);
1436 if (response == String.Empty)
1437 {
1438 estateModule.TriggerRegionInfoChange();
1439 estateModule.sendRegionHandshakeToAll();
1440 response = String.Format ("Region {0} is now attached to estate {1}", regionId, estateId);
1441 }
1442
1443 // give the user some feedback
1444 if (response != null)
1445 MainConsole.Instance.Output (response);
1446 }
1447
1448 #endregion
1449
1175 private static string CombineParams(string[] commandParams, int pos) 1450 private static string CombineParams(string[] commandParams, int pos)
1176 { 1451 {
1177 string result = String.Empty; 1452 string result = String.Empty;
@@ -1182,7 +1457,5 @@ namespace OpenSim
1182 result = result.TrimEnd(' '); 1457 result = result.TrimEnd(' ');
1183 return result; 1458 return result;
1184 } 1459 }
1185
1186 #endregion
1187 } 1460 }
1188} 1461}
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index e8cf7cc..760decd 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -71,6 +71,20 @@ namespace OpenSim
71 // OpenSim.ini Section name for ESTATES Settings 71 // OpenSim.ini Section name for ESTATES Settings
72 public const string ESTATE_SECTION_NAME = "Estates"; 72 public const string ESTATE_SECTION_NAME = "Estates";
73 73
74 /// <summary>
75 /// Allow all plugin loading to be disabled for tests/debug.
76 /// </summary>
77 /// <remarks>
78 /// true by default
79 /// </remarks>
80 public bool EnableInitialPluginLoad { get; set; }
81
82 /// <summary>
83 /// Control whether we attempt to load an estate data service.
84 /// </summary>
85 /// <remarks>For tests/debugging</remarks>
86 public bool LoadEstateDataService { get; set; }
87
74 protected string proxyUrl; 88 protected string proxyUrl;
75 protected int proxyOffset = 0; 89 protected int proxyOffset = 0;
76 90
@@ -96,7 +110,7 @@ namespace OpenSim
96 110
97 public ConsoleCommand CreateAccount = null; 111 public ConsoleCommand CreateAccount = null;
98 112
99 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); 113 public List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
100 114
101 private List<string> m_permsModules; 115 private List<string> m_permsModules;
102 116
@@ -139,6 +153,8 @@ namespace OpenSim
139 /// <param name="configSource"></param> 153 /// <param name="configSource"></param>
140 public OpenSimBase(IConfigSource configSource) : base() 154 public OpenSimBase(IConfigSource configSource) : base()
141 { 155 {
156 EnableInitialPluginLoad = true;
157 LoadEstateDataService = true;
142 LoadConfigSettings(configSource); 158 LoadConfigSettings(configSource);
143 } 159 }
144 160
@@ -158,14 +174,37 @@ namespace OpenSim
158 proxyUrl = networkConfig.GetString("proxy_url", ""); 174 proxyUrl = networkConfig.GetString("proxy_url", "");
159 proxyOffset = Int32.Parse(networkConfig.GetString("proxy_offset", "0")); 175 proxyOffset = Int32.Parse(networkConfig.GetString("proxy_offset", "0"));
160 } 176 }
177
178 IConfig startupConfig = Config.Configs["Startup"];
179 if (startupConfig != null)
180 {
181 Util.LogOverloads = startupConfig.GetBoolean("LogOverloads", true);
182 }
161 } 183 }
162 184
163 protected virtual void LoadPlugins() 185 protected virtual void LoadPlugins()
164 { 186 {
165 using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this))) 187 IConfig startupConfig = Config.Configs["Startup"];
188 string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation", String.Empty) : String.Empty;
189
190 // The location can also be specified in the environment. If there
191 // is no location in the configuration, we must call the constructor
192 // without a location parameter to allow that to happen.
193 if (registryLocation == String.Empty)
166 { 194 {
167 loader.Load("/OpenSim/Startup"); 195 using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this)))
168 m_plugins = loader.Plugins; 196 {
197 loader.Load("/OpenSim/Startup");
198 m_plugins = loader.Plugins;
199 }
200 }
201 else
202 {
203 using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this), registryLocation))
204 {
205 loader.Load("/OpenSim/Startup");
206 m_plugins = loader.Plugins;
207 }
169 } 208 }
170 } 209 }
171 210
@@ -221,23 +260,29 @@ namespace OpenSim
221 module)); 260 module));
222 261
223 // Load the estate data service 262 // Load the estate data service
224 IConfig estateDataConfig = Config.Configs["EstateDataStore"]; 263 module = Util.GetConfigVarFromSections<string>(Config, "LocalServiceModule", new string[]{"EstateDataStore", "EstateService"}, String.Empty);
225 if (estateDataConfig == null)
226 throw new Exception("Configuration file is missing the [EstateDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?");
227
228 module = estateDataConfig.GetString("LocalServiceModule", String.Empty);
229 if (String.IsNullOrEmpty(module)) 264 if (String.IsNullOrEmpty(module))
230 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); 265 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] or [EstateService] section");
231 266
232 m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config }); 267 if (LoadEstateDataService)
233 if (m_estateDataService == null) 268 {
234 throw new Exception( 269 m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config });
235 string.Format( 270 if (m_estateDataService == null)
236 "Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.", 271 throw new Exception(
237 module)); 272 string.Format(
273 "Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.",
274 module));
275 }
238 276
239 base.StartupSpecific(); 277 base.StartupSpecific();
240 278
279<<<<<<< HEAD
280 if (EnableInitialPluginLoad)
281 LoadPlugins();
282
283 // We still want to post initalize any plugins even if loading has been disabled since a test may have
284 // inserted them manually.
285=======
241 LoadPlugins(); 286 LoadPlugins();
242 287
243 if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch! 288 if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch!
@@ -245,10 +290,9 @@ namespace OpenSim
245 Environment.Exit(1); 290 Environment.Exit(1);
246 } 291 }
247 292
293>>>>>>> avn/ubitvar
248 foreach (IApplicationPlugin plugin in m_plugins) 294 foreach (IApplicationPlugin plugin in m_plugins)
249 {
250 plugin.PostInitialise(); 295 plugin.PostInitialise();
251 }
252 296
253 if (m_console != null) 297 if (m_console != null)
254 AddPluginCommands(m_console); 298 AddPluginCommands(m_console);
@@ -315,6 +359,10 @@ namespace OpenSim
315 { 359 {
316 // Called from base.StartUp() 360 // Called from base.StartUp()
317 361
362 IConfig startupConfig = Config.Configs["Startup"];
363 if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true))
364 WorkManager.JobEngine.Start();
365
318 m_httpServerPort = m_networkServersInfo.HttpListenerPort; 366 m_httpServerPort = m_networkServersInfo.HttpListenerPort;
319 SceneManager.OnRestartSim += HandleRestartRegion; 367 SceneManager.OnRestartSim += HandleRestartRegion;
320 368
@@ -604,7 +652,7 @@ namespace OpenSim
604 else 652 else
605 { 653 {
606 regionInfo.EstateSettings.EstateOwner = account.PrincipalID; 654 regionInfo.EstateSettings.EstateOwner = account.PrincipalID;
607 regionInfo.EstateSettings.Save(); 655 m_estateDataService.StoreEstateSettings(regionInfo.EstateSettings);
608 } 656 }
609 } 657 }
610 658
@@ -784,6 +832,10 @@ namespace OpenSim
784 { 832 {
785 Vector3 regionExtent = new Vector3(regionInfo.RegionSizeX, regionInfo.RegionSizeY, regionInfo.RegionSizeZ); 833 Vector3 regionExtent = new Vector3(regionInfo.RegionSizeX, regionInfo.RegionSizeY, regionInfo.RegionSizeZ);
786 PhysicsScene physicsScene = GetPhysicsScene(regionInfo.RegionName, regionExtent); 834 PhysicsScene physicsScene = GetPhysicsScene(regionInfo.RegionName, regionExtent);
835<<<<<<< HEAD
836
837=======
838>>>>>>> avn/ubitvar
787 SceneCommunicationService sceneGridService = new SceneCommunicationService(); 839 SceneCommunicationService sceneGridService = new SceneCommunicationService();
788 840
789 return new Scene( 841 return new Scene(
@@ -932,6 +984,9 @@ namespace OpenSim
932 try 984 try
933 { 985 {
934 SceneManager.Close(); 986 SceneManager.Close();
987
988 foreach (IApplicationPlugin plugin in m_plugins)
989 plugin.Dispose();
935 } 990 }
936 catch (Exception e) 991 catch (Exception e)
937 { 992 {
@@ -1004,7 +1059,7 @@ namespace OpenSim
1004 // back to the default. The reloading of estate settings by scene could be eliminated if it 1059 // back to the default. The reloading of estate settings by scene could be eliminated if it
1005 // knows that the passed in settings in RegionInfo are already valid. Also, it might be 1060 // knows that the passed in settings in RegionInfo are already valid. Also, it might be
1006 // possible to eliminate some additional later saves made by callers of this method. 1061 // possible to eliminate some additional later saves made by callers of this method.
1007 regInfo.EstateSettings.Save(); 1062 EstateDataService.StoreEstateSettings(regInfo.EstateSettings);
1008 1063
1009 return true; 1064 return true;
1010 } 1065 }
diff --git a/OpenSim/Region/Application/Properties/AssemblyInfo.cs b/OpenSim/Region/Application/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8652312
--- /dev/null
+++ b/OpenSim/Region/Application/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4using Mono.Addins;
5
6// General Information about an assembly is controlled through the following
7// set of attributes. Change these attribute values to modify the information
8// associated with an assembly.
9[assembly: AssemblyTitle("OpenSim")]
10[assembly: AssemblyDescription("The executable for for simulator")]
11[assembly: AssemblyConfiguration("")]
12[assembly: AssemblyCompany("http://opensimulator.org")]
13[assembly: AssemblyProduct("OpenSim")]
14[assembly: AssemblyCopyright("OpenSimulator developers")]
15[assembly: AssemblyTrademark("")]
16[assembly: AssemblyCulture("")]
17
18// Setting ComVisible to false makes the types in this assembly not visible
19// to COM components. If you need to access a type in this assembly from
20// COM, set the ComVisible attribute to true on that type.
21[assembly: ComVisible(false)]
22
23// The following GUID is for the ID of the typelib if this project is exposed to COM
24[assembly: Guid("f6700ed5-1e6f-44d8-8397-e5eac42b3856")]
25
26// Version information for an assembly consists of the following four values:
27//
28// Major Version
29// Minor Version
30// Build Number
31// Revision
32//
33[assembly: AssemblyVersion("0.8.2.*")]
34
35[assembly: AddinRoot("OpenSim", OpenSim.VersionInfo.VersionNumber)]
36[assembly: ImportAddinAssembly("OpenSim.Framework.dll")]