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
user_profiles
Justin Clark-Casey (justincc) 2013-02-28 21:15:14 +00:00
parent 14684116f8
commit a523ed1e4d
1 changed files with 14 additions and 12 deletions

View File

@ -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);