private void JsonSetSpecific(OSD o, LSL_List specifiers, int i, LSL_String val)
{
object spec = specifiers.Data[i];
// 20131224 not used object specNext = i+1 == specifiers.Data.Length ? null : specifiers.Data[i+1];
OSD nextVal = null;
if (o is OSDArray)
{
OSDArray array = ((OSDArray)o);
if (spec is LSL_Integer)
{
int v = ((LSL_Integer)spec).value;
if (v >= array.Count)
array.Add(JsonBuildRestOfSpec(specifiers, i + 1, val));
else
nextVal = ((OSDArray)o)[v];
}
else if (spec is LSL_String && ((LSL_String)spec) == ScriptBaseClass.JSON_APPEND)
array.Add(JsonBuildRestOfSpec(specifiers, i + 1, val));
}
if (o is OSDMap)
{
if (spec is LSL_String)
{
OSDMap map = ((OSDMap)o);
if (map.ContainsKey(((LSL_String)spec).m_string))
nextVal = map[((LSL_String)spec).m_string];
else
map.Add(((LSL_String)spec).m_string, JsonBuildRestOfSpec(specifiers, i + 1, val));
}
}
if (nextVal != null)
{
if (specifiers.Data.Length - 1 > i)
{
JsonSetSpecific(nextVal, specifiers, i + 1, val);
return;
}
}
}