aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
diff options
context:
space:
mode:
authorCharles Krinke2009-02-23 02:43:51 +0000
committerCharles Krinke2009-02-23 02:43:51 +0000
commit08c76989a719803e4cb7c5391bc864046bba31f2 (patch)
treeb62e6288ba9ce024a5020d0f302a059e44ba457e /OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
parentA little bit more tweaking with appearance. Now passing both the wearables an... (diff)
downloadopensim-SC_OLD-08c76989a719803e4cb7c5391bc864046bba31f2.zip
opensim-SC_OLD-08c76989a719803e4cb7c5391bc864046bba31f2.tar.gz
opensim-SC_OLD-08c76989a719803e4cb7c5391bc864046bba31f2.tar.bz2
opensim-SC_OLD-08c76989a719803e4cb7c5391bc864046bba31f2.tar.xz
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.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 4ede7f1..32eb200 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -218,6 +218,43 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
218 localID, itemID, "on_rez", new DetectParams[0], 218 localID, itemID, "on_rez", new DetectParams[0],
219 new object[] { new LSL_Types.LSLInteger(startParam) }); 219 new object[] { new LSL_Types.LSLInteger(startParam) });
220 } 220 }
221
222 string[] warnings = LSLCompiler.GetWarnings();
223
224 if (warnings != null && warnings.Length != 0)
225 {
226 if (presence != null && (!postOnRez))
227 presence.ControllingClient.SendAgentAlertMessage(
228 "Script saved with warnings, check debug window!",
229 false);
230
231 foreach (string warning in warnings)
232 {
233 try
234 {
235 // DISPLAY WARNING INWORLD
236 string text = "Warning:\n" + warning;
237 if (text.Length > 1100)
238 text = text.Substring(0, 1099);
239
240 World.SimChat(Utils.StringToBytes(text),
241 ChatTypeEnum.DebugChannel, 2147483647,
242 m_host.AbsolutePosition, m_host.Name, m_host.UUID,
243 false);
244 }
245 catch (Exception e2) // LEGIT: User Scripting
246 {
247 m_log.Error("[" +
248 m_scriptEngine.ScriptEngineName +
249 "]: Error displaying warning in-world: " +
250 e2.ToString());
251 m_log.Error("[" +
252 m_scriptEngine.ScriptEngineName + "]: " +
253 "Warning:\r\n" +
254 warning);
255 }
256 }
257 }
221 } 258 }
222 catch (Exception e) // LEGIT: User Scripting 259 catch (Exception e) // LEGIT: User Scripting
223 { 260 {