Broaden the internal OSD type checks to parse JSON that has

non string values.
user_profiles
Mic Bowman 2013-02-08 15:46:42 -08:00
parent 4d5c04837e
commit 6d825d7ea2
1 changed files with 29 additions and 2 deletions

View File

@ -145,7 +145,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
if (result == null) if (result == null)
return false; return false;
if (useJson || result.Type == OSDType.String) if (useJson || OSDBaseType(result.Type))
return true; return true;
return false; return false;
@ -531,7 +531,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
return true; return true;
} }
if (result.Type == OSDType.String) if (OSDBaseType(result.Type))
{ {
value = result.AsString(); value = result.AsString();
return true; return true;
@ -557,6 +557,33 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
return pkey; 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> /// <summary>
/// ///