diff options
author | Dr Scofield | 2008-10-23 12:10:58 +0000 |
---|---|---|
committer | Dr Scofield | 2008-10-23 12:10:58 +0000 |
commit | 44052a142375ca7446064df093de0a7677364bc8 (patch) | |
tree | 6b2e0ef6f6888bfadd7e80bb619448e755cfb6b1 | |
parent | fix: recent patch to XmlRpcCreateRegionMethod introduced master avatar (diff) | |
download | opensim-SC-44052a142375ca7446064df093de0a7677364bc8.zip opensim-SC-44052a142375ca7446064df093de0a7677364bc8.tar.gz opensim-SC-44052a142375ca7446064df093de0a7677364bc8.tar.bz2 opensim-SC-44052a142375ca7446064df093de0a7677364bc8.tar.xz |
fix: allowing explicit setting of UUID for master avatar in
CreateRegion (and documenting it).
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index f29a62f..3157ffe 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -448,17 +448,28 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
448 | string masterPassword = (string)requestData["region_master_password"]; | 448 | string masterPassword = (string)requestData["region_master_password"]; |
449 | 449 | ||
450 | UUID userID = UUID.Zero; | 450 | UUID userID = UUID.Zero; |
451 | UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(masterFirst, masterLast); | 451 | if (requestData.ContainsKey("region_master_uuid")) |
452 | if (null == userProfile) | ||
453 | { | 452 | { |
454 | m_log.InfoFormat("master avatar does not exist, creating it"); | 453 | // ok, client wants us to use an explicit UUID |
455 | userID = m_app.CreateUser(masterFirst, masterLast, masterPassword, region.RegionLocX, region.RegionLocY); | 454 | // regardless of what the avatar name provided |
456 | if (userID == UUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}", | 455 | userID = new UUID((string)requestData["region_master_uuid"]); |
457 | masterFirst, masterLast)); | ||
458 | } | 456 | } |
459 | else | 457 | else |
460 | { | 458 | { |
461 | userID = userProfile.ID; | 459 | // no client supplied UUID: look it up... |
460 | UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(masterFirst, masterLast); | ||
461 | if (null == userProfile) | ||
462 | { | ||
463 | m_log.InfoFormat("master avatar does not exist, creating it"); | ||
464 | // ...or create new user | ||
465 | userID = m_app.CreateUser(masterFirst, masterLast, masterPassword, region.RegionLocX, region.RegionLocY); | ||
466 | if (userID == UUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}", | ||
467 | masterFirst, masterLast)); | ||
468 | } | ||
469 | else | ||
470 | { | ||
471 | userID = userProfile.ID; | ||
472 | } | ||
462 | } | 473 | } |
463 | 474 | ||
464 | region.MasterAvatarFirstName = masterFirst; | 475 | region.MasterAvatarFirstName = masterFirst; |