diff options
author | Melanie | 2009-10-17 22:36:44 +0100 |
---|---|---|
committer | Melanie | 2009-10-17 22:36:44 +0100 |
commit | 66923983a7e5214843e59ae40f3c4ad7587feed8 (patch) | |
tree | 645495545d8cd4f0aa79115e1046f552a4aa8cfd | |
parent | Change the example to match the facts (diff) | |
download | opensim-SC-66923983a7e5214843e59ae40f3c4ad7587feed8.zip opensim-SC-66923983a7e5214843e59ae40f3c4ad7587feed8.tar.gz opensim-SC-66923983a7e5214843e59ae40f3c4ad7587feed8.tar.bz2 opensim-SC-66923983a7e5214843e59ae40f3c4ad7587feed8.tar.xz |
Add support for display of the script compilation errors in the script editor's
debug pane. This will still use DEBUG_CHANNEL currently, since it is not
fully implemented. This also removes the "Compiled successfully" message
that pops up in the viewer.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 45 |
2 files changed, 38 insertions, 20 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 97166cf..2b858ec 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -353,15 +353,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
353 | // m_log.ErrorFormat("[Script] Unable to load script state from xml: {0}\n"+e.ToString(), xml); | 353 | // m_log.ErrorFormat("[Script] Unable to load script state from xml: {0}\n"+e.ToString(), xml); |
354 | } | 354 | } |
355 | } | 355 | } |
356 | else | 356 | // else |
357 | { | 357 | // { |
358 | ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID); | 358 | // ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID); |
359 | 359 | ||
360 | if (presence != null && (!postOnRez)) | 360 | // if (presence != null && (!postOnRez)) |
361 | presence.ControllingClient.SendAgentAlertMessage("Compile successful", false); | 361 | // presence.ControllingClient.SendAgentAlertMessage("Compile successful", false); |
362 | 362 | ||
363 | // // m_log.ErrorFormat("[Script] Unable to load script state, file not found"); | 363 | // } |
364 | } | ||
365 | } | 364 | } |
366 | 365 | ||
367 | public void Init() | 366 | public void Init() |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 847da8c..7b19ce3 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -604,9 +604,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
604 | 604 | ||
605 | if (warnings != null && warnings.Length != 0) | 605 | if (warnings != null && warnings.Length != 0) |
606 | { | 606 | { |
607 | if (presence != null && (!postOnRez)) | ||
608 | presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false); | ||
609 | |||
610 | foreach (string warning in warnings) | 607 | foreach (string warning in warnings) |
611 | { | 608 | { |
612 | try | 609 | try |
@@ -615,10 +612,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
615 | string text = "Warning:\n" + warning; | 612 | string text = "Warning:\n" + warning; |
616 | if (text.Length > 1000) | 613 | if (text.Length > 1000) |
617 | text = text.Substring(0, 1000); | 614 | text = text.Substring(0, 1000); |
618 | World.SimChat(Utils.StringToBytes(text), | 615 | if (!ShowScriptSaveResponse(item.OwnerID, |
619 | ChatTypeEnum.DebugChannel, 2147483647, | 616 | assetID, text, true)) |
620 | part.AbsolutePosition, | 617 | { |
621 | part.Name, part.UUID, false); | 618 | if (presence != null && (!postOnRez)) |
619 | presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false); | ||
620 | |||
621 | World.SimChat(Utils.StringToBytes(text), | ||
622 | ChatTypeEnum.DebugChannel, 2147483647, | ||
623 | part.AbsolutePosition, | ||
624 | part.Name, part.UUID, false); | ||
625 | } | ||
622 | } | 626 | } |
623 | catch (Exception e2) // LEGIT: User Scripting | 627 | catch (Exception e2) // LEGIT: User Scripting |
624 | { | 628 | { |
@@ -634,8 +638,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
634 | } | 638 | } |
635 | catch (Exception e) | 639 | catch (Exception e) |
636 | { | 640 | { |
637 | if (presence != null && (!postOnRez)) | ||
638 | presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false); | ||
639 | try | 641 | try |
640 | { | 642 | { |
641 | // DISPLAY ERROR INWORLD | 643 | // DISPLAY ERROR INWORLD |
@@ -645,10 +647,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
645 | string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString(); | 647 | string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString(); |
646 | if (text.Length > 1000) | 648 | if (text.Length > 1000) |
647 | text = text.Substring(0, 1000); | 649 | text = text.Substring(0, 1000); |
648 | World.SimChat(Utils.StringToBytes(text), | 650 | if (!ShowScriptSaveResponse(item.OwnerID, |
649 | ChatTypeEnum.DebugChannel, 2147483647, | 651 | assetID, text, false)) |
650 | part.AbsolutePosition, | 652 | { |
651 | part.Name, part.UUID, false); | 653 | if (presence != null && (!postOnRez)) |
654 | presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false); | ||
655 | World.SimChat(Utils.StringToBytes(text), | ||
656 | ChatTypeEnum.DebugChannel, 2147483647, | ||
657 | part.AbsolutePosition, | ||
658 | part.Name, part.UUID, false); | ||
659 | } | ||
652 | } | 660 | } |
653 | catch (Exception e2) // LEGIT: User Scripting | 661 | catch (Exception e2) // LEGIT: User Scripting |
654 | { | 662 | { |
@@ -732,6 +740,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
732 | m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", | 740 | m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", |
733 | part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); | 741 | part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); |
734 | 742 | ||
743 | if (presence != null) | ||
744 | { | ||
745 | ShowScriptSaveResponse(item.OwnerID, | ||
746 | assetID, "Compile successful", true); | ||
747 | } | ||
748 | |||
735 | instance.AppDomain = appDomain; | 749 | instance.AppDomain = appDomain; |
736 | instance.LineMap = linemap; | 750 | instance.LineMap = linemap; |
737 | 751 | ||
@@ -1250,5 +1264,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1250 | 1264 | ||
1251 | return instance.CanBeDeleted(); | 1265 | return instance.CanBeDeleted(); |
1252 | } | 1266 | } |
1267 | |||
1268 | private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled) | ||
1269 | { | ||
1270 | return false; | ||
1271 | } | ||
1253 | } | 1272 | } |
1254 | } | 1273 | } |