diff options
author | BlueWall | 2012-03-02 15:02:09 -0500 |
---|---|---|
committer | BlueWall | 2012-03-02 15:02:09 -0500 |
commit | 6fc350725da5132eefe14897644d672ce586c5db (patch) | |
tree | d73af5d1d9bc61143fbac24a4dd54256a1394c97 /OpenSim/Region/ScriptEngine | |
parent | Merge branch 'master' of /home/opensim/src/opensim into v3_support (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-6fc350725da5132eefe14897644d672ce586c5db.zip opensim-SC_OLD-6fc350725da5132eefe14897644d672ce586c5db.tar.gz opensim-SC_OLD-6fc350725da5132eefe14897644d672ce586c5db.tar.bz2 opensim-SC_OLD-6fc350725da5132eefe14897644d672ce586c5db.tar.xz |
Merge branch 'master' into v3_support
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
5 files changed, 40 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c5392b5..0003515 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4039,7 +4039,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4039 | Vector3 av3 = new Vector3(Util.Clip((float)color.x, 0.0f, 1.0f), | 4039 | Vector3 av3 = new Vector3(Util.Clip((float)color.x, 0.0f, 1.0f), |
4040 | Util.Clip((float)color.y, 0.0f, 1.0f), | 4040 | Util.Clip((float)color.y, 0.0f, 1.0f), |
4041 | Util.Clip((float)color.z, 0.0f, 1.0f)); | 4041 | Util.Clip((float)color.z, 0.0f, 1.0f)); |
4042 | m_host.SetText(text.Length > 254 ? text.Remove(255) : text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); | 4042 | m_host.SetText(text.Length > 254 ? text.Remove(254) : text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); |
4043 | //m_host.ParentGroup.HasGroupChanged = true; | 4043 | //m_host.ParentGroup.HasGroupChanged = true; |
4044 | //m_host.ParentGroup.ScheduleGroupForFullUpdate(); | 4044 | //m_host.ParentGroup.ScheduleGroupForFullUpdate(); |
4045 | } | 4045 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index ff1f5fd..8edd146 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2160,6 +2160,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2160 | return result; | 2160 | return result; |
2161 | } | 2161 | } |
2162 | 2162 | ||
2163 | public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start) | ||
2164 | { | ||
2165 | CheckThreatLevel(ThreatLevel.High, "osReplaceString"); | ||
2166 | m_host.AddScriptLPS(1); | ||
2167 | |||
2168 | // Normalize indices (if negative). | ||
2169 | // After normlaization they may still be | ||
2170 | // negative, but that is now relative to | ||
2171 | // the start, rather than the end, of the | ||
2172 | // sequence. | ||
2173 | if (start < 0) | ||
2174 | { | ||
2175 | start = src.Length + start; | ||
2176 | } | ||
2177 | |||
2178 | if (start < 0 || start >= src.Length) | ||
2179 | { | ||
2180 | return src; | ||
2181 | } | ||
2182 | |||
2183 | // Find matches beginning at start position | ||
2184 | Regex matcher = new Regex(pattern); | ||
2185 | return matcher.Replace(src,replace,count,start); | ||
2186 | } | ||
2187 | |||
2163 | public string osLoadedCreationDate() | 2188 | public string osLoadedCreationDate() |
2164 | { | 2189 | { |
2165 | CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate"); | 2190 | CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate"); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 5c1bdff..fbb7c39 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -157,12 +157,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
157 | 157 | ||
158 | public void CheckSenseRepeaterEvents() | 158 | public void CheckSenseRepeaterEvents() |
159 | { | 159 | { |
160 | // Nothing to do here? | ||
161 | if (SenseRepeaters.Count == 0) | ||
162 | return; | ||
163 | |||
164 | lock (SenseRepeatListLock) | 160 | lock (SenseRepeatListLock) |
165 | { | 161 | { |
162 | // Nothing to do here? | ||
163 | if (SenseRepeaters.Count == 0) | ||
164 | return; | ||
165 | |||
166 | // Go through all timers | 166 | // Go through all timers |
167 | foreach (SenseRepeatClass ts in SenseRepeaters) | 167 | foreach (SenseRepeatClass ts in SenseRepeaters) |
168 | { | 168 | { |
@@ -635,7 +635,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
635 | ts.next = | 635 | ts.next = |
636 | DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); | 636 | DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); |
637 | 637 | ||
638 | SenseRepeaters.Add(ts); | 638 | lock (SenseRepeatListLock) |
639 | SenseRepeaters.Add(ts); | ||
640 | |||
639 | idx += 6; | 641 | idx += 6; |
640 | } | 642 | } |
641 | } | 643 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index dbc1dfc..82a6caf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -165,6 +165,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
165 | 165 | ||
166 | LSL_String osFormatString(string str, LSL_List strings); | 166 | LSL_String osFormatString(string str, LSL_List strings); |
167 | LSL_List osMatchString(string src, string pattern, int start); | 167 | LSL_List osMatchString(string src, string pattern, int start); |
168 | LSL_String osReplaceString(string src, string pattern, string replace, int count, int start); | ||
168 | 169 | ||
169 | // Information about data loaded into the region | 170 | // Information about data loaded into the region |
170 | string osLoadedCreationDate(); | 171 | string osLoadedCreationDate(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index cc8d417..4341246 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -472,6 +472,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
472 | return m_OSSL_Functions.osMatchString(src, pattern, start); | 472 | return m_OSSL_Functions.osMatchString(src, pattern, start); |
473 | } | 473 | } |
474 | 474 | ||
475 | public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start) | ||
476 | { | ||
477 | return m_OSSL_Functions.osReplaceString(src,pattern,replace,count,start); | ||
478 | } | ||
479 | |||
480 | |||
475 | // Information about data loaded into the region | 481 | // Information about data loaded into the region |
476 | public string osLoadedCreationDate() | 482 | public string osLoadedCreationDate() |
477 | { | 483 | { |