diff options
author | Justin Clark-Casey (justincc) | 2011-09-23 22:36:20 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-09-23 22:36:20 +0100 |
commit | 8c4dd6b3302a142c6ac7578cc5012049c51610ed (patch) | |
tree | 75540bc841ed9588479c64d2cffd116130afd928 /OpenSim/Region/Application | |
parent | Use a copy of the inventory items list to register users in the thread starte... (diff) | |
parent | remove unused SOP.Create() method (diff) | |
download | opensim-SC_OLD-8c4dd6b3302a142c6ac7578cc5012049c51610ed.zip opensim-SC_OLD-8c4dd6b3302a142c6ac7578cc5012049c51610ed.tar.gz opensim-SC_OLD-8c4dd6b3302a142c6ac7578cc5012049c51610ed.tar.bz2 opensim-SC_OLD-8c4dd6b3302a142c6ac7578cc5012049c51610ed.tar.xz |
Merge branch 'master' into 0.7.2-post-fixes
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 69 |
2 files changed, 74 insertions, 5 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index fe1525b..e5b9dcb 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -269,13 +269,15 @@ namespace OpenSim | |||
269 | 269 | ||
270 | m_console.Commands.AddCommand("region", false, "save oar", | 270 | m_console.Commands.AddCommand("region", false, "save oar", |
271 | //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", | 271 | //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", |
272 | "save oar [-p|--profile=<url>] [--noassets] [<OAR path>]", | 272 | "save oar [-p|--profile=<url>] [--noassets] [--perm=<permissions>] [<OAR path>]", |
273 | "Save a region's data to an OAR archive.", | 273 | "Save a region's data to an OAR archive.", |
274 | // "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine | 274 | // "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine |
275 | "-p|--profile=<url> adds the url of the profile service to the saved user information." + Environment.NewLine | 275 | "-p|--profile=<url> adds the url of the profile service to the saved user information." + Environment.NewLine |
276 | + " The OAR path must be a filesystem path." | 276 | + "--noassets stops assets being saved to the OAR." + Environment.NewLine |
277 | + " If this is not given then the oar is saved to region.oar in the current directory." + Environment.NewLine | 277 | + "--perm stops objects with insufficient permissions from being saved to the OAR." + Environment.NewLine |
278 | + "--noassets stops assets being saved to the OAR.", | 278 | + " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer" + Environment.NewLine |
279 | + "The OAR path must be a filesystem path." | ||
280 | + " If this is not given then the oar is saved to region.oar in the current directory.", | ||
279 | SaveOar); | 281 | SaveOar); |
280 | 282 | ||
281 | m_console.Commands.AddCommand("region", false, "edit scale", | 283 | m_console.Commands.AddCommand("region", false, "edit scale", |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 00b080c..866ba9a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -41,11 +41,15 @@ using OpenSim.Framework.Servers; | |||
41 | using OpenSim.Framework.Servers.HttpServer; | 41 | using OpenSim.Framework.Servers.HttpServer; |
42 | using OpenSim.Framework.Statistics; | 42 | using OpenSim.Framework.Statistics; |
43 | using OpenSim.Region.ClientStack; | 43 | using OpenSim.Region.ClientStack; |
44 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; | ||
44 | using OpenSim.Region.Framework; | 45 | using OpenSim.Region.Framework; |
45 | using OpenSim.Region.Framework.Interfaces; | 46 | using OpenSim.Region.Framework.Interfaces; |
46 | using OpenSim.Region.Framework.Scenes; | 47 | using OpenSim.Region.Framework.Scenes; |
47 | using OpenSim.Region.Physics.Manager; | 48 | using OpenSim.Region.Physics.Manager; |
48 | using OpenSim.Server.Base; | 49 | using OpenSim.Server.Base; |
50 | using OpenSim.Services.Base; | ||
51 | using OpenSim.Services.Interfaces; | ||
52 | using OpenSim.Services.UserAccountService; | ||
49 | 53 | ||
50 | namespace OpenSim | 54 | namespace OpenSim |
51 | { | 55 | { |
@@ -362,6 +366,9 @@ namespace OpenSim | |||
362 | 366 | ||
363 | scene.SetModuleInterfaces(); | 367 | scene.SetModuleInterfaces(); |
364 | 368 | ||
369 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | ||
370 | SetUpEstateOwner(scene); | ||
371 | |||
365 | // Prims have to be loaded after module configuration since some modules may be invoked during the load | 372 | // Prims have to be loaded after module configuration since some modules may be invoked during the load |
366 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); | 373 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); |
367 | 374 | ||
@@ -411,9 +418,69 @@ namespace OpenSim | |||
411 | 418 | ||
412 | scene.StartTimer(); | 419 | scene.StartTimer(); |
413 | 420 | ||
421 | scene.StartScripts(); | ||
422 | |||
414 | return clientServer; | 423 | return clientServer; |
415 | } | 424 | } |
416 | 425 | ||
426 | /// <summary> | ||
427 | /// Try to set up the estate owner for the given scene. | ||
428 | /// </summary> | ||
429 | /// <remarks> | ||
430 | /// The involves asking the user for information about the user on the console. If the user does not already | ||
431 | /// exist then it is created. | ||
432 | /// </remarks> | ||
433 | /// <param name="scene"></param> | ||
434 | private void SetUpEstateOwner(Scene scene) | ||
435 | { | ||
436 | RegionInfo regionInfo = scene.RegionInfo; | ||
437 | |||
438 | MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName); | ||
439 | List<char> excluded = new List<char>(new char[1]{' '}); | ||
440 | string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded); | ||
441 | string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded); | ||
442 | |||
443 | UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last); | ||
444 | |||
445 | if (account == null) | ||
446 | { | ||
447 | |||
448 | // XXX: The LocalUserAccountServicesConnector is currently registering its inner service rather than | ||
449 | // itself! | ||
450 | // if (scene.UserAccountService is LocalUserAccountServicesConnector) | ||
451 | // { | ||
452 | // IUserAccountService innerUas | ||
453 | // = ((LocalUserAccountServicesConnector)scene.UserAccountService).UserAccountService; | ||
454 | // | ||
455 | // m_log.DebugFormat("B {0}", innerUas.GetType()); | ||
456 | // | ||
457 | // if (innerUas is UserAccountService) | ||
458 | // { | ||
459 | |||
460 | if (scene.UserAccountService is UserAccountService) | ||
461 | { | ||
462 | string password = MainConsole.Instance.PasswdPrompt("Password"); | ||
463 | string email = MainConsole.Instance.CmdPrompt("Email", ""); | ||
464 | |||
465 | account | ||
466 | = ((UserAccountService)scene.UserAccountService).CreateUser( | ||
467 | regionInfo.ScopeID, first, last, password, email); | ||
468 | } | ||
469 | // } | ||
470 | } | ||
471 | |||
472 | if (account == null) | ||
473 | { | ||
474 | m_log.ErrorFormat( | ||
475 | "[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first."); | ||
476 | } | ||
477 | else | ||
478 | { | ||
479 | regionInfo.EstateSettings.EstateOwner = account.PrincipalID; | ||
480 | regionInfo.EstateSettings.Save(); | ||
481 | } | ||
482 | } | ||
483 | |||
417 | private void ShutdownRegion(Scene scene) | 484 | private void ShutdownRegion(Scene scene) |
418 | { | 485 | { |
419 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); | 486 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); |