From 5a1be7835c663095207ef1e4494331c1c1e867bc Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 20 Sep 2008 16:24:36 +0000 Subject: [PATCH] XEngine: Fix llGetListEntryType to return the correct type for the LSL types. Change serialization to omit types it can't deal with. --- .../Shared/Api/Implementation/LSL_Api.cs | 10 +++++----- .../Shared/Api/Runtime/ScriptBase.cs | 20 +++++++++++++++++-- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0cfa06f2d0..f49cf0cd1b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -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) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index f856ea597d..b32fce65cc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs @@ -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); }