From f06394f19509516005aa7003a6e5e599ad8b7df0 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Tue, 11 Sep 2012 16:42:07 -0700 Subject: Allow an incoming identifier to be specified for a JsonStore. --- .../OptionalModules/Scripting/JsonStore/JsonStoreModule.cs | 14 +++++++------- .../Scripting/JsonStore/JsonStoreScriptModule.cs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore') diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs index 311531c..732c28f 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs @@ -175,14 +175,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore /// /// // ----------------------------------------------------------------- - public bool CreateStore(string value, out UUID result) + public bool CreateStore(string value, ref UUID result) { - result = UUID.Zero; + if (result == UUID.Zero) + result = UUID.Random(); + + JsonStore map = null; if (! m_enabled) return false; - UUID uuid = UUID.Random(); - JsonStore map = null; try { @@ -195,9 +196,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore } lock (m_JsonValueStore) - m_JsonValueStore.Add(uuid,map); + m_JsonValueStore.Add(result,map); - result = uuid; return true; } @@ -231,7 +231,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore if (! m_JsonValueStore.TryGetValue(storeID,out map)) { m_log.InfoFormat("[JsonStore] Missing store {0}",storeID); - return true; + return false; } } diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index eaba816..6910d14 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs @@ -227,7 +227,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore protected UUID JsonCreateStore(UUID hostID, UUID scriptID, string value) { UUID uuid = UUID.Zero; - if (! m_store.CreateStore(value, out uuid)) + if (! m_store.CreateStore(value, ref uuid)) GenerateRuntimeError("Failed to create Json store"); return uuid; -- cgit v1.1 From 0d15a6a01feeb129b015f7516fd13a541b3e6fce Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 12 Nov 2012 19:18:20 +0000 Subject: Remove any mention of IRegionModule from region names and comments to aid grepping for remaining uses --- OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs | 2 +- .../Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore') diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs index 732c28f..e68764a 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs @@ -59,7 +59,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore private Dictionary m_JsonValueStore; private UUID m_sharedStore; -#region IRegionModule Members +#region Region Module interface // ----------------------------------------------------------------- /// diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index 6910d14..0c175ca 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore private IScriptModuleComms m_comms; private IJsonStoreModule m_store; -#region IRegionModule Members +#region Region Module interface // ----------------------------------------------------------------- /// -- cgit v1.1