mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 22:05:36 +08:00
Fix bug where simultaneous calls by different scripts to llGetNotecardLine() or llGetNumberOfNotecardLines() would sometimes not trigger a dataserver event.
This was because the notecard asset ID was being used as the request identifier. Now using a random ID, in common with other code using the DataServer
This commit is contained in:
@@ -10806,14 +10806,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
|
||||
string reqIdentifier = UUID.Random().ToString();
|
||||
|
||||
// was: UUID tid = tid = AsyncCommands.
|
||||
UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, assetID.ToString());
|
||||
UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, reqIdentifier);
|
||||
|
||||
if (NotecardCache.IsCached(assetID))
|
||||
{
|
||||
AsyncCommands.
|
||||
DataserverPlugin.DataserverReply(assetID.ToString(),
|
||||
NotecardCache.GetLines(assetID).ToString());
|
||||
AsyncCommands.DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(assetID).ToString());
|
||||
|
||||
ScriptSleep(100);
|
||||
return tid.ToString();
|
||||
}
|
||||
@@ -10829,9 +10830,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
string data = Encoding.UTF8.GetString(a.Data);
|
||||
//m_log.Debug(data);
|
||||
NotecardCache.Cache(id, data);
|
||||
AsyncCommands.
|
||||
DataserverPlugin.DataserverReply(id.ToString(),
|
||||
NotecardCache.GetLines(id).ToString());
|
||||
AsyncCommands.DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(id).ToString());
|
||||
});
|
||||
|
||||
ScriptSleep(100);
|
||||
@@ -10860,13 +10859,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
|
||||
string reqIdentifier = UUID.Random().ToString();
|
||||
|
||||
// was: UUID tid = tid = AsyncCommands.
|
||||
UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, assetID.ToString());
|
||||
UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, reqIdentifier);
|
||||
|
||||
if (NotecardCache.IsCached(assetID))
|
||||
{
|
||||
AsyncCommands.DataserverPlugin.DataserverReply(assetID.ToString(),
|
||||
NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax));
|
||||
AsyncCommands.DataserverPlugin.DataserverReply(
|
||||
reqIdentifier, NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax));
|
||||
|
||||
ScriptSleep(100);
|
||||
return tid.ToString();
|
||||
}
|
||||
@@ -10882,8 +10884,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
string data = Encoding.UTF8.GetString(a.Data);
|
||||
//m_log.Debug(data);
|
||||
NotecardCache.Cache(id, data);
|
||||
AsyncCommands.DataserverPlugin.DataserverReply(id.ToString(),
|
||||
NotecardCache.GetLine(id, line, m_notecardLineReadCharsMax));
|
||||
AsyncCommands.DataserverPlugin.DataserverReply(
|
||||
reqIdentifier, NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax));
|
||||
});
|
||||
|
||||
ScriptSleep(100);
|
||||
|
||||
Reference in New Issue
Block a user