Broaden the internal OSD type checks to parse JSON that has
non string values.user_profiles
parent
4d5c04837e
commit
6d825d7ea2
|
@ -145,7 +145,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
|||
if (result == null)
|
||||
return false;
|
||||
|
||||
if (useJson || result.Type == OSDType.String)
|
||||
if (useJson || OSDBaseType(result.Type))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -531,7 +531,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
|||
return true;
|
||||
}
|
||||
|
||||
if (result.Type == OSDType.String)
|
||||
if (OSDBaseType(result.Type))
|
||||
{
|
||||
value = result.AsString();
|
||||
return true;
|
||||
|
@ -557,6 +557,33 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
|||
return pkey;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
protected static bool OSDBaseType(OSDType type)
|
||||
{
|
||||
// Should be the list of base types for which AsString() returns
|
||||
// something useful
|
||||
if (type == OSDType.Boolean)
|
||||
return true;
|
||||
if (type == OSDType.Integer)
|
||||
return true;
|
||||
if (type == OSDType.Real)
|
||||
return true;
|
||||
if (type == OSDType.String)
|
||||
return true;
|
||||
if (type == OSDType.UUID)
|
||||
return true;
|
||||
if (type == OSDType.Date)
|
||||
return true;
|
||||
if (type == OSDType.URI)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue