track originating IScriptApi method for SL-like error messages. Will add rule number tracking in next commit.

integration
SignpostMarv 2012-08-28 03:21:04 +01:00 committed by Justin Clark-Casey (justincc)
parent 7ea832d47c
commit 3bf7bd6359
3 changed files with 17 additions and 13 deletions

View File

@ -7208,7 +7208,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
setLinkPrimParams(ScriptBaseClass.LINK_THIS, rules); setLinkPrimParams(ScriptBaseClass.LINK_THIS, rules, "llSetPrimitiveParams");
ScriptSleep(200); ScriptSleep(200);
} }
@ -7217,7 +7217,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
setLinkPrimParams(linknumber, rules); setLinkPrimParams(linknumber, rules, "llSetLinkPrimitiveParams");
ScriptSleep(200); ScriptSleep(200);
} }
@ -7226,17 +7226,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
setLinkPrimParams(linknumber, rules); setLinkPrimParams(linknumber, rules, "llSetLinkPrimitiveParamsFast");
} }
protected void setLinkPrimParams(int linknumber, LSL_List rules) protected void setLinkPrimParams(int linknumber, LSL_List rules, string originFunc)
{ {
List<SceneObjectPart> parts = GetLinkParts(linknumber); List<SceneObjectPart> parts = GetLinkParts(linknumber);
LSL_List remaining = null; LSL_List remaining = null;
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
remaining = SetPrimParams(part, rules); remaining = SetPrimParams(part, rules, originFunc);
while (remaining != null && remaining.Length > 2) while (remaining != null && remaining.Length > 2)
{ {
@ -7245,13 +7245,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
parts = GetLinkParts(linknumber); parts = GetLinkParts(linknumber);
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
remaining = SetPrimParams(part, rules); remaining = SetPrimParams(part, rules, originFunc);
} }
} }
protected LSL_List SetPrimParams(SceneObjectPart part, LSL_List rules) protected LSL_List SetPrimParams(SceneObjectPart part, LSL_List rules, string originFunc)
{ {
int idx = 0; int idx = 0;
int idxStart = 0;
bool positionChanged = false; bool positionChanged = false;
LSL_Vector currentPosition = GetPartLocalPos(part); LSL_Vector currentPosition = GetPartLocalPos(part);
@ -7263,6 +7264,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
int code = rules.GetLSLIntegerItem(idx++); int code = rules.GetLSLIntegerItem(idx++);
int remain = rules.Length - idx; int remain = rules.Length - idx;
idxStart = idx;
int face; int face;
LSL_Vector v; LSL_Vector v;
@ -7639,7 +7641,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
catch (InvalidCastException e) catch (InvalidCastException e)
{ {
ShoutError(e.Message); ShoutError(string.Format(
"{0} error running rule #{1}: arg #{2} ",
originFunc, "unknown", idx - idxStart) + e.Message);
} }
finally finally
{ {
@ -10761,7 +10765,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return tid.ToString(); return tid.ToString();
} }
public void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules) public void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules, string originFunc)
{ {
SceneObjectPart obj = World.GetSceneObjectPart(new UUID(prim)); SceneObjectPart obj = World.GetSceneObjectPart(new UUID(prim));
if (obj == null) if (obj == null)
@ -10770,14 +10774,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (obj.OwnerID != m_host.OwnerID) if (obj.OwnerID != m_host.OwnerID)
return; return;
LSL_List remaining = SetPrimParams(obj, rules); LSL_List remaining = SetPrimParams(obj, rules, originFunc);
while ((object)remaining != null && remaining.Length > 2) while ((object)remaining != null && remaining.Length > 2)
{ {
LSL_Integer newLink = remaining.GetLSLIntegerItem(0); LSL_Integer newLink = remaining.GetLSLIntegerItem(0);
LSL_List newrules = remaining.GetSublist(1, -1); LSL_List newrules = remaining.GetSublist(1, -1);
foreach(SceneObjectPart part in GetLinkParts(obj, newLink)){ foreach(SceneObjectPart part in GetLinkParts(obj, newLink)){
remaining = SetPrimParams(part, newrules); remaining = SetPrimParams(part, newrules, originFunc);
} }
} }
} }

View File

@ -2988,7 +2988,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
InitLSL(); InitLSL();
m_LSL_Api.SetPrimitiveParamsEx(prim, rules); m_LSL_Api.SetPrimitiveParamsEx(prim, rules, "osSetPrimitiveParams");
} }
/// <summary> /// <summary>

View File

@ -424,7 +424,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String llXorBase64StringsCorrect(string str1, string str2); LSL_String llXorBase64StringsCorrect(string str1, string str2);
void print(string str); void print(string str);
void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules, string originFunc);
LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
} }
} }