parent
2578db3dfa
commit
d285ccb5cf
|
@ -9172,23 +9172,50 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
||||
|
||||
UUID assetID = UUID.Zero;
|
||||
|
||||
if (!UUID.TryParse(name, out assetID))
|
||||
{
|
||||
foreach (TaskInventoryItem item in itemsDictionary.Values)
|
||||
{
|
||||
if (item.Type == 7 && item.Name == name)
|
||||
{
|
||||
UUID tid = AsyncCommands.
|
||||
DataserverPlugin.RegisterRequest(m_localID,
|
||||
m_itemID, item.AssetID.ToString());
|
||||
if (NotecardCache.IsCached(item.AssetID))
|
||||
assetID = item.AssetID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (assetID == UUID.Zero)
|
||||
{
|
||||
// => complain loudly, as specified by the LSL docs
|
||||
ShoutError("Notecard '" + name + "' could not be found.");
|
||||
}
|
||||
|
||||
UUID tid = UUID.Zero;
|
||||
|
||||
if (NotecardCache.IsCached(assetID))
|
||||
{
|
||||
tid = AsyncCommands.
|
||||
DataserverPlugin.RegisterRequest(m_localID,
|
||||
m_itemID, assetID.ToString());
|
||||
|
||||
AsyncCommands.
|
||||
DataserverPlugin.DataserverReply(item.AssetID.ToString(),
|
||||
NotecardCache.GetLines(item.AssetID).ToString());
|
||||
DataserverPlugin.DataserverReply(assetID.ToString(),
|
||||
NotecardCache.GetLines(assetID).ToString());
|
||||
// ScriptSleep(100);
|
||||
return tid.ToString();
|
||||
}
|
||||
WithNotecard(item.AssetID, delegate (UUID id, AssetBase a)
|
||||
|
||||
WithNotecard(assetID, delegate (UUID id, AssetBase a)
|
||||
{
|
||||
if (a.Type != 7)
|
||||
return;
|
||||
|
||||
tid = AsyncCommands.
|
||||
DataserverPlugin.RegisterRequest(m_localID,
|
||||
m_itemID, assetID.ToString());
|
||||
|
||||
System.Text.ASCIIEncoding enc =
|
||||
new System.Text.ASCIIEncoding();
|
||||
string data = enc.GetString(a.Data);
|
||||
|
@ -9198,10 +9225,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
DataserverPlugin.DataserverReply(id.ToString(),
|
||||
NotecardCache.GetLines(id).ToString());
|
||||
});
|
||||
|
||||
if (tid != UUID.Zero)
|
||||
{
|
||||
// ScriptSleep(100);
|
||||
return tid.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// if we got to here, we didn't find the notecard the script was asking for
|
||||
// => complain loudly, as specified by the LSL docs
|
||||
ShoutError("Notecard '" + name + "' could not be found.");
|
||||
|
@ -9216,25 +9246,50 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
||||
|
||||
UUID assetID = UUID.Zero;
|
||||
|
||||
if (!UUID.TryParse(name, out assetID))
|
||||
{
|
||||
foreach (TaskInventoryItem item in itemsDictionary.Values)
|
||||
{
|
||||
if (item.Type == 7 && item.Name == name)
|
||||
{
|
||||
UUID tid = AsyncCommands.
|
||||
DataserverPlugin.RegisterRequest(m_localID,
|
||||
m_itemID, item.AssetID.ToString());
|
||||
assetID = item.AssetID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (NotecardCache.IsCached(item.AssetID))
|
||||
if (assetID == UUID.Zero)
|
||||
{
|
||||
// => complain loudly, as specified by the LSL docs
|
||||
ShoutError("Notecard '" + name + "' could not be found.");
|
||||
}
|
||||
|
||||
UUID tid = UUID.Zero;
|
||||
|
||||
if (NotecardCache.IsCached(assetID))
|
||||
{
|
||||
tid = AsyncCommands.
|
||||
DataserverPlugin.RegisterRequest(m_localID,
|
||||
m_itemID, assetID.ToString());
|
||||
|
||||
AsyncCommands.
|
||||
DataserverPlugin.DataserverReply(item.AssetID.ToString(),
|
||||
NotecardCache.GetLine(item.AssetID, line, m_notecardLineReadCharsMax));
|
||||
DataserverPlugin.DataserverReply(assetID.ToString(),
|
||||
NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax));
|
||||
// ScriptSleep(100);
|
||||
return tid.ToString();
|
||||
}
|
||||
|
||||
WithNotecard(item.AssetID, delegate (UUID id, AssetBase a)
|
||||
WithNotecard(assetID, delegate (UUID id, AssetBase a)
|
||||
{
|
||||
if (a.Type != 7)
|
||||
return;
|
||||
|
||||
tid = AsyncCommands.
|
||||
DataserverPlugin.RegisterRequest(m_localID,
|
||||
m_itemID, assetID.ToString());
|
||||
|
||||
System.Text.ASCIIEncoding enc =
|
||||
new System.Text.ASCIIEncoding();
|
||||
string data = enc.GetString(a.Data);
|
||||
|
@ -9245,10 +9300,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
NotecardCache.GetLine(id, line, m_notecardLineReadCharsMax));
|
||||
});
|
||||
|
||||
if (tid != UUID.Zero)
|
||||
{
|
||||
// ScriptSleep(100);
|
||||
return tid.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// if we got to here, we didn't find the notecard the script was asking for
|
||||
// => complain loudly, as specified by the LSL docs
|
||||
|
|
Loading…
Reference in New Issue