Merge branch 'master' into careminster

Conflicts:
	OpenSim/Framework/Servers/VersionInfo.cs
	OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
This commit is contained in:
Melanie
2012-03-03 09:58:57 +00:00
28 changed files with 275 additions and 322 deletions

View File

@@ -2169,6 +2169,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return result;
}
public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start)
{
CheckThreatLevel(ThreatLevel.High, "osReplaceString");
m_host.AddScriptLPS(1);
// Normalize indices (if negative).
// After normlaization they may still be
// negative, but that is now relative to
// the start, rather than the end, of the
// sequence.
if (start < 0)
{
start = src.Length + start;
}
if (start < 0 || start >= src.Length)
{
return src;
}
// Find matches beginning at start position
Regex matcher = new Regex(pattern);
return matcher.Replace(src,replace,count,start);
}
public string osLoadedCreationDate()
{
CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate");