aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-16 00:12:12 +0100
committerJustin Clark-Casey (justincc)2011-09-16 00:12:12 +0100
commit522d6261f11ffaf8320c3f0775beb5d0608ce226 (patch)
tree156395f407ca56551784aa630b53286d14bbcf32 /OpenSim/Region/Application/OpenSimBase.cs
parentWrite code to create minimum necessary body parts/clothing and avatar entries... (diff)
downloadopensim-SC_OLD-522d6261f11ffaf8320c3f0775beb5d0608ce226.zip
opensim-SC_OLD-522d6261f11ffaf8320c3f0775beb5d0608ce226.tar.gz
opensim-SC_OLD-522d6261f11ffaf8320c3f0775beb5d0608ce226.tar.bz2
opensim-SC_OLD-522d6261f11ffaf8320c3f0775beb5d0608ce226.tar.xz
Correctly create a freshly created estate owner's default items and avatar entries on standalone if applicable.
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 92e8ed1..3060169 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{
@@ -362,6 +365,53 @@ namespace OpenSim
362 365
363 scene.SetModuleInterfaces(); 366 scene.SetModuleInterfaces();
364 367
368 // FIXME: Put me into a separate method!
369 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
370 {
371 MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName);
372 List<char> excluded = new List<char>(new char[1]{' '});
373 string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
374 string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
375
376 UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last);
377
378 if (account == null)
379 {
380 m_log.DebugFormat("A {0}", scene.UserAccountService.GetType());
381
382// if (scene.UserAccountService is LocalUserAccountServicesConnector)
383// {
384// IUserAccountService innerUas
385// = ((LocalUserAccountServicesConnector)scene.UserAccountService).UserAccountService;
386//
387// m_log.DebugFormat("B {0}", innerUas.GetType());
388//
389// if (innerUas is UserAccountService)
390// {
391
392 if (scene.UserAccountService is UserAccountService)
393 {
394 string password = MainConsole.Instance.PasswdPrompt("Password");
395 string email = MainConsole.Instance.CmdPrompt("Email", "");
396
397 // TODO: Where do we put m_regInfo.ScopeID?
398 account = ((UserAccountService)scene.UserAccountService).CreateUser(first, last, password, email);
399 }
400// }
401 }
402
403 if (account == null)
404 {
405 m_log.ErrorFormat(
406 "[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first.");
407 }
408 else
409 {
410 regionInfo.EstateSettings.EstateOwner = account.PrincipalID;
411 regionInfo.EstateSettings.Save();
412 }
413 }
414
365 // Prims have to be loaded after module configuration since some modules may be invoked during the load 415 // Prims have to be loaded after module configuration since some modules may be invoked during the load
366 scene.LoadPrimsFromStorage(regionInfo.originRegionID); 416 scene.LoadPrimsFromStorage(regionInfo.originRegionID);
367 417