diff options
author | Justin Clark-Casey (justincc) | 2013-02-28 21:15:14 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-02-28 21:15:14 +0000 |
commit | a523ed1e4d4c8e9c4366fddaaf6a67fe35a9859f (patch) | |
tree | 4fabcf0557f142cc38b8f9570b22498954a4a2d4 | |
parent | Add regression tests for llGetNotecardLine() (diff) | |
download | opensim-SC-a523ed1e4d4c8e9c4366fddaaf6a67fe35a9859f.zip opensim-SC-a523ed1e4d4c8e9c4366fddaaf6a67fe35a9859f.tar.gz opensim-SC-a523ed1e4d4c8e9c4366fddaaf6a67fe35a9859f.tar.bz2 opensim-SC-a523ed1e4d4c8e9c4366fddaaf6a67fe35a9859f.tar.xz |
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
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6a31568..ec24dc2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -10806,14 +10806,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10806 | return UUID.Zero.ToString(); | 10806 | return UUID.Zero.ToString(); |
10807 | } | 10807 | } |
10808 | 10808 | ||
10809 | string reqIdentifier = UUID.Random().ToString(); | ||
10810 | |||
10809 | // was: UUID tid = tid = AsyncCommands. | 10811 | // was: UUID tid = tid = AsyncCommands. |
10810 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, assetID.ToString()); | 10812 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, reqIdentifier); |
10811 | 10813 | ||
10812 | if (NotecardCache.IsCached(assetID)) | 10814 | if (NotecardCache.IsCached(assetID)) |
10813 | { | 10815 | { |
10814 | AsyncCommands. | 10816 | AsyncCommands.DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(assetID).ToString()); |
10815 | DataserverPlugin.DataserverReply(assetID.ToString(), | 10817 | |
10816 | NotecardCache.GetLines(assetID).ToString()); | ||
10817 | ScriptSleep(100); | 10818 | ScriptSleep(100); |
10818 | return tid.ToString(); | 10819 | return tid.ToString(); |
10819 | } | 10820 | } |
@@ -10829,9 +10830,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10829 | string data = Encoding.UTF8.GetString(a.Data); | 10830 | string data = Encoding.UTF8.GetString(a.Data); |
10830 | //m_log.Debug(data); | 10831 | //m_log.Debug(data); |
10831 | NotecardCache.Cache(id, data); | 10832 | NotecardCache.Cache(id, data); |
10832 | AsyncCommands. | 10833 | AsyncCommands.DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(id).ToString()); |
10833 | DataserverPlugin.DataserverReply(id.ToString(), | ||
10834 | NotecardCache.GetLines(id).ToString()); | ||
10835 | }); | 10834 | }); |
10836 | 10835 | ||
10837 | ScriptSleep(100); | 10836 | ScriptSleep(100); |
@@ -10860,13 +10859,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10860 | return UUID.Zero.ToString(); | 10859 | return UUID.Zero.ToString(); |
10861 | } | 10860 | } |
10862 | 10861 | ||
10862 | string reqIdentifier = UUID.Random().ToString(); | ||
10863 | |||
10863 | // was: UUID tid = tid = AsyncCommands. | 10864 | // was: UUID tid = tid = AsyncCommands. |
10864 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, assetID.ToString()); | 10865 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, reqIdentifier); |
10865 | 10866 | ||
10866 | if (NotecardCache.IsCached(assetID)) | 10867 | if (NotecardCache.IsCached(assetID)) |
10867 | { | 10868 | { |
10868 | AsyncCommands.DataserverPlugin.DataserverReply(assetID.ToString(), | 10869 | AsyncCommands.DataserverPlugin.DataserverReply( |
10869 | NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); | 10870 | reqIdentifier, NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); |
10871 | |||
10870 | ScriptSleep(100); | 10872 | ScriptSleep(100); |
10871 | return tid.ToString(); | 10873 | return tid.ToString(); |
10872 | } | 10874 | } |
@@ -10882,8 +10884,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10882 | string data = Encoding.UTF8.GetString(a.Data); | 10884 | string data = Encoding.UTF8.GetString(a.Data); |
10883 | //m_log.Debug(data); | 10885 | //m_log.Debug(data); |
10884 | NotecardCache.Cache(id, data); | 10886 | NotecardCache.Cache(id, data); |
10885 | AsyncCommands.DataserverPlugin.DataserverReply(id.ToString(), | 10887 | AsyncCommands.DataserverPlugin.DataserverReply( |
10886 | NotecardCache.GetLine(id, line, m_notecardLineReadCharsMax)); | 10888 | reqIdentifier, NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); |
10887 | }); | 10889 | }); |
10888 | 10890 | ||
10889 | ScriptSleep(100); | 10891 | ScriptSleep(100); |