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);
}
}
else
{
ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID);
// else
// {
// ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID);
if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Compile successful", false);
// if (presence != null && (!postOnRez))
// presence.ControllingClient.SendAgentAlertMessage("Compile successful", false);
// // m_log.ErrorFormat("[Script] Unable to load script state, file not found");
}
// }
}
public void Init()

View File

@ -604,9 +604,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
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
@ -615,11 +612,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string text = "Warning:\n" + warning;
if (text.Length > 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),
ChatTypeEnum.DebugChannel, 2147483647,
part.AbsolutePosition,
part.Name, part.UUID, false);
}
}
catch (Exception e2) // LEGIT: User Scripting
{
m_log.Error("[XEngine]: " +
@ -634,8 +638,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
catch (Exception e)
{
if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false);
try
{
// DISPLAY ERROR INWORLD
@ -645,11 +647,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString();
if (text.Length > 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),
ChatTypeEnum.DebugChannel, 2147483647,
part.AbsolutePosition,
part.Name, part.UUID, false);
}
}
catch (Exception e2) // LEGIT: User Scripting
{
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}",
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.LineMap = linemap;
@ -1250,5 +1264,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return instance.CanBeDeleted();
}
private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled)
{
return false;
}
}
}