diff options
author | Justin Clark-Casey (justincc) | 2011-09-16 00:12:12 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-09-16 00:12:12 +0100 |
commit | 522d6261f11ffaf8320c3f0775beb5d0608ce226 (patch) | |
tree | 156395f407ca56551784aa630b53286d14bbcf32 /OpenSim/Region/Application | |
parent | Write code to create minimum necessary body parts/clothing and avatar entries... (diff) | |
download | opensim-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')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 50 |
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; | |||
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.Interfaces; | ||
51 | using OpenSim.Services.UserAccountService; | ||
49 | 52 | ||
50 | namespace OpenSim | 53 | namespace 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 | ||