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>inv-download
parent
fb48ee1cb6
commit
773df94665
|
@ -1825,13 +1825,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
// Create new asset
|
// Create new asset
|
||||||
AssetBase asset = new AssetBase(UUID.Random(), name, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString());
|
AssetBase asset = new AssetBase(UUID.Random(), name, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString());
|
||||||
asset.Description = description;
|
asset.Description = description;
|
||||||
|
byte[] a;
|
||||||
|
byte[] b;
|
||||||
|
byte[] c;
|
||||||
|
|
||||||
int textLength = data.Length;
|
b = Util.UTF8.GetBytes(data);
|
||||||
data
|
|
||||||
= "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length "
|
|
||||||
+ textLength.ToString() + "\n" + data + "}\n";
|
|
||||||
|
|
||||||
asset.Data = Util.UTF8.GetBytes(data);
|
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;
|
||||||
World.AssetService.Store(asset);
|
World.AssetService.Store(asset);
|
||||||
|
|
||||||
// Create Task Entry
|
// Create Task Entry
|
||||||
|
|
Loading…
Reference in New Issue