mirror of
https://github.com/opensim/opensim.git
synced 2026-05-20 07:05:46 +08:00
Prevent scripts from running under multiple engines at once
This commit is contained in:
@@ -194,12 +194,16 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
|
||||
public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine)
|
||||
{
|
||||
if (script.Length > 15)
|
||||
int lineEnd = script.IndexOf('\n');
|
||||
|
||||
if (lineEnd != 1)
|
||||
{
|
||||
if (script.Substring(0, 15) == "//DotNetEngine:")
|
||||
string firstline = script.Substring(0, lineEnd).Trim();
|
||||
|
||||
int colon = firstline.IndexOf(':');
|
||||
if (firstline.Length > 2 && firstline.Substring(0, 2) == "//" && colon != -1)
|
||||
{
|
||||
script = "//" + script.Substring(15);
|
||||
engine = "DotNetEngine";
|
||||
engine = firstline.Substring(2, colon-2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user