aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/UserAccountService/UserAccountService.cs
diff options
context:
space:
mode:
authorDiva Canto2011-10-13 18:03:19 -0700
committerDiva Canto2011-10-13 18:03:19 -0700
commit83c7b9b609d3c78d099a0bf18de8685676184f94 (patch)
treed7ecdd61be63465f4b5604de81e6b12fa74284e8 /OpenSim/Services/UserAccountService/UserAccountService.cs
parentrefactor: rename IClientAPI.SendPrimUpdate() to SendEntityUpdate() since it s... (diff)
downloadopensim-SC_OLD-83c7b9b609d3c78d099a0bf18de8685676184f94.zip
opensim-SC_OLD-83c7b9b609d3c78d099a0bf18de8685676184f94.tar.gz
opensim-SC_OLD-83c7b9b609d3c78d099a0bf18de8685676184f94.tar.bz2
opensim-SC_OLD-83c7b9b609d3c78d099a0bf18de8685676184f94.tar.xz
Bug fix -- Test User on first run standalone might not be created properly: let all instances of UserAccountService have all its service references properly initialized, and register console commands on only one.
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs90
1 files changed, 44 insertions, 46 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index 923be7e..e234c0a 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -62,58 +62,56 @@ namespace OpenSim.Services.UserAccountService
62 if (userConfig == null) 62 if (userConfig == null)
63 throw new Exception("No UserAccountService configuration"); 63 throw new Exception("No UserAccountService configuration");
64 64
65 // In case there are several instances of this class in the same process, 65 m_RootInstance = this;
66 // the console commands are only registered for the root instance 66 string gridServiceDll = userConfig.GetString("GridService", string.Empty);
67 if (m_RootInstance == null) 67 if (gridServiceDll != string.Empty)
68 { 68 m_GridService = LoadPlugin<IGridService>(gridServiceDll, new Object[] { config });
69 m_RootInstance = this;
70 string gridServiceDll = userConfig.GetString("GridService", string.Empty);
71 if (gridServiceDll != string.Empty)
72 m_GridService = LoadPlugin<IGridService>(gridServiceDll, new Object[] { config });
73 69
74 string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty); 70 string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty);
75 if (authServiceDll != string.Empty) 71 if (authServiceDll != string.Empty)
76 m_AuthenticationService = LoadPlugin<IAuthenticationService>(authServiceDll, new Object[] { config }); 72 m_AuthenticationService = LoadPlugin<IAuthenticationService>(authServiceDll, new Object[] { config });
77 73
78 string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty); 74 string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty);
79 if (presenceServiceDll != string.Empty) 75 if (presenceServiceDll != string.Empty)
80 m_GridUserService = LoadPlugin<IGridUserService>(presenceServiceDll, new Object[] { config }); 76 m_GridUserService = LoadPlugin<IGridUserService>(presenceServiceDll, new Object[] { config });
81 77
82 string invServiceDll = userConfig.GetString("InventoryService", string.Empty); 78 string invServiceDll = userConfig.GetString("InventoryService", string.Empty);
83 if (invServiceDll != string.Empty) 79 if (invServiceDll != string.Empty)
84 m_InventoryService = LoadPlugin<IInventoryService>(invServiceDll, new Object[] { config }); 80 m_InventoryService = LoadPlugin<IInventoryService>(invServiceDll, new Object[] { config });
85 81
86 string avatarServiceDll = userConfig.GetString("AvatarService", string.Empty); 82 string avatarServiceDll = userConfig.GetString("AvatarService", string.Empty);
87 if (avatarServiceDll != string.Empty) 83 if (avatarServiceDll != string.Empty)
88 m_AvatarService = LoadPlugin<IAvatarService>(avatarServiceDll, new Object[] { config }); 84 m_AvatarService = LoadPlugin<IAvatarService>(avatarServiceDll, new Object[] { config });
89 85
90 m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false); 86 m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false);
91 87
92 if (MainConsole.Instance != null) 88 // In case there are several instances of this class in the same process,
93 { 89 // the console commands are only registered for the root instance
94 MainConsole.Instance.Commands.AddCommand("UserService", false, 90 if (m_RootInstance == null && MainConsole.Instance != null)
95 "create user", 91 {
96 "create user [<first> [<last> [<pass> [<email> [<user id>]]]]]", 92 m_RootInstance = this;
97 "Create a new user", HandleCreateUser); 93 MainConsole.Instance.Commands.AddCommand("UserService", false,
98 94 "create user",
99 MainConsole.Instance.Commands.AddCommand("UserService", false, 95 "create user [<first> [<last> [<pass> [<email> [<user id>]]]]]",
100 "reset user password", 96 "Create a new user", HandleCreateUser);
101 "reset user password [<first> [<last> [<password>]]]", 97
102 "Reset a user password", HandleResetUserPassword); 98 MainConsole.Instance.Commands.AddCommand("UserService", false,
103 99 "reset user password",
104 MainConsole.Instance.Commands.AddCommand("UserService", false, 100 "reset user password [<first> [<last> [<password>]]]",
105 "set user level", 101 "Reset a user password", HandleResetUserPassword);
106 "set user level [<first> [<last> [<level>]]]", 102
107 "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, " 103 MainConsole.Instance.Commands.AddCommand("UserService", false,
108 + "this account will be treated as god-moded. " 104 "set user level",
109 + "It will also affect the 'login level' command. ", 105 "set user level [<first> [<last> [<level>]]]",
110 HandleSetUserLevel); 106 "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, "
111 107 + "this account will be treated as god-moded. "
112 MainConsole.Instance.Commands.AddCommand("UserService", false, 108 + "It will also affect the 'login level' command. ",
113 "show account", 109 HandleSetUserLevel);
114 "show account <first> <last>", 110
115 "Show account details for the given user", HandleShowAccount); 111 MainConsole.Instance.Commands.AddCommand("UserService", false,
116 } 112 "show account",
113 "show account <first> <last>",
114 "Show account details for the given user", HandleShowAccount);
117 } 115 }
118 } 116 }
119 117