Skip to content

Commit

Permalink
Revert "corrected osMakeNotecard(string data) text length was calcula…
Browse files Browse the repository at this point in the history
…ted wrong. The Linden text format defines a byte count in that format."

This reverts commit b519a5e.

The function works ok in-world but tests are failing. will revert for now.
  • Loading branch information
BlueWall committed Mar 3, 2015
1 parent b6b1e11 commit c02636b
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1825,23 +1825,13 @@ protected TaskInventoryItem SaveNotecard(string name, string description, string
// 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
Expand Down

0 comments on commit c02636b

Please sign in to comment.