aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs69
1 files changed, 68 insertions, 1 deletions
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;
41using OpenSim.Framework.Servers.HttpServer; 41using OpenSim.Framework.Servers.HttpServer;
42using OpenSim.Framework.Statistics; 42using OpenSim.Framework.Statistics;
43using OpenSim.Region.ClientStack; 43using OpenSim.Region.ClientStack;
44using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
44using OpenSim.Region.Framework; 45using OpenSim.Region.Framework;
45using OpenSim.Region.Framework.Interfaces; 46using OpenSim.Region.Framework.Interfaces;
46using OpenSim.Region.Framework.Scenes; 47using OpenSim.Region.Framework.Scenes;
47using OpenSim.Region.Physics.Manager; 48using OpenSim.Region.Physics.Manager;
48using OpenSim.Server.Base; 49using OpenSim.Server.Base;
50using OpenSim.Services.Base;
51using OpenSim.Services.Interfaces;
52using OpenSim.Services.UserAccountService;
49 53
50namespace OpenSim 54namespace 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);