diff options
author | Freaky Tech | 2015-03-02 21:01:29 +0100 |
---|---|---|
committer | BlueWall | 2015-03-03 16:10:09 -0500 |
commit | b519a5e62ae5ce7d408a8206c06371e1316aa5e8 (patch) | |
tree | 50ccaa3745651e5da7c5152ece3d7eb3ce21dfa0 /OpenSim/Region | |
parent | removed replacement texture in UDP Texture code. The replacement texture intr... (diff) | |
download | opensim-SC_OLD-b519a5e62ae5ce7d408a8206c06371e1316aa5e8.zip opensim-SC_OLD-b519a5e62ae5ce7d408a8206c06371e1316aa5e8.tar.gz opensim-SC_OLD-b519a5e62ae5ce7d408a8206c06371e1316aa5e8.tar.bz2 opensim-SC_OLD-b519a5e62ae5ce7d408a8206c06371e1316aa5e8.tar.xz |
corrected osMakeNotecard(string data) text length was calculated wrong. The Linden text format defines a byte count in that format.
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 10ddf14..d34e9f4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1825,13 +1825,23 @@ 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; | ||
1828 | 1831 | ||
1829 | int textLength = data.Length; | 1832 | b = Util.UTF8.GetBytes(data); |
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 | asset.Data = Util.UTF8.GetBytes(data); | 1834 | a = Util.UTF8.GetBytes( |
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; | ||
1835 | World.AssetService.Store(asset); | 1845 | World.AssetService.Store(asset); |
1836 | 1846 | ||
1837 | // Create Task Entry | 1847 | // Create Task Entry |