mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
Massive tab and trailing space cleanup
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) Contributors
|
||||
* Copyright (c) Contributors
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
protected List<TakeValueCallbackClass> m_TakeStore;
|
||||
protected List<TakeValueCallbackClass> m_ReadStore;
|
||||
|
||||
|
||||
// add separators for quoted paths and array references
|
||||
protected static Regex m_ParsePassOne = new Regex("({[^}]+}|\\[[0-9]+\\]|\\[\\+\\])");
|
||||
|
||||
@@ -98,10 +98,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public int StringSpace { get; set; }
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public static bool CanonicalPathExpression(string ipath, out string opath)
|
||||
@@ -116,13 +116,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
opath = PathExpressionToKey(path);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public JsonStore()
|
||||
public JsonStore()
|
||||
{
|
||||
StringSpace = 0;
|
||||
m_TakeStore = new List<TakeValueCallbackClass>();
|
||||
@@ -132,17 +132,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
public JsonStore(string value) : this()
|
||||
{
|
||||
// This is going to throw an exception if the value is not
|
||||
// a valid JSON chunk. Calling routines should catch the
|
||||
// a valid JSON chunk. Calling routines should catch the
|
||||
// exception and handle it appropriately
|
||||
if (String.IsNullOrEmpty(value))
|
||||
ValueStore = new OSDMap();
|
||||
else
|
||||
ValueStore = OSDParser.DeserializeJson(value);
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public JsonStoreNodeType GetNodeType(string expr)
|
||||
@@ -150,27 +150,27 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
Stack<string> path;
|
||||
if (! ParsePathExpression(expr,out path))
|
||||
return JsonStoreNodeType.Undefined;
|
||||
|
||||
|
||||
OSD result = ProcessPathExpression(ValueStore,path);
|
||||
|
||||
if (result == null)
|
||||
return JsonStoreNodeType.Undefined;
|
||||
|
||||
|
||||
if (result is OSDMap)
|
||||
return JsonStoreNodeType.Object;
|
||||
|
||||
|
||||
if (result is OSDArray)
|
||||
return JsonStoreNodeType.Array;
|
||||
|
||||
|
||||
if (OSDBaseType(result.Type))
|
||||
return JsonStoreNodeType.Value;
|
||||
|
||||
|
||||
return JsonStoreNodeType.Undefined;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public JsonStoreValueType GetValueType(string expr)
|
||||
@@ -178,18 +178,18 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
Stack<string> path;
|
||||
if (! ParsePathExpression(expr,out path))
|
||||
return JsonStoreValueType.Undefined;
|
||||
|
||||
|
||||
OSD result = ProcessPathExpression(ValueStore,path);
|
||||
|
||||
if (result == null)
|
||||
return JsonStoreValueType.Undefined;
|
||||
|
||||
|
||||
if (result is OSDMap)
|
||||
return JsonStoreValueType.Undefined;
|
||||
|
||||
|
||||
if (result is OSDArray)
|
||||
return JsonStoreValueType.Undefined;
|
||||
|
||||
|
||||
if (result is OSDBoolean)
|
||||
return JsonStoreValueType.Boolean;
|
||||
|
||||
@@ -204,10 +204,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
return JsonStoreValueType.Undefined;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public int ArrayLength(string expr)
|
||||
@@ -228,7 +228,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool GetValue(string expr, out string value, bool useJson)
|
||||
@@ -241,23 +241,23 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
}
|
||||
|
||||
OSD result = ProcessPathExpression(ValueStore,path);
|
||||
return ConvertOutputValue(result,out value,useJson);
|
||||
return ConvertOutputValue(result,out value,useJson);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool RemoveValue(string expr)
|
||||
{
|
||||
return SetValueFromExpression(expr,null);
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool SetValue(string expr, string value, bool useJson)
|
||||
@@ -272,7 +272,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
// There doesn't appear to be a good way to determine if the
|
||||
// value is valid Json other than to let the parser crash
|
||||
try
|
||||
try
|
||||
{
|
||||
ovalue = OSDParser.DeserializeJson(value);
|
||||
}
|
||||
@@ -292,13 +292,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
ovalue = new OSDString(value);
|
||||
}
|
||||
|
||||
|
||||
return SetValueFromExpression(expr,ovalue);
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool TakeValue(string expr, bool useJson, TakeValueCallback cback)
|
||||
@@ -315,7 +315,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
m_TakeStore.Add(new TakeValueCallbackClass(pexpr,useJson,cback));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
string value = String.Empty;
|
||||
if (! ConvertOutputValue(result,out value,useJson))
|
||||
{
|
||||
@@ -332,7 +332,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool ReadValue(string expr, bool useJson, TakeValueCallback cback)
|
||||
@@ -349,7 +349,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
m_ReadStore.Add(new TakeValueCallbackClass(pexpr,useJson,cback));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
string value = String.Empty;
|
||||
if (! ConvertOutputValue(result,out value,useJson))
|
||||
{
|
||||
@@ -362,10 +362,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
protected bool SetValueFromExpression(string expr, OSD ovalue)
|
||||
@@ -447,7 +447,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
Match match = hmatches[0];
|
||||
GroupCollection groups = match.Groups;
|
||||
string hkey = groups[1].Value;
|
||||
|
||||
|
||||
if (result is OSDMap)
|
||||
{
|
||||
// this is the assignment case
|
||||
@@ -456,7 +456,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
StringSpace -= ComputeSizeOf(hmap[hkey]);
|
||||
StringSpace += ComputeSizeOf(ovalue);
|
||||
|
||||
|
||||
hmap[hkey] = ovalue;
|
||||
InvokeNextCallback(pexpr + pkey);
|
||||
return true;
|
||||
@@ -483,13 +483,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
protected bool InvokeNextCallback(string pexpr)
|
||||
{
|
||||
// Process all of the reads that match the expression first
|
||||
List<TakeValueCallbackClass> reads =
|
||||
List<TakeValueCallbackClass> reads =
|
||||
m_ReadStore.FindAll(delegate(TakeValueCallbackClass tb) { return pexpr.StartsWith(tb.Path); });
|
||||
|
||||
foreach (TakeValueCallbackClass readcb in reads)
|
||||
@@ -501,7 +501,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
// Process one take next
|
||||
TakeValueCallbackClass takecb =
|
||||
m_TakeStore.Find(delegate(TakeValueCallbackClass tb) { return pexpr.StartsWith(tb.Path); });
|
||||
|
||||
|
||||
if (takecb != null)
|
||||
{
|
||||
m_TakeStore.Remove(takecb);
|
||||
@@ -525,13 +525,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// add front and rear separators
|
||||
expr = "." + expr + ".";
|
||||
|
||||
|
||||
// add separators for quoted exprs and array references
|
||||
expr = m_ParsePassOne.Replace(expr,".$1.",-1,0);
|
||||
|
||||
|
||||
// add quotes to bare identifier
|
||||
expr = m_ParsePassThree.Replace(expr,".{$1}",-1,0);
|
||||
|
||||
|
||||
// remove extra separators
|
||||
expr = m_ParsePassFour.Replace(expr,".",-1,0);
|
||||
|
||||
@@ -550,7 +550,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param>path is a stack where the top level of the path is at the bottom of the stack</param>
|
||||
// -----------------------------------------------------------------
|
||||
@@ -558,13 +558,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
if (path.Count == 0)
|
||||
return map;
|
||||
|
||||
|
||||
string pkey = path.Pop();
|
||||
|
||||
OSD rmap = ProcessPathExpression(map,path);
|
||||
if (rmap == null)
|
||||
return null;
|
||||
|
||||
|
||||
// ---------- Check for an array index ----------
|
||||
MatchCollection amatches = m_SimpleArrayPattern.Matches(pkey,0);
|
||||
|
||||
@@ -582,7 +582,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
GroupCollection groups = match.Groups;
|
||||
string akey = groups[1].Value;
|
||||
int aval = Convert.ToInt32(akey);
|
||||
|
||||
|
||||
if (aval < amap.Count)
|
||||
return (OSD) amap[aval];
|
||||
|
||||
@@ -599,13 +599,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
m_log.WarnFormat("[JsonStore] wrong type for key {2}, expecting {0}, got {1}",OSDType.Map,rmap.Type,pkey);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
OSDMap hmap = rmap as OSDMap;
|
||||
|
||||
Match match = hmatches[0];
|
||||
GroupCollection groups = match.Groups;
|
||||
string hkey = groups[1].Value;
|
||||
|
||||
|
||||
if (hmap.ContainsKey(hkey))
|
||||
return (OSD) hmap[hkey];
|
||||
|
||||
@@ -619,13 +619,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
protected static bool ConvertOutputValue(OSD result, out string value, bool useJson)
|
||||
{
|
||||
value = String.Empty;
|
||||
|
||||
|
||||
// If we couldn't process the path
|
||||
if (result == null)
|
||||
return false;
|
||||
@@ -646,13 +646,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
return true;
|
||||
}
|
||||
|
||||
value = "'" + result.AsString() + "'";
|
||||
value = "'" + result.AsString() + "'";
|
||||
return true;
|
||||
}
|
||||
|
||||
if (OSDBaseType(result.Type))
|
||||
{
|
||||
value = result.AsString();
|
||||
value = result.AsString();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -661,24 +661,24 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
protected static string PathExpressionToKey(Stack<string> path)
|
||||
{
|
||||
if (path.Count == 0)
|
||||
return "";
|
||||
|
||||
|
||||
string pkey = "";
|
||||
foreach (string k in path)
|
||||
pkey = (pkey == "") ? k : (k + "." + pkey);
|
||||
|
||||
|
||||
return pkey;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
protected static bool OSDBaseType(OSDType type)
|
||||
@@ -705,7 +705,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
protected static int ComputeSizeOf(OSD value)
|
||||
@@ -731,7 +731,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
private Scene m_scene;
|
||||
private UUID m_objectID;
|
||||
|
||||
protected override OSD ValueStore
|
||||
protected override OSD ValueStore
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -741,7 +741,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
// This is bad
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return sop.DynAttrs.TopLevelMap;
|
||||
}
|
||||
|
||||
@@ -761,5 +761,5 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
StringSpace = ComputeSizeOf(ValueStore);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) Contributors
|
||||
* Copyright (c) Contributors
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -79,7 +79,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
// -----------------------------------------------------------------
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
if ((m_config = config.Configs["JsonStore"]) == null)
|
||||
{
|
||||
@@ -127,7 +127,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
if (m_enabled)
|
||||
{
|
||||
m_scene = scene;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Called when all modules have been added for a region. This is
|
||||
/// Called when all modules have been added for a region. This is
|
||||
/// where we hook up events
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) Contributors
|
||||
* Copyright (c) Contributors
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -83,7 +83,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
// -----------------------------------------------------------------
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
if ((m_config = config.Configs["JsonStore"]) == null)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Called when all modules have been added for a region. This is
|
||||
/// Called when all modules have been added for a region. This is
|
||||
/// where we hook up events
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
@@ -184,7 +184,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
#region SceneEvents
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public void EventManagerOnObjectBeingRemovedFromScene(SceneObjectGroup obj)
|
||||
@@ -196,10 +196,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
#region ScriptInvocationInteface
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public JsonStoreStats GetStoreStats()
|
||||
@@ -210,13 +210,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
stats.StoreCount = m_JsonValueStore.Count;
|
||||
}
|
||||
|
||||
|
||||
return stats;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool AttachObjectStore(UUID objectID)
|
||||
@@ -235,17 +235,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
if (m_JsonValueStore.ContainsKey(objectID))
|
||||
return true;
|
||||
|
||||
|
||||
JsonStore map = new JsonObjectStore(m_scene,objectID);
|
||||
m_JsonValueStore.Add(objectID,map);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool CreateStore(string value, ref UUID result)
|
||||
@@ -254,12 +254,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
result = UUID.Random();
|
||||
|
||||
JsonStore map = null;
|
||||
|
||||
|
||||
if (! m_enabled) return false;
|
||||
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
{
|
||||
map = new JsonStore(value);
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -270,13 +270,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
lock (m_JsonValueStore)
|
||||
m_JsonValueStore.Add(result,map);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool DestroyStore(UUID storeID)
|
||||
@@ -289,7 +289,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool TestStore(UUID storeID)
|
||||
@@ -302,7 +302,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public JsonStoreNodeType GetNodeType(UUID storeID, string path)
|
||||
@@ -318,7 +318,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
return JsonStoreNodeType.Undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
lock (map)
|
||||
@@ -334,7 +334,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public JsonStoreValueType GetValueType(UUID storeID, string path)
|
||||
@@ -350,7 +350,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
return JsonStoreValueType.Undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
lock (map)
|
||||
@@ -366,7 +366,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool SetValue(UUID storeID, string path, string value, bool useJson)
|
||||
@@ -382,7 +382,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
lock (map)
|
||||
@@ -393,7 +393,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
storeID,map.StringSpace,m_maxStringSpace);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return map.SetValue(path,value,useJson);
|
||||
}
|
||||
}
|
||||
@@ -404,10 +404,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool RemoveValue(UUID storeID, string path)
|
||||
@@ -423,7 +423,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
lock (map)
|
||||
@@ -436,10 +436,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public int GetArrayLength(UUID storeID, string path)
|
||||
@@ -464,19 +464,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
m_log.Error("[JsonStore]: unable to retrieve value", e);
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public bool GetValue(UUID storeID, string path, bool useJson, out string value)
|
||||
{
|
||||
value = String.Empty;
|
||||
|
||||
|
||||
if (! m_enabled) return false;
|
||||
|
||||
JsonStore map = null;
|
||||
@@ -497,13 +497,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
m_log.Error("[JsonStore]: unable to retrieve value", e);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public void TakeValue(UUID storeID, string path, bool useJson, TakeValueCallback cback)
|
||||
@@ -536,13 +536,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
m_log.Error("[JsonStore] unable to retrieve value", e);
|
||||
}
|
||||
|
||||
|
||||
cback(String.Empty);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public void ReadValue(UUID storeID, string path, bool useJson, TakeValueCallback cback)
|
||||
@@ -575,7 +575,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
m_log.Error("[JsonStore]: unable to retrieve value", e);
|
||||
}
|
||||
|
||||
|
||||
cback(String.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) Contributors
|
||||
* Copyright (c) Contributors
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -83,7 +83,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
// -----------------------------------------------------------------
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
if ((m_config = config.Configs["JsonStore"]) == null)
|
||||
{
|
||||
@@ -166,7 +166,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Called when all modules have been added for a region. This is
|
||||
/// Called when all modules have been added for a region. This is
|
||||
/// where we hook up events
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
@@ -251,7 +251,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
#region ScriptInvocationInteface
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -260,13 +260,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
UUID uuid = UUID.Zero;
|
||||
if (! m_store.AttachObjectStore(hostID))
|
||||
GenerateRuntimeError("Failed to create Json store");
|
||||
|
||||
|
||||
return hostID;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -275,12 +275,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
UUID uuid = UUID.Zero;
|
||||
if (! m_store.CreateStore(value, ref uuid))
|
||||
GenerateRuntimeError("Failed to create Json store");
|
||||
|
||||
|
||||
lock (m_scriptStores)
|
||||
{
|
||||
if (! m_scriptStores.ContainsKey(scriptID))
|
||||
m_scriptStores[scriptID] = new HashSet<UUID>();
|
||||
|
||||
|
||||
m_scriptStores[scriptID].Add(uuid);
|
||||
}
|
||||
return uuid;
|
||||
@@ -288,7 +288,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -305,7 +305,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -316,7 +316,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -330,7 +330,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -341,10 +341,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
o => DoJsonReadNotecard(reqID, hostID, scriptID, storeID, path, notecardIdentifier), null, "JsonStoreScriptModule.JsonReadNotecard");
|
||||
return reqID;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -358,7 +358,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -366,7 +366,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
string ipath = ConvertList2Path(pathlist);
|
||||
string opath;
|
||||
|
||||
|
||||
if (JsonStore.CanonicalPathExpression(ipath,out opath))
|
||||
return opath;
|
||||
|
||||
@@ -375,10 +375,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
// the entire store
|
||||
return "**INVALID**";
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -389,7 +389,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -400,7 +400,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -417,7 +417,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -425,10 +425,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
return m_store.RemoveValue(storeID,path) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -436,10 +436,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
return m_store.GetArrayLength(storeID,path);
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -457,10 +457,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
m_store.GetValue(storeID,path,true, out value);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -480,10 +480,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
o => DoJsonTakeValue(scriptID,reqID,storeID,path,true), null, "JsonStoreScriptModule.DoJsonTakeValueJson");
|
||||
return reqID;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
[ScriptInvocation]
|
||||
@@ -503,12 +503,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
o => DoJsonReadValue(scriptID,reqID,storeID,path,true), null, "JsonStoreScriptModule.DoJsonReadValueJson");
|
||||
return reqID;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
protected void GenerateRuntimeError(string msg)
|
||||
@@ -516,10 +516,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
m_log.InfoFormat("[JsonStore] runtime error: {0}",msg);
|
||||
throw new Exception("JsonStore Runtime Error: " + msg);
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
protected void DispatchValue(UUID scriptID, UUID reqID, string value)
|
||||
@@ -529,7 +529,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
private void DoJsonTakeValue(UUID scriptID, UUID reqID, UUID storeID, string path, bool useJson)
|
||||
@@ -543,14 +543,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
m_log.InfoFormat("[JsonStoreScripts]: unable to retrieve value; {0}",e.ToString());
|
||||
}
|
||||
|
||||
|
||||
DispatchValue(scriptID,reqID,String.Empty);
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
private void DoJsonReadValue(UUID scriptID, UUID reqID, UUID storeID, string path, bool useJson)
|
||||
@@ -564,13 +564,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
m_log.InfoFormat("[JsonStoreScripts]: unable to retrieve value; {0}",e.ToString());
|
||||
}
|
||||
|
||||
|
||||
DispatchValue(scriptID,reqID,String.Empty);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
private void DoJsonReadNotecard(
|
||||
@@ -580,7 +580,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
if (!UUID.TryParse(notecardIdentifier, out assetID))
|
||||
{
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(hostID);
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(hostID);
|
||||
assetID = ScriptUtils.GetAssetIdFromItemName(part, notecardIdentifier, (int)AssetType.Notecard);
|
||||
}
|
||||
|
||||
@@ -590,10 +590,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
if (a.Type != (sbyte)AssetType.Notecard)
|
||||
GenerateRuntimeError(String.Format("Invalid notecard asset {0}", assetID));
|
||||
|
||||
|
||||
m_log.DebugFormat("[JsonStoreScripts]: read notecard in context {0}",storeID);
|
||||
|
||||
try
|
||||
try
|
||||
{
|
||||
string jsondata = SLUtil.ParseNotecardToString(a.Data);
|
||||
int result = m_store.SetValue(storeID, path, jsondata,true) ? 1 : 0;
|
||||
@@ -612,10 +612,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
GenerateRuntimeError(String.Format("Json parsing failed for {0}", assetID));
|
||||
m_comms.DispatchReply(scriptID, 0, "", reqID.ToString());
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
private void DoJsonWriteNotecard(UUID reqID, UUID hostID, UUID scriptID, UUID storeID, string path, string name)
|
||||
@@ -626,9 +626,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
m_comms.DispatchReply(scriptID,0,UUID.Zero.ToString(),reqID.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SceneObjectPart host = m_scene.GetSceneObjectPart(hostID);
|
||||
|
||||
|
||||
// Create new asset
|
||||
UUID assetID = UUID.Random();
|
||||
AssetBase asset = new AssetBase(assetID, name, (sbyte)AssetType.Notecard, host.OwnerID.ToString());
|
||||
@@ -681,7 +681,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
for (int i = 0; i < pathlist.Length; i++)
|
||||
{
|
||||
string token = "";
|
||||
|
||||
|
||||
if (pathlist[i] is string)
|
||||
{
|
||||
token = pathlist[i].ToString();
|
||||
@@ -699,16 +699,16 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
{
|
||||
token = "." + pathlist[i].ToString() + ".";
|
||||
}
|
||||
|
||||
|
||||
path += token + ".";
|
||||
}
|
||||
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
private void DoJsonRezObject(UUID hostID, UUID scriptID, UUID reqID, string name, Vector3 pos, Vector3 vel, Quaternion rot, string param)
|
||||
@@ -801,7 +801,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
|
||||
group.ScheduleGroupForFullUpdate();
|
||||
|
||||
// send the reply back to the host object, use the integer param to indicate the number
|
||||
// send the reply back to the host object, use the integer param to indicate the number
|
||||
// of remaining objects
|
||||
m_comms.DispatchReply(scriptID, objlist.Count-i-1, group.RootPart.UUID.ToString(), reqID.ToString());
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'Two' } }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'Two' } }");
|
||||
|
||||
{
|
||||
string value = (string)InvokeOp("JsonGetValue", storeId, "Hello.World");
|
||||
@@ -213,7 +213,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'Two' } }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'Two' } }");
|
||||
|
||||
{
|
||||
string value = (string)InvokeOp("JsonGetJson", storeId, "Hello.World");
|
||||
@@ -246,11 +246,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
// TestHelpers.InMethod();
|
||||
//// TestHelpers.EnableLogging();
|
||||
//
|
||||
// UUID storeId
|
||||
// UUID storeId
|
||||
// = (UUID)m_smcm.InvokeOperation(
|
||||
// UUID.Zero, UUID.Zero, "JsonCreateStore", new object[] { "{ 'Hello' : 'World' }" });
|
||||
// UUID.Zero, UUID.Zero, "JsonCreateStore", new object[] { "{ 'Hello' : 'World' }" });
|
||||
//
|
||||
// string value
|
||||
// string value
|
||||
// = (string)m_smcm.InvokeOperation(
|
||||
// UUID.Zero, UUID.Zero, "JsonTakeValue", new object[] { storeId, "Hello" });
|
||||
//
|
||||
@@ -271,7 +271,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test remove of node in object pointing to a string
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : 'World' }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : 'World' }");
|
||||
|
||||
int returnValue = (int)InvokeOp( "JsonRemoveValue", storeId, "Hello");
|
||||
Assert.That(returnValue, Is.EqualTo(1));
|
||||
@@ -285,7 +285,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test remove of node in object pointing to another object
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'Wally' } }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'Wally' } }");
|
||||
|
||||
int returnValue = (int)InvokeOp( "JsonRemoveValue", storeId, "Hello");
|
||||
Assert.That(returnValue, Is.EqualTo(1));
|
||||
@@ -299,7 +299,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test remove of node in an array
|
||||
{
|
||||
UUID storeId
|
||||
UUID storeId
|
||||
= (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : [ 'value1', 'value2' ] }");
|
||||
|
||||
int returnValue = (int)InvokeOp( "JsonRemoveValue", storeId, "Hello[0]");
|
||||
@@ -320,7 +320,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test remove of non-existing value
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : 'World' }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : 'World' }");
|
||||
|
||||
int fakeValueRemove = (int)InvokeOp("JsonRemoveValue", storeId, "Cheese");
|
||||
Assert.That(fakeValueRemove, Is.EqualTo(0));
|
||||
@@ -340,7 +340,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
// TestHelpers.InMethod();
|
||||
//// TestHelpers.EnableLogging();
|
||||
//
|
||||
// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'One' } }");
|
||||
// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'One' } }");
|
||||
//
|
||||
// {
|
||||
// int result = (int)InvokeOp("JsonTestPath", storeId, "Hello.World");
|
||||
@@ -372,7 +372,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
// TestHelpers.InMethod();
|
||||
//// TestHelpers.EnableLogging();
|
||||
//
|
||||
// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'One' } }");
|
||||
// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'One' } }");
|
||||
//
|
||||
// {
|
||||
// int result = (int)InvokeOp("JsonTestPathJson", storeId, "Hello.World");
|
||||
@@ -437,7 +437,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : [ 'one', 2 ] } }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : [ 'one', 2 ] } }");
|
||||
|
||||
{
|
||||
int result = (int)InvokeOp("JsonGetNodeType", storeId, ".");
|
||||
@@ -509,7 +509,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "Fun", "Times");
|
||||
Assert.That(result, Is.EqualTo(1));
|
||||
@@ -520,7 +520,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting a key containing periods with delineation
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "{Fun.Circus}", "Times");
|
||||
Assert.That(result, Is.EqualTo(1));
|
||||
@@ -533,7 +533,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting a key containing unbalanced ] without delineation. Expecting failure
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "Fun]Circus", "Times");
|
||||
Assert.That(result, Is.EqualTo(0));
|
||||
@@ -544,7 +544,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting a key containing unbalanced [ without delineation. Expecting failure
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "Fun[Circus", "Times");
|
||||
Assert.That(result, Is.EqualTo(0));
|
||||
@@ -555,7 +555,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting a key containing unbalanced [] without delineation. Expecting failure
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "Fun[]Circus", "Times");
|
||||
Assert.That(result, Is.EqualTo(0));
|
||||
@@ -566,7 +566,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting a key containing unbalanced ] with delineation
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "{Fun]Circus}", "Times");
|
||||
Assert.That(result, Is.EqualTo(1));
|
||||
@@ -577,7 +577,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting a key containing unbalanced [ with delineation
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "{Fun[Circus}", "Times");
|
||||
Assert.That(result, Is.EqualTo(1));
|
||||
@@ -588,7 +588,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting a key containing empty balanced [] with delineation
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "{Fun[]Circus}", "Times");
|
||||
Assert.That(result, Is.EqualTo(1));
|
||||
@@ -600,7 +600,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
// // Commented out as this currently unexpectedly fails.
|
||||
// // Test setting a key containing brackets around an integer with delineation
|
||||
// {
|
||||
// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
//
|
||||
// int result = (int)InvokeOp("JsonSetValue", storeId, "{Fun[0]Circus}", "Times");
|
||||
// Assert.That(result, Is.EqualTo(1));
|
||||
@@ -610,10 +610,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
// }
|
||||
|
||||
// *** Test {} ***
|
||||
|
||||
|
||||
// Test setting a key containing unbalanced } without delineation. Expecting failure (?)
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "Fun}Circus", "Times");
|
||||
Assert.That(result, Is.EqualTo(0));
|
||||
@@ -624,7 +624,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting a key containing unbalanced { without delineation. Expecting failure (?)
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "Fun{Circus", "Times");
|
||||
Assert.That(result, Is.EqualTo(0));
|
||||
@@ -636,7 +636,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
// // Commented out as this currently unexpectedly fails.
|
||||
// // Test setting a key containing unbalanced }
|
||||
// {
|
||||
// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
//
|
||||
// int result = (int)InvokeOp("JsonSetValue", storeId, "{Fun}Circus}", "Times");
|
||||
// Assert.That(result, Is.EqualTo(0));
|
||||
@@ -644,7 +644,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting a key containing unbalanced { with delineation
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "{Fun{Circus}", "Times");
|
||||
Assert.That(result, Is.EqualTo(1));
|
||||
@@ -655,7 +655,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting a key containing balanced {} with delineation. This should fail.
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "{Fun{Filled}Circus}", "Times");
|
||||
Assert.That(result, Is.EqualTo(0));
|
||||
@@ -666,7 +666,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting to location that does not exist. This should fail.
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetValue", storeId, "Fun.Circus", "Times");
|
||||
Assert.That(result, Is.EqualTo(0));
|
||||
@@ -691,7 +691,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Single quoted token case
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetJson", storeId, "Fun", "'Times'");
|
||||
Assert.That(result, Is.EqualTo(1));
|
||||
@@ -702,7 +702,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Sub-tree case
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetJson", storeId, "Fun", "{ 'Filled' : 'Times' }");
|
||||
Assert.That(result, Is.EqualTo(1));
|
||||
@@ -713,7 +713,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// If setting single strings in JsonSetValueJson, these must be single quoted tokens, not bare strings.
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetJson", storeId, "Fun", "Times");
|
||||
Assert.That(result, Is.EqualTo(0));
|
||||
@@ -724,7 +724,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
// Test setting to location that does not exist. This should fail.
|
||||
{
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }");
|
||||
|
||||
int result = (int)InvokeOp("JsonSetJson", storeId, "Fun.Circus", "'Times'");
|
||||
Assert.That(result, Is.EqualTo(0));
|
||||
@@ -757,7 +757,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, TestHelpers.ParseTail(0x1));
|
||||
m_scene.AddSceneObject(so);
|
||||
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello':'World' }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello':'World' }");
|
||||
|
||||
{
|
||||
string notecardName = "nc1";
|
||||
@@ -820,14 +820,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, TestHelpers.ParseTail(0x1));
|
||||
m_scene.AddSceneObject(so);
|
||||
|
||||
UUID creatingStoreId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello':'World' }");
|
||||
UUID creatingStoreId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello':'World' }");
|
||||
|
||||
// Write notecard
|
||||
InvokeOpOnHost("JsonWriteNotecard", so.UUID, creatingStoreId, "", notecardName);
|
||||
|
||||
{
|
||||
// Read notecard
|
||||
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID readNotecardRequestId = (UUID)InvokeOpOnHost("JsonReadNotecard", so.UUID, receivingStoreId, "", notecardName);
|
||||
Assert.That(readNotecardRequestId, Is.Not.EqualTo(UUID.Zero));
|
||||
|
||||
@@ -837,10 +837,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
{
|
||||
// Read notecard to new single component path
|
||||
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID readNotecardRequestId = (UUID)InvokeOpOnHost("JsonReadNotecard", so.UUID, receivingStoreId, "make", notecardName);
|
||||
Assert.That(readNotecardRequestId, Is.Not.EqualTo(UUID.Zero));
|
||||
|
||||
|
||||
string value = (string)InvokeOp("JsonGetValue", receivingStoreId, "Hello");
|
||||
Assert.That(value, Is.EqualTo(""));
|
||||
|
||||
@@ -850,7 +850,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
{
|
||||
// Read notecard to new multi-component path. This should not work.
|
||||
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{}");
|
||||
UUID readNotecardRequestId = (UUID)InvokeOpOnHost("JsonReadNotecard", so.UUID, receivingStoreId, "make.it", notecardName);
|
||||
Assert.That(readNotecardRequestId, Is.Not.EqualTo(UUID.Zero));
|
||||
|
||||
@@ -863,7 +863,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
{
|
||||
// Read notecard to existing multi-component path. This should work
|
||||
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{ 'make' : { 'it' : 'so' } }");
|
||||
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{ 'make' : { 'it' : 'so' } }");
|
||||
UUID readNotecardRequestId = (UUID)InvokeOpOnHost("JsonReadNotecard", so.UUID, receivingStoreId, "make.it", notecardName);
|
||||
Assert.That(readNotecardRequestId, Is.Not.EqualTo(UUID.Zero));
|
||||
|
||||
@@ -876,7 +876,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
||||
|
||||
{
|
||||
// Read notecard to invalid path. This should not work.
|
||||
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{ 'make' : { 'it' : 'so' } }");
|
||||
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{ 'make' : { 'it' : 'so' } }");
|
||||
UUID readNotecardRequestId = (UUID)InvokeOpOnHost("JsonReadNotecard", so.UUID, receivingStoreId, "/", notecardName);
|
||||
Assert.That(readNotecardRequestId, Is.Not.EqualTo(UUID.Zero));
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
/// Describes where on the avatar the attachment is located
|
||||
/// </value>
|
||||
int Location { get ; }
|
||||
|
||||
|
||||
//// <value>
|
||||
/// Accessor to the rez'ed asset, representing the attachment
|
||||
/// </value>
|
||||
|
||||
@@ -30,7 +30,7 @@ using OpenMetaverse;
|
||||
using OpenMetaverse.Assets;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// This implements the methods needed to operate on individual inventory items.
|
||||
/// </summary>
|
||||
|
||||
@@ -60,19 +60,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
/// <summary>
|
||||
/// Returns whether or not this object is still in the world.
|
||||
/// Eg, if you store an IObject reference, however the object
|
||||
/// is deleted before you use it, it will throw a NullReference
|
||||
/// is deleted before you use it, it will throw a NullReference
|
||||
/// exception. 'Exists' allows you to check the object is still
|
||||
/// in play before utilizing it.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// IObject deleteMe = World.Objects[0];
|
||||
///
|
||||
///
|
||||
/// if (deleteMe.Exists) {
|
||||
/// deleteMe.Say("Hello, I still exist!");
|
||||
/// }
|
||||
///
|
||||
///
|
||||
/// World.Objects.Remove(deleteMe);
|
||||
///
|
||||
///
|
||||
/// if (!deleteMe.Exists) {
|
||||
/// Host.Console.Info("I was deleted");
|
||||
/// }
|
||||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
/// Objects should be near-guarunteed to exist for any event which
|
||||
/// passes them as an argument. Storing an object for a longer period
|
||||
/// of time however will limit their reliability.
|
||||
///
|
||||
///
|
||||
/// It is a good practice to use Try/Catch blocks handling for
|
||||
/// NullReferenceException, when accessing remote objects.
|
||||
/// </remarks>
|
||||
@@ -118,8 +118,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
IObject[] Children { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of materials attached to this object. Each may contain unique texture
|
||||
/// and other visual information. For primitive based objects, this correlates with
|
||||
/// Returns a list of materials attached to this object. Each may contain unique texture
|
||||
/// and other visual information. For primitive based objects, this correlates with
|
||||
/// Object Faces. For mesh based objects, this correlates with Materials.
|
||||
/// </summary>
|
||||
IObjectMaterial[] Materials { get; }
|
||||
@@ -152,7 +152,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
String TouchText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Text to be associated with this object, in the
|
||||
/// Text to be associated with this object, in the
|
||||
/// Second Life(r) viewer, this is shown above the
|
||||
/// object.
|
||||
/// </summary>
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
TaskInventoryItem m_privateItem;
|
||||
Scene m_rootScene;
|
||||
|
||||
|
||||
public InventoryItem(Scene rootScene, TaskInventoryItem internalItem)
|
||||
{
|
||||
m_rootScene = rootScene;
|
||||
@@ -77,10 +77,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
throw new ApplicationException("[MRM] There is no legal conversion from IInventoryItem to InventoryItem");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int Type { get { return m_privateItem.Type; } }
|
||||
public UUID AssetID { get { return m_privateItem.AssetID; } }
|
||||
|
||||
|
||||
// This method exposes OpenSim/OpenMetaverse internals and needs to be replaced with a IAsset specific to MRM.
|
||||
public T RetrieveAsset<T>() where T : OpenMetaverse.Assets.Asset, new()
|
||||
{
|
||||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
|
||||
if ((sbyte)result.AssetType != a.Type)
|
||||
throw new ApplicationException("[MRM] The supplied asset class does not match the found asset");
|
||||
|
||||
|
||||
result.AssetData = a.Data;
|
||||
result.Decode();
|
||||
return result;
|
||||
|
||||
@@ -35,7 +35,7 @@ using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
public class MicroScheduler : System.MarshalByRefObject, IMicrothreader
|
||||
public class MicroScheduler : System.MarshalByRefObject, IMicrothreader
|
||||
{
|
||||
private readonly List<IEnumerator> m_threads = new List<IEnumerator>();
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
get { return GetSOP().Description; }
|
||||
set
|
||||
{
|
||||
if (CanEdit())
|
||||
if (CanEdit())
|
||||
GetSOP().Description = value;
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
rets = new IObject[total];
|
||||
|
||||
int i = 0;
|
||||
|
||||
|
||||
foreach (SceneObjectPart part in my.ParentGroup.Parts)
|
||||
{
|
||||
rets[i++] = new SOPObject(m_rootScene, part.LocalId, m_security);
|
||||
@@ -273,8 +273,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
public Vector3 SitTarget
|
||||
{
|
||||
get { return GetSOP().SitTargetPosition; }
|
||||
set
|
||||
{
|
||||
set
|
||||
{
|
||||
if (CanEdit())
|
||||
{
|
||||
GetSOP().SitTargetPosition = value;
|
||||
@@ -285,8 +285,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
public string SitTargetText
|
||||
{
|
||||
get { return GetSOP().SitName; }
|
||||
set
|
||||
{
|
||||
set
|
||||
{
|
||||
if (CanEdit())
|
||||
{
|
||||
GetSOP().SitName = value;
|
||||
@@ -297,7 +297,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
public string TouchText
|
||||
{
|
||||
get { return GetSOP().TouchName; }
|
||||
set
|
||||
set
|
||||
{
|
||||
if (CanEdit())
|
||||
{
|
||||
@@ -309,7 +309,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
public string Text
|
||||
{
|
||||
get { return GetSOP().Text; }
|
||||
set
|
||||
set
|
||||
{
|
||||
if (CanEdit())
|
||||
{
|
||||
@@ -382,11 +382,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
public IObjectInventory Inventory
|
||||
public IObjectInventory Inventory
|
||||
{
|
||||
get { return new SOPObjectInventory(m_rootScene, GetSOP().TaskInventory); }
|
||||
}
|
||||
|
||||
|
||||
#region Public Functions
|
||||
|
||||
public void Say(string msg)
|
||||
@@ -406,7 +406,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
SceneObjectPart sop = GetSOP();
|
||||
m_rootScene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say,channel, sop.AbsolutePosition, sop.Name, sop.UUID, false);
|
||||
}
|
||||
|
||||
|
||||
public void Dialog(UUID avatar, string message, string[] buttons, int chat_channel)
|
||||
{
|
||||
if (!CanEdit())
|
||||
@@ -445,9 +445,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
dm.SendDialogToUser(
|
||||
avatar, GetSOP().Name, GetSOP().UUID, GetSOP().OwnerID,
|
||||
message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buttons);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -540,7 +540,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
if (hasCut) ret += 2;
|
||||
if (hasDimple) ret += 2;
|
||||
if (hasHollow)
|
||||
ret += 1; // GOTCHA: LSL shows 2 additional sides here.
|
||||
ret += 1; // GOTCHA: LSL shows 2 additional sides here.
|
||||
// This has been fixed, but may cause porting issues.
|
||||
break;
|
||||
case (int) PrimType.Torus:
|
||||
|
||||
@@ -61,25 +61,25 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object
|
||||
if (!m_publicInventory.ContainsKey(privateItem.ItemID))
|
||||
m_publicInventory.Add(privateItem.ItemID, new InventoryItem(m_rootScene, privateItem));
|
||||
}
|
||||
|
||||
|
||||
#region IDictionary<UUID, IInventoryItem> implementation
|
||||
public void Add (UUID key, IInventoryItem value)
|
||||
{
|
||||
m_publicInventory.Add(key, value);
|
||||
m_privateInventory.Add(key, InventoryItem.FromInterface(value).ToTaskInventoryItem());
|
||||
}
|
||||
|
||||
|
||||
public bool ContainsKey (UUID key)
|
||||
{
|
||||
return m_privateInventory.ContainsKey(key);
|
||||
}
|
||||
|
||||
|
||||
public bool Remove (UUID key)
|
||||
{
|
||||
m_publicInventory.Remove(key);
|
||||
return m_privateInventory.Remove(key);
|
||||
}
|
||||
|
||||
|
||||
public bool TryGetValue (UUID key, out IInventoryItem value)
|
||||
{
|
||||
value = null;
|
||||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object
|
||||
{
|
||||
// wasn't found in the public inventory
|
||||
TaskInventoryItem privateItem;
|
||||
|
||||
|
||||
result = m_privateInventory.TryGetValue(key, out privateItem);
|
||||
if (result)
|
||||
{
|
||||
@@ -98,16 +98,16 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object
|
||||
}
|
||||
} else
|
||||
return true;
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public ICollection<UUID> Keys {
|
||||
get {
|
||||
return m_privateInventory.Keys;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ICollection<IInventoryItem> Values {
|
||||
get {
|
||||
SynchronizeDictionaries();
|
||||
@@ -139,41 +139,41 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object
|
||||
{
|
||||
Add(item.Key, item.Value);
|
||||
}
|
||||
|
||||
|
||||
public void Clear ()
|
||||
{
|
||||
m_publicInventory.Clear();
|
||||
m_privateInventory.Clear();
|
||||
}
|
||||
|
||||
|
||||
public bool Contains (KeyValuePair<UUID, IInventoryItem> item)
|
||||
{
|
||||
return m_privateInventory.ContainsKey(item.Key);
|
||||
}
|
||||
|
||||
|
||||
public void CopyTo (KeyValuePair<UUID, IInventoryItem>[] array, int arrayIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
public bool Remove (KeyValuePair<UUID, IInventoryItem> item)
|
||||
{
|
||||
return Remove(item.Key);
|
||||
}
|
||||
|
||||
|
||||
public int Count {
|
||||
get {
|
||||
return m_privateInventory.Count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool IsReadOnly {
|
||||
get {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Explicit implementations
|
||||
IInventoryItem System.Collections.Generic.IDictionary<UUID, IInventoryItem>.this[UUID key]
|
||||
{
|
||||
@@ -189,13 +189,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object
|
||||
m_privateInventory[key] = InventoryItem.FromInterface(value).ToTaskInventoryItem();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<UUID, IInventoryItem>>.CopyTo(System.Collections.Generic.KeyValuePair<UUID,IInventoryItem>[] array, int offset)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
public IInventoryItem this[string name]
|
||||
{
|
||||
get {
|
||||
@@ -204,7 +204,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object
|
||||
{
|
||||
if (!m_publicInventory.ContainsKey(i.ItemID))
|
||||
m_publicInventory.Add(i.ItemID, new InventoryItem(m_rootScene, i));
|
||||
|
||||
|
||||
return m_publicInventory[i.ItemID];
|
||||
}
|
||||
throw new KeyNotFoundException();
|
||||
|
||||
@@ -70,18 +70,18 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
get { return GetSP().AbsolutePosition; }
|
||||
set { GetSP().Teleport(value); }
|
||||
}
|
||||
|
||||
|
||||
public bool IsChildAgent
|
||||
{
|
||||
get { return GetSP().IsChildAgent; }
|
||||
}
|
||||
|
||||
|
||||
#region IAvatar implementation
|
||||
public IAvatarAttachment[] Attachments
|
||||
{
|
||||
get {
|
||||
List<IAvatarAttachment> attachments = new List<IAvatarAttachment>();
|
||||
|
||||
|
||||
List<AvatarAttachment> internalAttachments = GetSP().Appearance.GetAttachments();
|
||||
foreach (AvatarAttachment attach in internalAttachments)
|
||||
{
|
||||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
new UUID(attach.ItemID),
|
||||
new UUID(attach.AssetID), m_security));
|
||||
}
|
||||
|
||||
|
||||
return attachments.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
private readonly UUID m_assetId;
|
||||
|
||||
private readonly ISecurityCredential m_security;
|
||||
|
||||
|
||||
public SPAvatarAttachment(Scene rootScene, IAvatar self, int location, UUID itemId, UUID assetId, ISecurityCredential security)
|
||||
{
|
||||
m_rootScene = rootScene;
|
||||
@@ -51,9 +51,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
//m_itemId = itemId;
|
||||
m_assetId = assetId;
|
||||
}
|
||||
|
||||
|
||||
public int Location { get { return m_location; } }
|
||||
|
||||
|
||||
public IObject Asset
|
||||
{
|
||||
get
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenSim
|
||||
|
||||
public void Microthread(IEnumerable thread)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void RunMicrothread()
|
||||
@@ -92,7 +92,7 @@ namespace OpenSim
|
||||
|
||||
public override void Stop()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ using OpenSim.Region.OptionalModules.Scripting.Minimodule.WorldX;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
public class World : System.MarshalByRefObject, IWorld, IWorldAudio
|
||||
public class World : System.MarshalByRefObject, IWorld, IWorldAudio
|
||||
{
|
||||
private readonly Scene m_internalScene;
|
||||
private readonly ISecurityCredential m_security;
|
||||
@@ -149,7 +149,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
e.Sender = new SOPObject(m_internalScene, ((SceneObjectPart) chat.SenderObject).LocalId, m_security);
|
||||
e.Text = chat.Message;
|
||||
e.Channel = chat.Channel;
|
||||
|
||||
|
||||
_OnChat(this, e);
|
||||
return;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID, m_security);
|
||||
e.Text = chat.Message;
|
||||
e.Channel = chat.Channel;
|
||||
|
||||
|
||||
_OnChat(this, e);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RegionReadyModule")]
|
||||
public class RegionReadyModule : IRegionReadyModule, INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IConfig m_config = null;
|
||||
@@ -57,24 +57,24 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
private bool m_enabled = false;
|
||||
private bool m_disable_logins;
|
||||
private string m_uri = string.Empty;
|
||||
|
||||
|
||||
Scene m_scene;
|
||||
|
||||
|
||||
#region INonSharedRegionModule interface
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
m_config = config.Configs["RegionReady"];
|
||||
if (m_config != null)
|
||||
if (m_config != null)
|
||||
{
|
||||
m_enabled = m_config.GetBoolean("enabled", false);
|
||||
|
||||
if (m_enabled)
|
||||
|
||||
if (m_enabled)
|
||||
{
|
||||
m_channelNotify = m_config.GetInt("channel_notify", m_channelNotify);
|
||||
m_disable_logins = m_config.GetBoolean("login_disable", false);
|
||||
@@ -106,7 +106,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
|
||||
|
||||
// This should always show up to the user but should not trigger warn/errors as these messages are
|
||||
// expected and are not simulator problems. Ideally, there would be a status level in log4net but
|
||||
// expected and are not simulator problems. Ideally, there would be a status level in log4net but
|
||||
// failing that, we will print out to console instead.
|
||||
MainConsole.Instance.OutputFormat("Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name);
|
||||
|
||||
@@ -152,12 +152,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
{
|
||||
m_log.DebugFormat("[RegionReady]: Script compile queue empty!");
|
||||
|
||||
if (m_firstEmptyCompileQueue || m_oarFileLoading)
|
||||
if (m_firstEmptyCompileQueue || m_oarFileLoading)
|
||||
{
|
||||
OSChatMessage c = new OSChatMessage();
|
||||
if (m_firstEmptyCompileQueue)
|
||||
if (m_firstEmptyCompileQueue)
|
||||
c.Message = "server_startup,";
|
||||
else
|
||||
else
|
||||
c.Message = "oar_file_load,";
|
||||
m_firstEmptyCompileQueue = false;
|
||||
m_oarFileLoading = false;
|
||||
@@ -165,7 +165,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
m_scene.Backup(false);
|
||||
|
||||
c.From = "RegionReady";
|
||||
if (m_lastOarLoadedOk)
|
||||
if (m_lastOarLoadedOk)
|
||||
c.Message += "1,";
|
||||
else
|
||||
c.Message += "0,";
|
||||
@@ -193,7 +193,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
{
|
||||
m_oarFileLoading = true;
|
||||
|
||||
if (message==String.Empty)
|
||||
if (message==String.Empty)
|
||||
{
|
||||
m_lastOarLoadedOk = true;
|
||||
}
|
||||
@@ -226,7 +226,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
// m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
|
||||
|
||||
// Putting this out to console to make it eye-catching for people who are running OpenSimulator
|
||||
// without info log messages enabled. Making this a warning is arguably misleading since it isn't a
|
||||
// without info log messages enabled. Making this a warning is arguably misleading since it isn't a
|
||||
// warning, and monitor scripts looking for warn/error/fatal messages will received false positives.
|
||||
// Arguably, log4net needs a status log level (like Apache).
|
||||
MainConsole.Instance.OutputFormat("INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name);
|
||||
@@ -256,7 +256,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
// m_scene.EventManager.OnRezScript += OnRezScript;
|
||||
// m_oarFileLoading = true;
|
||||
// m_firstEmptyCompileQueue = true;
|
||||
//
|
||||
//
|
||||
// m_scene.LoginsDisabled = true;
|
||||
// m_scene.LoginLock = true;
|
||||
// if ( m_uri != string.Empty )
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
|
||||
public class XmlRpcGridRouter : INonSharedRegionModule, IXmlRpcRouter
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
|
||||
private Dictionary<UUID, UUID> m_Channels =
|
||||
new Dictionary<UUID, UUID>();
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
|
||||
{
|
||||
scriptEngine.OnScriptRemoved += this.ScriptRemoved;
|
||||
scriptEngine.OnObjectRemoved += this.ObjectRemoved;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
m_log.InfoFormat("[XMLRPC GRID ROUTER]: New receiver Obj: {0} Ch: {1} ID: {2} URI: {3}",
|
||||
m_log.InfoFormat("[XMLRPC GRID ROUTER]: New receiver Obj: {0} Ch: {1} ID: {2} URI: {3}",
|
||||
objectID.ToString(), channel.ToString(), itemID.ToString(), uri);
|
||||
|
||||
XmlRpcInfo info = new XmlRpcInfo();
|
||||
|
||||
Reference in New Issue
Block a user