Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
commit
a08e1b60ec
|
@ -250,6 +250,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pkey will be the final element in the path, we pull it out here to make sure
|
||||||
|
// that the assignment works correctly
|
||||||
string pkey = path.Pop();
|
string pkey = path.Pop();
|
||||||
string pexpr = PathExpressionToKey(path);
|
string pexpr = PathExpressionToKey(path);
|
||||||
if (pexpr != "")
|
if (pexpr != "")
|
||||||
|
@ -259,7 +261,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||||
if (result == null)
|
if (result == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Check for and extract array references
|
// Check pkey, the last element in the path, for and extract array references
|
||||||
MatchCollection amatches = m_ArrayPattern.Matches(pkey,0);
|
MatchCollection amatches = m_ArrayPattern.Matches(pkey,0);
|
||||||
if (amatches.Count > 0)
|
if (amatches.Count > 0)
|
||||||
{
|
{
|
||||||
|
@ -307,16 +309,23 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||||
|
|
||||||
if (result is OSDMap)
|
if (result is OSDMap)
|
||||||
{
|
{
|
||||||
|
// this is the assignment case
|
||||||
OSDMap hmap = result as OSDMap;
|
OSDMap hmap = result as OSDMap;
|
||||||
if (ovalue != null)
|
if (ovalue != null)
|
||||||
{
|
{
|
||||||
hmap[hkey] = ovalue;
|
hmap[hkey] = ovalue;
|
||||||
InvokeNextCallback(pexpr + pkey);
|
InvokeNextCallback(pexpr + pkey);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else if (hmap.ContainsKey(hkey))
|
|
||||||
|
// this is the remove case
|
||||||
|
if (hmap.ContainsKey(hkey))
|
||||||
|
{
|
||||||
hmap.Remove(hkey);
|
hmap.Remove(hkey);
|
||||||
|
return true;
|
||||||
return true;
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -239,7 +239,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||||
if (! m_enabled) return false;
|
if (! m_enabled) return false;
|
||||||
|
|
||||||
lock (m_JsonValueStore)
|
lock (m_JsonValueStore)
|
||||||
m_JsonValueStore.Remove(storeID);
|
return m_JsonValueStore.Remove(storeID);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -311,8 +311,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (map)
|
lock (map)
|
||||||
if (map.SetValue(path,value,useJson))
|
return map.SetValue(path,value,useJson);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -344,8 +343,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (map)
|
lock (map)
|
||||||
if (map.RemoveValue(path))
|
return map.RemoveValue(path);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -504,7 +504,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||||
{
|
{
|
||||||
string jsondata = SLUtil.ParseNotecardToString(Encoding.UTF8.GetString(a.Data));
|
string jsondata = SLUtil.ParseNotecardToString(Encoding.UTF8.GetString(a.Data));
|
||||||
int result = m_store.SetValue(storeID, path, jsondata,true) ? 1 : 0;
|
int result = m_store.SetValue(storeID, path, jsondata,true) ? 1 : 0;
|
||||||
m_comms.DispatchReply(scriptID,result, "", reqID.ToString());
|
m_comms.DispatchReply(scriptID, result, "", reqID.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
Loading…
Reference in New Issue