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.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index dd0ea67..85870f0 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -41,11 +41,14 @@ 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.Interfaces;
51using OpenSim.Services.UserAccountService;
49 52
50namespace OpenSim 53namespace OpenSim
51{ 54{
@@ -411,6 +414,53 @@ namespace OpenSim
411 scene.SnmpService.BootInfo("Loading prins", scene); 414 scene.SnmpService.BootInfo("Loading prins", scene);
412 } 415 }
413 416
417 // FIXME: Put me into a separate method!
418 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
419 {
420 MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName);
421 List<char> excluded = new List<char>(new char[1]{' '});
422 string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
423 string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
424
425 UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last);
426
427 if (account == null)
428 {
429 m_log.DebugFormat("A {0}", scene.UserAccountService.GetType());
430
431// if (scene.UserAccountService is LocalUserAccountServicesConnector)
432// {
433// IUserAccountService innerUas
434// = ((LocalUserAccountServicesConnector)scene.UserAccountService).UserAccountService;
435//
436// m_log.DebugFormat("B {0}", innerUas.GetType());
437//
438// if (innerUas is UserAccountService)
439// {
440
441 if (scene.UserAccountService is UserAccountService)
442 {
443 string password = MainConsole.Instance.PasswdPrompt("Password");
444 string email = MainConsole.Instance.CmdPrompt("Email", "");
445
446 // TODO: Where do we put m_regInfo.ScopeID?
447 account = ((UserAccountService)scene.UserAccountService).CreateUser(first, last, password, email);
448 }
449// }
450 }
451
452 if (account == null)
453 {
454 m_log.ErrorFormat(
455 "[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first.");
456 }
457 else
458 {
459 regionInfo.EstateSettings.EstateOwner = account.PrincipalID;
460 regionInfo.EstateSettings.Save();
461 }
462 }
463
414 // Prims have to be loaded after module configuration since some modules may be invoked during the load 464 // Prims have to be loaded after module configuration since some modules may be invoked during the load
415 scene.LoadPrimsFromStorage(regionInfo.originRegionID); 465 scene.LoadPrimsFromStorage(regionInfo.originRegionID);
416 466