aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorFreaky Tech2015-03-02 21:01:29 +0100
committerBlueWall2015-03-03 19:06:52 -0500
commit773df94665aaf5cd2d4a77f820bcbc6306551d0a (patch)
treeb0cbddc0f96d5d6a817b63c490577aa6e487ac2c
parentcorrected script notecard parser. It now handles notecards with inventory as ... (diff)
downloadopensim-SC_OLD-773df94665aaf5cd2d4a77f820bcbc6306551d0a.zip
opensim-SC_OLD-773df94665aaf5cd2d4a77f820bcbc6306551d0a.tar.gz
opensim-SC_OLD-773df94665aaf5cd2d4a77f820bcbc6306551d0a.tar.bz2
opensim-SC_OLD-773df94665aaf5cd2d4a77f820bcbc6306551d0a.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>
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs20
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 3afebe2..a757da1 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