From 63b0bd7f6b6b110a565cdb0e2e896d473c096a76 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 15 Sep 2019 16:49:58 +0100 Subject: fix saving appearence to notecard, so they can work on older regions --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index ebd281e..a4d873e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3456,10 +3456,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return SaveAppearanceToNotecard(m_host.OwnerID, notecard); } - public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard) + public LSL_Key osAgentSaveAppearance(LSL_Key avatarKey, string notecard) { CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance"); + UUID avatarId; + if (!UUID.TryParse(avatarKey, out avatarId)) + return new LSL_Key(UUID.Zero.ToString()); + return SaveAppearanceToNotecard(avatarId, notecard); } @@ -3470,8 +3474,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (appearanceModule != null) { appearanceModule.SaveBakedTextures(sp.UUID); - EntityTransferContext ctx = new EntityTransferContext(); - OSDMap appearancePacked = sp.Appearance.Pack(ctx); + OSDMap appearancePacked = sp.Appearance.PackForNotecard(); TaskInventoryItem item = SaveNotecard(notecard, "Avatar Appearance", Util.GetFormattedXml(appearancePacked as OSD), true); @@ -3494,15 +3497,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return SaveAppearanceToNotecard(sp, notecard); } - protected LSL_Key SaveAppearanceToNotecard(LSL_Key rawAvatarId, string notecard) - { - UUID avatarId; - if (!UUID.TryParse(rawAvatarId, out avatarId)) - return new LSL_Key(UUID.Zero.ToString()); - - return SaveAppearanceToNotecard(avatarId, notecard); - } - /// /// Get the gender as specified in avatar appearance for a given avatar key /// -- cgit v1.1