mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
Enables script access to the per object dynamic attributes through the JsonStore
script functions. Adds JsonAttachObjectStore to associate a store identifier with an object (scripts can only access the store in their host object, this could be extended but isn't necessary for now). Note this opens a method to the DAMap OSDMap. This will be removed later, but greatly simplifies the code for now. The JsonStore and these scripts are disabled by default.
This commit is contained in:
@@ -170,6 +170,34 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
#region ScriptInvocationInteface
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool AttachObjectStore(UUID objectID)
|
||||
{
|
||||
if (! m_enabled) return false;
|
||||
|
||||
SceneObjectPart sop = m_scene.GetSceneObjectPart(objectID);
|
||||
if (sop == null)
|
||||
{
|
||||
m_log.InfoFormat("[JsonStore] unable to attach to unknown object; {0}",objectID);
|
||||
return false;
|
||||
}
|
||||
|
||||
lock (m_JsonValueStore)
|
||||
{
|
||||
if (m_JsonValueStore.ContainsKey(objectID))
|
||||
return true;
|
||||
|
||||
JsonStore map = new JsonObjectStore(m_scene,objectID);
|
||||
m_JsonValueStore.Add(objectID,map);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user