diff options
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Framework/Scenes/SceneManager.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b67db20..29476b9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -11728,14 +11728,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11728 | return UUID.Zero.ToString(); | 11728 | return UUID.Zero.ToString(); |
11729 | } | 11729 | } |
11730 | 11730 | ||
11731 | string reqIdentifier = UUID.Random().ToString(); | ||
11732 | |||
11731 | // was: UUID tid = tid = AsyncCommands. | 11733 | // was: UUID tid = tid = AsyncCommands. |
11732 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, assetID.ToString()); | 11734 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, reqIdentifier); |
11733 | 11735 | ||
11734 | if (NotecardCache.IsCached(assetID)) | 11736 | if (NotecardCache.IsCached(assetID)) |
11735 | { | 11737 | { |
11736 | AsyncCommands. | 11738 | AsyncCommands.DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(assetID).ToString()); |
11737 | DataserverPlugin.DataserverReply(assetID.ToString(), | 11739 | |
11738 | NotecardCache.GetLines(assetID).ToString()); | ||
11739 | ScriptSleep(100); | 11740 | ScriptSleep(100); |
11740 | return tid.ToString(); | 11741 | return tid.ToString(); |
11741 | } | 11742 | } |
@@ -11751,9 +11752,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11751 | string data = Encoding.UTF8.GetString(a.Data); | 11752 | string data = Encoding.UTF8.GetString(a.Data); |
11752 | //m_log.Debug(data); | 11753 | //m_log.Debug(data); |
11753 | NotecardCache.Cache(id, data); | 11754 | NotecardCache.Cache(id, data); |
11754 | AsyncCommands. | 11755 | AsyncCommands.DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(id).ToString()); |
11755 | DataserverPlugin.DataserverReply(id.ToString(), | ||
11756 | NotecardCache.GetLines(id).ToString()); | ||
11757 | }); | 11756 | }); |
11758 | 11757 | ||
11759 | ScriptSleep(100); | 11758 | ScriptSleep(100); |
@@ -11782,13 +11781,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11782 | return UUID.Zero.ToString(); | 11781 | return UUID.Zero.ToString(); |
11783 | } | 11782 | } |
11784 | 11783 | ||
11784 | string reqIdentifier = UUID.Random().ToString(); | ||
11785 | |||
11785 | // was: UUID tid = tid = AsyncCommands. | 11786 | // was: UUID tid = tid = AsyncCommands. |
11786 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, assetID.ToString()); | 11787 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, reqIdentifier); |
11787 | 11788 | ||
11788 | if (NotecardCache.IsCached(assetID)) | 11789 | if (NotecardCache.IsCached(assetID)) |
11789 | { | 11790 | { |
11790 | AsyncCommands.DataserverPlugin.DataserverReply(assetID.ToString(), | 11791 | AsyncCommands.DataserverPlugin.DataserverReply( |
11791 | NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); | 11792 | reqIdentifier, NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); |
11793 | |||
11792 | ScriptSleep(100); | 11794 | ScriptSleep(100); |
11793 | return tid.ToString(); | 11795 | return tid.ToString(); |
11794 | } | 11796 | } |
@@ -11804,8 +11806,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11804 | string data = Encoding.UTF8.GetString(a.Data); | 11806 | string data = Encoding.UTF8.GetString(a.Data); |
11805 | //m_log.Debug(data); | 11807 | //m_log.Debug(data); |
11806 | NotecardCache.Cache(id, data); | 11808 | NotecardCache.Cache(id, data); |
11807 | AsyncCommands.DataserverPlugin.DataserverReply(id.ToString(), | 11809 | AsyncCommands.DataserverPlugin.DataserverReply( |
11808 | NotecardCache.GetLine(id, line, m_notecardLineReadCharsMax)); | 11810 | reqIdentifier, NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); |
11809 | }); | 11811 | }); |
11810 | 11812 | ||
11811 | ScriptSleep(100); | 11813 | ScriptSleep(100); |
@@ -13287,7 +13289,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
13287 | 13289 | ||
13288 | public static void Cache(UUID assetID, string text) | 13290 | public static void Cache(UUID assetID, string text) |
13289 | { | 13291 | { |
13290 | CacheCheck(); | 13292 | CheckCache(); |
13291 | 13293 | ||
13292 | lock (m_Notecards) | 13294 | lock (m_Notecards) |
13293 | { | 13295 | { |
@@ -13372,14 +13374,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
13372 | return line; | 13374 | return line; |
13373 | } | 13375 | } |
13374 | 13376 | ||
13375 | public static void CacheCheck() | 13377 | public static void CheckCache() |
13376 | { | 13378 | { |
13377 | foreach (UUID key in new List<UUID>(m_Notecards.Keys)) | 13379 | lock (m_Notecards) |
13378 | { | 13380 | { |
13379 | Notecard nc = m_Notecards[key]; | 13381 | foreach (UUID key in new List<UUID>(m_Notecards.Keys)) |
13380 | if (nc.lastRef.AddSeconds(30) < DateTime.Now) | 13382 | { |
13381 | m_Notecards.Remove(key); | 13383 | Notecard nc = m_Notecards[key]; |
13384 | if (nc.lastRef.AddSeconds(30) < DateTime.Now) | ||
13385 | m_Notecards.Remove(key); | ||
13386 | } | ||
13382 | } | 13387 | } |
13383 | } | 13388 | } |
13384 | } | 13389 | } |
13385 | } | 13390 | } \ No newline at end of file |