aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
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/Framework
parentWrite code to create minimum necessary body parts/clothing and avatar entries... (diff)
downloadopensim-SC-522d6261f11ffaf8320c3f0775beb5d0608ce226.zip
opensim-SC-522d6261f11ffaf8320c3f0775beb5d0608ce226.tar.gz
opensim-SC-522d6261f11ffaf8320c3f0775beb5d0608ce226.tar.bz2
opensim-SC-522d6261f11ffaf8320c3f0775beb5d0608ce226.tar.xz
Correctly create a freshly created estate owner's default items and avatar entries on standalone if applicable.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs82
1 files changed, 0 insertions, 82 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index f394a95..976e001 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1170,88 +1170,6 @@ namespace OpenSim.Region.Framework.Scenes
1170 m_dialogModule = RequestModuleInterface<IDialogModule>(); 1170 m_dialogModule = RequestModuleInterface<IDialogModule>();
1171 m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); 1171 m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
1172 m_teleportModule = RequestModuleInterface<IEntityTransferModule>(); 1172 m_teleportModule = RequestModuleInterface<IEntityTransferModule>();
1173
1174 // Shoving this in here for now, because we have the needed
1175 // interfaces at this point
1176 //
1177 // TODO: Find a better place for this
1178 //
1179 while (m_regInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
1180 {
1181 MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", m_regInfo.EstateSettings.EstateName);
1182 List<char> excluded = new List<char>(new char[1]{' '});
1183 string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
1184 string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
1185
1186 UserAccount account = UserAccountService.GetUserAccount(m_regInfo.ScopeID, first, last);
1187
1188 if (account == null)
1189 {
1190 // Create a new account
1191 account = new UserAccount(m_regInfo.ScopeID, first, last, String.Empty);
1192 if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0))
1193 {
1194 account.ServiceURLs = new Dictionary<string, object>();
1195 account.ServiceURLs["HomeURI"] = string.Empty;
1196 account.ServiceURLs["GatekeeperURI"] = string.Empty;
1197 account.ServiceURLs["InventoryServerURI"] = string.Empty;
1198 account.ServiceURLs["AssetServerURI"] = string.Empty;
1199 }
1200
1201 if (UserAccountService.StoreUserAccount(account))
1202 {
1203 string password = MainConsole.Instance.PasswdPrompt("Password");
1204 string email = MainConsole.Instance.CmdPrompt("Email", "");
1205
1206 account.Email = email;
1207 UserAccountService.StoreUserAccount(account);
1208
1209 bool success = false;
1210 success = AuthenticationService.SetPassword(account.PrincipalID, password);
1211 if (!success)
1212 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.",
1213 first, last);
1214
1215 GridRegion home = null;
1216 if (GridService != null)
1217 {
1218 List<GridRegion> defaultRegions = GridService.GetDefaultRegions(UUID.Zero);
1219 if (defaultRegions != null && defaultRegions.Count >= 1)
1220 home = defaultRegions[0];
1221
1222 if (GridUserService != null && home != null)
1223 GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0));
1224 else
1225 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set home for account {0} {1}.",
1226 first, last);
1227
1228 }
1229 else
1230 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to retrieve home region for account {0} {1}.",
1231 first, last);
1232
1233 if (InventoryService != null)
1234 success = InventoryService.CreateUserInventory(account.PrincipalID);
1235 if (!success)
1236 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.",
1237 first, last);
1238
1239
1240
1241 m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", first, last);
1242
1243 m_regInfo.EstateSettings.EstateOwner = account.PrincipalID;
1244 m_regInfo.EstateSettings.Save();
1245 }
1246 else
1247 m_log.ErrorFormat("[SCENE]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first.");
1248 }
1249 else
1250 {
1251 m_regInfo.EstateSettings.EstateOwner = account.PrincipalID;
1252 m_regInfo.EstateSettings.Save();
1253 }
1254 }
1255 } 1173 }
1256 1174
1257 #endregion 1175 #endregion