From c02636b6f3b057e9a389b536a3e14d7b5ddbc223 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Tue, 3 Mar 2015 17:42:02 -0500 Subject: Revert "corrected osMakeNotecard(string data) text length was calculated wrong. The Linden text format defines a byte count in that format." This reverts commit b519a5e62ae5ce7d408a8206c06371e1316aa5e8. The function works ok in-world but tests are failing. will revert for now. --- .../Shared/Api/Implementation/OSSL_Api.cs | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index d34e9f4..10ddf14 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1825,23 +1825,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Create new asset AssetBase asset = new AssetBase(UUID.Random(), name, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString()); asset.Description = description; - byte[] a; - byte[] b; - byte[] c; - b = Util.UTF8.GetBytes(data); + int textLength = data.Length; + data + = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length " + + textLength.ToString() + "\n" + data + "}\n"; - a = Util.UTF8.GetBytes( - "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length" + b.Length.ToString() + "\n"); - - c = Util.UTF8.GetBytes("}"); - - byte[] d = new byte[a.Length + b.Length + c.Length]; - Buffer.BlockCopy(a, 0, d, 0, a.Length); - Buffer.BlockCopy(b, 0, d, a.Length, b.Length); - Buffer.BlockCopy(c, 0, d, a.Length + b.Length, c.Length); - - asset.Data = d; + asset.Data = Util.UTF8.GetBytes(data); World.AssetService.Store(asset); // Create Task Entry -- cgit v1.1