diff options
author | UbitUmarov | 2018-04-14 23:05:46 +0100 |
---|---|---|
committer | UbitUmarov | 2018-04-14 23:05:46 +0100 |
commit | 7c9c5cfedf90d7589386f4dddc6879c0734a0429 (patch) | |
tree | 2febae4da3c4cb73c29fc8dd6134aacac55c3f50 /OpenSim/Services/UserAccountService | |
parent | sound radius: missing file (diff) | |
download | opensim-SC-7c9c5cfedf90d7589386f4dddc6879c0734a0429.zip opensim-SC-7c9c5cfedf90d7589386f4dddc6879c0734a0429.tar.gz opensim-SC-7c9c5cfedf90d7589386f4dddc6879c0734a0429.tar.bz2 opensim-SC-7c9c5cfedf90d7589386f4dddc6879c0734a0429.tar.xz |
robust create user: allow new userid to be to generate a new random one; handle possible case of a weareble being a inventory link
Diffstat (limited to 'OpenSim/Services/UserAccountService')
-rw-r--r-- | OpenSim/Services/UserAccountService/UserAccountService.cs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 5561287..95c9e57 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -407,7 +407,7 @@ namespace OpenSim.Services.UserAccountService | |||
407 | else email = cmdparams[5]; | 407 | else email = cmdparams[5]; |
408 | 408 | ||
409 | if (cmdparams.Length < 7) | 409 | if (cmdparams.Length < 7) |
410 | rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString()); | 410 | rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID (enter for random)", ""); |
411 | else | 411 | else |
412 | rawPrincipalId = cmdparams[6]; | 412 | rawPrincipalId = cmdparams[6]; |
413 | 413 | ||
@@ -417,7 +417,9 @@ namespace OpenSim.Services.UserAccountService | |||
417 | model = cmdparams[7]; | 417 | model = cmdparams[7]; |
418 | 418 | ||
419 | UUID principalId = UUID.Zero; | 419 | UUID principalId = UUID.Zero; |
420 | if (!UUID.TryParse(rawPrincipalId, out principalId)) | 420 | if(String.IsNullOrWhiteSpace(rawPrincipalId)) |
421 | principalId = UUID.Random(); | ||
422 | else if (!UUID.TryParse(rawPrincipalId, out principalId)) | ||
421 | throw new Exception(string.Format("ID {0} is not a valid UUID", rawPrincipalId)); | 423 | throw new Exception(string.Format("ID {0} is not a valid UUID", rawPrincipalId)); |
422 | 424 | ||
423 | CreateUser(UUID.Zero, principalId, firstName, lastName, password, email, model); | 425 | CreateUser(UUID.Zero, principalId, firstName, lastName, password, email, model); |
@@ -823,6 +825,7 @@ namespace OpenSim.Services.UserAccountService | |||
823 | return; | 825 | return; |
824 | } | 826 | } |
825 | 827 | ||
828 | |||
826 | try | 829 | try |
827 | { | 830 | { |
828 | CopyWearablesAndAttachments(destinationAgent, modelAccount.PrincipalID, modelAppearance); | 831 | CopyWearablesAndAttachments(destinationAgent, modelAccount.PrincipalID, modelAppearance); |
@@ -876,12 +879,20 @@ namespace OpenSim.Services.UserAccountService | |||
876 | for (int i = 0; i < wearables.Length; i++) | 879 | for (int i = 0; i < wearables.Length; i++) |
877 | { | 880 | { |
878 | wearable = wearables[i]; | 881 | wearable = wearables[i]; |
879 | m_log.DebugFormat("[XXX]: Getting item {0} from avie {1}", wearable[0].ItemID, source); | ||
880 | if (wearable[0].ItemID != UUID.Zero) | 882 | if (wearable[0].ItemID != UUID.Zero) |
881 | { | 883 | { |
884 | m_log.DebugFormat("[XXX]: Getting item {0} from avie {1}", wearable[0].ItemID, source); | ||
882 | // Get inventory item and copy it | 885 | // Get inventory item and copy it |
883 | InventoryItemBase item = m_InventoryService.GetItem(source, wearable[0].ItemID); | 886 | InventoryItemBase item = m_InventoryService.GetItem(source, wearable[0].ItemID); |
884 | 887 | ||
888 | if(item != null && item.AssetType == (int)AssetType.Link) | ||
889 | { | ||
890 | if(item.AssetID == UUID.Zero ) | ||
891 | item = null; | ||
892 | else | ||
893 | item = m_InventoryService.GetItem(source, item.AssetID); | ||
894 | } | ||
895 | |||
885 | if (item != null) | 896 | if (item != null) |
886 | { | 897 | { |
887 | InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); | 898 | InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); |