diff options
author | Melanie Thielker | 2008-09-02 03:43:18 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-02 03:43:18 +0000 |
commit | 61978649ec1642f1c0bf0a3aa6492cebefab85d3 (patch) | |
tree | 9310263acfcce74e72775baa97e094ed97d96195 /OpenSim/Region/ScriptEngine | |
parent | Y top shear accuracy improvements in circular path prim meshes (diff) | |
download | opensim-SC-61978649ec1642f1c0bf0a3aa6492cebefab85d3.zip opensim-SC-61978649ec1642f1c0bf0a3aa6492cebefab85d3.tar.gz opensim-SC-61978649ec1642f1c0bf0a3aa6492cebefab85d3.tar.bz2 opensim-SC-61978649ec1642f1c0bf0a3aa6492cebefab85d3.tar.xz |
Change some chat output functions so that text is truncated at
1000 chars to avoid the exception thrown by libomv at 1100 chars.
Change string->int conversion so it copes with non-numeric chars
after the number and no longer uses a float to parse the value.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 4 |
3 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 8ce1413..6b674f3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -517,9 +517,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
517 | try | 517 | try |
518 | { | 518 | { |
519 | // DISPLAY ERROR INWORLD | 519 | // DISPLAY ERROR INWORLD |
520 | string text = "Runtime error:\n" + e.ToString(); | 520 | string text = "Runtime error:\n" + e.InnerException.ToString(); |
521 | if (text.Length > 1400) | 521 | if (text.Length > 1000) |
522 | text = text.Substring(0, 1400); | 522 | text = text.Substring(0, 1000); |
523 | m_Engine.World.SimChat(Helpers.StringToField(text), | 523 | m_Engine.World.SimChat(Helpers.StringToField(text), |
524 | ChatTypeEnum.DebugChannel, 2147483647, | 524 | ChatTypeEnum.DebugChannel, 2147483647, |
525 | part.AbsolutePosition, | 525 | part.AbsolutePosition, |
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index babb759..23177e5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -1394,8 +1394,15 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1394 | 1394 | ||
1395 | static public explicit operator LSLInteger(string s) | 1395 | static public explicit operator LSLInteger(string s) |
1396 | { | 1396 | { |
1397 | Regex r = new Regex("^[0-9][0-9]*"); | ||
1398 | Match m = r.Match(s); | ||
1399 | string v = m.Groups[0].Value; | ||
1400 | |||
1401 | if (v == String.Empty) | ||
1402 | v = "0"; | ||
1403 | |||
1397 | // double.Parse() used because s could be "123.9" for example. | 1404 | // double.Parse() used because s could be "123.9" for example. |
1398 | return new LSLInteger(double.Parse(s)); | 1405 | return new LSLInteger(int.Parse(v)); |
1399 | } | 1406 | } |
1400 | 1407 | ||
1401 | static public implicit operator LSLInteger(uint u) | 1408 | static public implicit operator LSLInteger(uint u) |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index a33554c..f9f8883 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -432,8 +432,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
432 | { | 432 | { |
433 | // DISPLAY ERROR INWORLD | 433 | // DISPLAY ERROR INWORLD |
434 | string text = "Error compiling script:\r\n" + e.Message.ToString(); | 434 | string text = "Error compiling script:\r\n" + e.Message.ToString(); |
435 | if (text.Length > 1400) | 435 | if (text.Length > 1000) |
436 | text = text.Substring(0, 1400); | 436 | text = text.Substring(0, 1000); |
437 | World.SimChat(Helpers.StringToField(text), | 437 | World.SimChat(Helpers.StringToField(text), |
438 | ChatTypeEnum.DebugChannel, 2147483647, | 438 | ChatTypeEnum.DebugChannel, 2147483647, |
439 | part.AbsolutePosition, | 439 | part.AbsolutePosition, |