diff options
author | BlueWall | 2013-03-05 15:30:54 -0500 |
---|---|---|
committer | BlueWall | 2013-03-05 15:30:54 -0500 |
commit | f676408e2a45101bcab0a33f598ea9047f02036a (patch) | |
tree | eb34ea8fb0a783ee466873462285eba629ab6405 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Add method to remove JsonRpc Handlers from the server (diff) | |
parent | * Add a Max Payload size property to the Websocket Server Handler. If you ... (diff) | |
download | opensim-SC-f676408e2a45101bcab0a33f598ea9047f02036a.zip opensim-SC-f676408e2a45101bcab0a33f598ea9047f02036a.tar.gz opensim-SC-f676408e2a45101bcab0a33f598ea9047f02036a.tar.bz2 opensim-SC-f676408e2a45101bcab0a33f598ea9047f02036a.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-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 6a31568..ab087af 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); |
@@ -11687,7 +11689,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11687 | 11689 | ||
11688 | public static void Cache(UUID assetID, string text) | 11690 | public static void Cache(UUID assetID, string text) |
11689 | { | 11691 | { |
11690 | CacheCheck(); | 11692 | CheckCache(); |
11691 | 11693 | ||
11692 | lock (m_Notecards) | 11694 | lock (m_Notecards) |
11693 | { | 11695 | { |
@@ -11772,14 +11774,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11772 | return line; | 11774 | return line; |
11773 | } | 11775 | } |
11774 | 11776 | ||
11775 | public static void CacheCheck() | 11777 | public static void CheckCache() |
11776 | { | 11778 | { |
11777 | foreach (UUID key in new List<UUID>(m_Notecards.Keys)) | 11779 | lock (m_Notecards) |
11778 | { | 11780 | { |
11779 | Notecard nc = m_Notecards[key]; | 11781 | foreach (UUID key in new List<UUID>(m_Notecards.Keys)) |
11780 | if (nc.lastRef.AddSeconds(30) < DateTime.Now) | 11782 | { |
11781 | m_Notecards.Remove(key); | 11783 | Notecard nc = m_Notecards[key]; |
11784 | if (nc.lastRef.AddSeconds(30) < DateTime.Now) | ||
11785 | m_Notecards.Remove(key); | ||
11786 | } | ||
11782 | } | 11787 | } |
11783 | } | 11788 | } |
11784 | } | 11789 | } |
11785 | } | 11790 | } \ No newline at end of file |