XEngine: Fix llGetListEntryType to return the correct type for the LSL types.
Change serialization to omit types it can't deal with.0.6.0-stable
parent
f8f1bc6199
commit
5a1be7835c
|
@ -4002,20 +4002,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (src.Data[index] is Int32)
|
||||
if (src.Data[index] is LSL_Types.LSLInteger || src.Data[index] is Int32)
|
||||
return 1;
|
||||
if (src.Data[index] is Double)
|
||||
if (src.Data[index] is LSL_Types.LSLFloat || src.Data[index] is Single || src.Data[index] is Double)
|
||||
return 2;
|
||||
if (src.Data[index] is String)
|
||||
if (src.Data[index] is LSL_Types.LSLString || src.Data[index] is String)
|
||||
{
|
||||
UUID tuuid;
|
||||
if (UUID.TryParse(src.Data[index].ToString(), out tuuid))
|
||||
{
|
||||
return 3;
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 4;
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
if (src.Data[index] is LSL_Types.Vector3)
|
||||
|
|
|
@ -138,7 +138,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
c.Data = data;
|
||||
vars[field.Name] = c;
|
||||
}
|
||||
else
|
||||
else if(field.FieldType == typeof(LSL_Types.LSLInteger) ||
|
||||
field.FieldType == typeof(LSL_Types.LSLString) ||
|
||||
field.FieldType == typeof(LSL_Types.LSLFloat) ||
|
||||
field.FieldType == typeof(Int32) ||
|
||||
field.FieldType == typeof(Double) ||
|
||||
field.FieldType == typeof(Single) ||
|
||||
field.FieldType == typeof(String) ||
|
||||
field.FieldType == typeof(Byte) ||
|
||||
field.FieldType == typeof(Short))
|
||||
{
|
||||
vars[field.Name] = field.GetValue(this);
|
||||
}
|
||||
|
@ -161,7 +169,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
Array.Copy(data, 0, v.Data, 0, data.Length);
|
||||
m_Fields[var.Key].SetValue(this, v);
|
||||
}
|
||||
else
|
||||
else if(field.FieldType == typeof(LSL_Types.LSLInteger) ||
|
||||
field.FieldType == typeof(LSL_Types.LSLString) ||
|
||||
field.FieldType == typeof(LSL_Types.LSLFloat) ||
|
||||
field.FieldType == typeof(Int32) ||
|
||||
field.FieldType == typeof(Double) ||
|
||||
field.FieldType == typeof(Single) ||
|
||||
field.FieldType == typeof(String) ||
|
||||
field.FieldType == typeof(Byte) ||
|
||||
field.FieldType == typeof(Short))
|
||||
{
|
||||
m_Fields[var.Key].SetValue(this, var.Value);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue