Prevent scripts from running under multiple engines at once
parent
1602ba6175
commit
79ac01fb0c
|
@ -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)
|
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 = firstline.Substring(2, colon-2);
|
||||||
engine = "DotNetEngine";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -341,12 +341,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
|
|
||||||
public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine)
|
public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine)
|
||||||
{
|
{
|
||||||
if (script.Length > 10)
|
int lineEnd = script.IndexOf('\n');
|
||||||
|
|
||||||
|
if (lineEnd != 1)
|
||||||
{
|
{
|
||||||
if (script.Substring(0, 10) == "//XEngine:")
|
string firstline = script.Substring(0, lineEnd).Trim();
|
||||||
|
|
||||||
|
int colon = firstline.IndexOf(':');
|
||||||
|
if (firstline.Length > 2 && firstline.Substring(0, 2) == "//" && colon != -1)
|
||||||
{
|
{
|
||||||
script = "//" + script.Substring(10);
|
engine = firstline.Substring(2, colon-2);
|
||||||
engine = "XEngine";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue