From fb48ee1cb608f5facdcd257f13a7e49c2ce52946 Mon Sep 17 00:00:00 2001 From: ft@noemail Date: Wed, 4 Mar 2015 00:17:24 +0100 Subject: corrected script notecard parser. It now handles notecards with inventory as well. Signed-off-by: BlueWall --- .../OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index b69676b..edf51a2 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs @@ -595,11 +595,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore try { - string jsondata = SLUtil.ParseNotecardToString(Encoding.UTF8.GetString(a.Data)); + string jsondata = SLUtil.ParseNotecardToString(a.Data); int result = m_store.SetValue(storeID, path, jsondata,true) ? 1 : 0; m_comms.DispatchReply(scriptID, result, "", reqID.ToString()); return; } + catch(SLUtil.NotANotecardFormatException e) + { + m_log.WarnFormat("[JsonStoreScripts]: Notecard parsing failed; assetId {0} at line number {1}", assetID.ToString(), e.lineNumber); + } catch (Exception e) { m_log.WarnFormat("[JsonStoreScripts]: Json parsing failed; {0}", e.Message); -- cgit v1.1