Fix a regression where animations would only be sent if the avatar has

attachments. Convert base types to LSL types for event marshalling through
IScriptModule to avoid parameter errors.
0.6.5-rc1
Melanie Thielker 2009-04-12 02:42:05 +00:00
parent 217b2d93ae
commit f6f3737fe8
3 changed files with 73 additions and 5 deletions

View File

@ -1961,12 +1961,12 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] {16384}); m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] {16384});
} }
}
}
}
SendAnimPack(); SendAnimPack();
} }
} }
}
}
}
/// <summary> /// <summary>
/// This method determines the proper movement related animation /// This method determines the proper movement related animation

View File

@ -219,7 +219,24 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
public bool PostScriptEvent(UUID itemID, string name, Object[] p) public bool PostScriptEvent(UUID itemID, string name, Object[] p)
{ {
return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0])); Object[] lsl_p = new Object[p.Length];
for (int i = 0; i < p.Length ; i++)
{
if (p[i] is int)
lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
else if (p[i] is string)
lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
else if (p[i] is Vector3)
lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
else if (p[i] is Quaternion)
lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
else if (p[i] is float)
lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
else
lsl_p[i] = p[i];
}
return PostScriptEvent(itemID, new EventParams(name, lsl_p, new DetectParams[0]));
} }
public bool PostObjectEvent(UUID itemID, string name, Object[] p) public bool PostObjectEvent(UUID itemID, string name, Object[] p)
@ -228,7 +245,24 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
if (part == null) if (part == null)
return false; return false;
return PostObjectEvent(part.LocalId, new EventParams(name, p, new DetectParams[0])); Object[] lsl_p = new Object[p.Length];
for (int i = 0; i < p.Length ; i++)
{
if (p[i] is int)
lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
else if (p[i] is string)
lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
else if (p[i] is Vector3)
lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
else if (p[i] is Quaternion)
lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
else if (p[i] is float)
lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
else
lsl_p[i] = p[i];
}
return PostObjectEvent(part.LocalId, new EventParams(name, lsl_p, new DetectParams[0]));
} }
public DetectParams GetDetectParams(UUID itemID, int number) public DetectParams GetDetectParams(UUID itemID, int number)

View File

@ -935,7 +935,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public bool PostScriptEvent(UUID itemID, string name, Object[] p) public bool PostScriptEvent(UUID itemID, string name, Object[] p)
{ {
return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0])); Object[] lsl_p = new Object[p.Length];
for (int i = 0; i < p.Length ; i++)
{
if (p[i] is int)
lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
else if (p[i] is string)
lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
else if (p[i] is Vector3)
lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
else if (p[i] is Quaternion)
lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
else if (p[i] is float)
lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
else
lsl_p[i] = p[i];
}
return PostScriptEvent(itemID, new EventParams(name, lsl_p, new DetectParams[0]));
} }
public bool PostObjectEvent(UUID itemID, string name, Object[] p) public bool PostObjectEvent(UUID itemID, string name, Object[] p)
@ -944,7 +961,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (part == null) if (part == null)
return false; return false;
return PostObjectEvent(part.LocalId, new EventParams(name, p, new DetectParams[0])); Object[] lsl_p = new Object[p.Length];
for (int i = 0; i < p.Length ; i++)
{
if (p[i] is int)
lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
else if (p[i] is string)
lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
else if (p[i] is Vector3)
lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
else if (p[i] is Quaternion)
lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
else if (p[i] is float)
lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
else
lsl_p[i] = p[i];
}
return PostObjectEvent(part.LocalId, new EventParams(name, lsl_p, new DetectParams[0]));
} }
public Assembly OnAssemblyResolve(object sender, public Assembly OnAssemblyResolve(object sender,