Mantis#3187. Thank you kindly, DoranZemlja for a patch that:

Adds a warning for an LSL construct that exploits a
popular list memory saving hack.
This commit is contained in:
Charles Krinke
2009-02-23 02:43:51 +00:00
parent 20eb8e54ac
commit 08c76989a7
6 changed files with 169 additions and 0 deletions

View File

@@ -516,6 +516,38 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_AddingAssemblies[assembly]++;
}
}
string[] warnings = m_Compiler.GetWarnings();
if (warnings != null && warnings.Length != 0)
{
if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false);
foreach (string warning in warnings)
{
try
{
// DISPLAY WARNING INWORLD
string text = "Warning:\n" + warning;
if (text.Length > 1000)
text = text.Substring(0, 1000);
World.SimChat(Utils.StringToBytes(text),
ChatTypeEnum.DebugChannel, 2147483647,
part.AbsolutePosition,
part.Name, part.UUID, false);
}
catch (Exception e2) // LEGIT: User Scripting
{
m_log.Error("[XEngine]: " +
"Error displaying warning in-world: " +
e2.ToString());
m_log.Error("[XEngine]: " +
"Warning:\r\n" +
warning);
}
}
}
}
catch (Exception e)
{