Add llGetNotecardLineSync

This commit is contained in:
Sue Cripter
2024-07-04 00:10:29 +02:00
parent c8b13599df
commit 0bf18539b5
4 changed files with 34 additions and 0 deletions

View File

@@ -14985,6 +14985,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return tid.ToString();
}
public LSL_String llGetNotecardLineSync(string name, int line)
{
if (!UUID.TryParse(name, out UUID assetID))
{
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
if (item != null && item.Type == 7)
assetID = item.AssetID;
else
{
Error("llGetNotecardLineSync", "Can't find notecard '" + name + "'");
return ScriptBaseClass.NAK;
}
}
if (NotecardCache.IsCached(assetID))
{
return NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax);
}
else
{
return ScriptBaseClass.NAK;
}
}
public LSL_Key llGetNotecardLine(string name, int line)
{
if (!UUID.TryParse(name, out UUID assetID))

View File

@@ -176,6 +176,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void llGetNextEmail(string address, string subject);
LSL_Key llGetNotecardLine(string name, int line);
LSL_Key llGetNumberOfNotecardLines(string name);
LSL_String llGetNotecardLineSync(string name, int line);
LSL_Integer llGetNumberOfPrims();
LSL_Integer llGetNumberOfSides();
LSL_String llGetObjectDesc();

View File

@@ -609,6 +609,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const string NULL_KEY = "00000000-0000-0000-0000-000000000000";
public const string EOF = "\n\n\n";
public const string NAK = "\n\u0015\n";
public const double PI = 3.14159274f;
public const double TWO_PI = 6.28318548f;
public const double PI_BY_TWO = 1.57079637f;

View File

@@ -758,6 +758,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGetNumberOfNotecardLines(name);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_String llGetNotecardLineSync(string name, int line)
{
return m_LSL_Functions.llGetNotecardLineSync(name, line);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Integer llGetNumberOfPrims()
{