diff options
author | BlueWall | 2015-03-03 17:42:02 -0500 |
---|---|---|
committer | BlueWall | 2015-03-03 17:42:02 -0500 |
commit | c02636b6f3b057e9a389b536a3e14d7b5ddbc223 (patch) | |
tree | e0ef520ee2a47feda74590b87ef670cc74d3f8f7 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Pickup our version number for the function (diff) | |
download | opensim-SC-c02636b6f3b057e9a389b536a3e14d7b5ddbc223.zip opensim-SC-c02636b6f3b057e9a389b536a3e14d7b5ddbc223.tar.gz opensim-SC-c02636b6f3b057e9a389b536a3e14d7b5ddbc223.tar.bz2 opensim-SC-c02636b6f3b057e9a389b536a3e14d7b5ddbc223.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 20 |
1 files changed, 5 insertions, 15 deletions
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 | |||
1825 | // Create new asset | 1825 | // Create new asset |
1826 | AssetBase asset = new AssetBase(UUID.Random(), name, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString()); | 1826 | AssetBase asset = new AssetBase(UUID.Random(), name, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString()); |
1827 | asset.Description = description; | 1827 | asset.Description = description; |
1828 | byte[] a; | ||
1829 | byte[] b; | ||
1830 | byte[] c; | ||
1831 | 1828 | ||
1832 | b = Util.UTF8.GetBytes(data); | 1829 | int textLength = data.Length; |
1830 | data | ||
1831 | = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length " | ||
1832 | + textLength.ToString() + "\n" + data + "}\n"; | ||
1833 | 1833 | ||
1834 | a = Util.UTF8.GetBytes( | 1834 | asset.Data = Util.UTF8.GetBytes(data); |
1835 | "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length" + b.Length.ToString() + "\n"); | ||
1836 | |||
1837 | c = Util.UTF8.GetBytes("}"); | ||
1838 | |||
1839 | byte[] d = new byte[a.Length + b.Length + c.Length]; | ||
1840 | Buffer.BlockCopy(a, 0, d, 0, a.Length); | ||
1841 | Buffer.BlockCopy(b, 0, d, a.Length, b.Length); | ||
1842 | Buffer.BlockCopy(c, 0, d, a.Length + b.Length, c.Length); | ||
1843 | |||
1844 | asset.Data = d; | ||
1845 | World.AssetService.Store(asset); | 1835 | World.AssetService.Store(asset); |
1846 | 1836 | ||
1847 | // Create Task Entry | 1837 | // Create Task Entry |