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.
prioritization
Melanie 2009-10-17 22:36:44 +01:00
parent 4302329bfa
commit 66923983a7
2 changed files with 38 additions and 20 deletions

View File

@ -353,15 +353,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
// m_log.ErrorFormat("[Script] Unable to load script state from xml: {0}\n"+e.ToString(), xml); // m_log.ErrorFormat("[Script] Unable to load script state from xml: {0}\n"+e.ToString(), xml);
} }
} }
else // else
{ // {
ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID); // ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID);
if (presence != null && (!postOnRez)) // if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Compile successful", false); // presence.ControllingClient.SendAgentAlertMessage("Compile successful", false);
// // m_log.ErrorFormat("[Script] Unable to load script state, file not found"); // }
}
} }
public void Init() public void Init()

View File

@ -604,9 +604,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (warnings != null && warnings.Length != 0) 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) foreach (string warning in warnings)
{ {
try try
@ -615,11 +612,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string text = "Warning:\n" + warning; string text = "Warning:\n" + warning;
if (text.Length > 1000) if (text.Length > 1000)
text = text.Substring(0, 1000); text = text.Substring(0, 1000);
if (!ShowScriptSaveResponse(item.OwnerID,
assetID, text, true))
{
if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false);
World.SimChat(Utils.StringToBytes(text), World.SimChat(Utils.StringToBytes(text),
ChatTypeEnum.DebugChannel, 2147483647, ChatTypeEnum.DebugChannel, 2147483647,
part.AbsolutePosition, part.AbsolutePosition,
part.Name, part.UUID, false); part.Name, part.UUID, false);
} }
}
catch (Exception e2) // LEGIT: User Scripting catch (Exception e2) // LEGIT: User Scripting
{ {
m_log.Error("[XEngine]: " + m_log.Error("[XEngine]: " +
@ -634,8 +638,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
catch (Exception e) catch (Exception e)
{ {
if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false);
try try
{ {
// DISPLAY ERROR INWORLD // DISPLAY ERROR INWORLD
@ -645,11 +647,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString(); string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString();
if (text.Length > 1000) if (text.Length > 1000)
text = text.Substring(0, 1000); text = text.Substring(0, 1000);
if (!ShowScriptSaveResponse(item.OwnerID,
assetID, text, false))
{
if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false);
World.SimChat(Utils.StringToBytes(text), World.SimChat(Utils.StringToBytes(text),
ChatTypeEnum.DebugChannel, 2147483647, ChatTypeEnum.DebugChannel, 2147483647,
part.AbsolutePosition, part.AbsolutePosition,
part.Name, part.UUID, false); part.Name, part.UUID, false);
} }
}
catch (Exception e2) // LEGIT: User Scripting catch (Exception e2) // LEGIT: User Scripting
{ {
m_log.Error("[XEngine]: "+ m_log.Error("[XEngine]: "+
@ -732,6 +740,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}",
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString());
if (presence != null)
{
ShowScriptSaveResponse(item.OwnerID,
assetID, "Compile successful", true);
}
instance.AppDomain = appDomain; instance.AppDomain = appDomain;
instance.LineMap = linemap; instance.LineMap = linemap;
@ -1250,5 +1264,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return instance.CanBeDeleted(); return instance.CanBeDeleted();
} }
private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled)
{
return false;
}
} }
} }