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

@@ -218,6 +218,43 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
localID, itemID, "on_rez", new DetectParams[0],
new object[] { new LSL_Types.LSLInteger(startParam) });
}
string[] warnings = LSLCompiler.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 > 1100)
text = text.Substring(0, 1099);
World.SimChat(Utils.StringToBytes(text),
ChatTypeEnum.DebugChannel, 2147483647,
m_host.AbsolutePosition, m_host.Name, m_host.UUID,
false);
}
catch (Exception e2) // LEGIT: User Scripting
{
m_log.Error("[" +
m_scriptEngine.ScriptEngineName +
"]: Error displaying warning in-world: " +
e2.ToString());
m_log.Error("[" +
m_scriptEngine.ScriptEngineName + "]: " +
"Warning:\r\n" +
warning);
}
}
}
}
catch (Exception e) // LEGIT: User Scripting
{