From 961337661825f96663f675c6dce2f3d15c06b75c Mon Sep 17 00:00:00 2001 From: zontreck Date: Mon, 6 Nov 2023 19:35:38 -0700 Subject: [PATCH] Parity: Fix some return values --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 14 +++++++++++--- .../Shared/Api/Implementation/LSL_Api.cs | 10 +++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index d578765b922..1954bf1fe53 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -5884,8 +5884,11 @@ public void DeserializeLinksetData(Byte[] data) /// Adds or updates a entry to linkset data /// /// -1 if the password did not match + /// -1 is the data was protected /// 0 if the data was successfully added or updated - /// 1 if the data could not be added or updated due to memory + /// 1 if the data could not be added or updated due to memory + /// 2 if the data is unchanged + /// public int AddOrUpdateLinksetDataKey(string key, string value, string pass) { lock (linksetDataLock) @@ -5900,6 +5903,7 @@ public int AddOrUpdateLinksetDataKey(string key, string value, string pass) { if (original.test(pass)) { + if (original.val == value) return 2; pd=new LinksetDataEntry(value, pass); LinksetData[key] = pd; } @@ -5907,6 +5911,8 @@ public int AddOrUpdateLinksetDataKey(string key, string value, string pass) } else { + if(original != null) + if (original.val == value) return 2; pd = new LinksetDataEntry(value, pass); LinksetData[key] = pd; } @@ -5946,9 +5952,11 @@ public string ReadLinksetData(string name, string pass) /// /// Deletes a named key from the key value store /// - /// 0 if successful. + /// + /// 0 if successful. /// 1 if not due to the password. - /// -1 if no such key was found + /// -1 if no such key was found + /// public int DeleteLinksetDataKey(string key, string pass) { lock (linksetDataLock) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 48789cb74a0..105095fab15 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -18826,9 +18826,9 @@ public LSL_Integer llLinksetDataWriteProtected(LSL_String name, LSL_String value if (ret == 1) { return ScriptBaseClass.LINKSETDATA_EMEMORY; - } - - return ScriptBaseClass.LINKSETDATA_NOUPDATE; + }else if (ret == 2) + return ScriptBaseClass.LINKSETDATA_NOUPDATE; + else return ScriptBaseClass.LINKSETDATA_EPROTECTED; } } @@ -18902,9 +18902,9 @@ public LSL_Integer llLinksetDataDeleteProtected(LSL_String name, LSL_String pass } else if (ret == 1) { - return new LSL_Integer(ScriptBaseClass.LINKSETDATA_NOTFOUND); + return new LSL_Integer(ScriptBaseClass.LINKSETDATA_EPROTECTED); } - else + else if(ret == -1) { return new LSL_Integer(ScriptBaseClass.LINKSETDATA_NOTFOUND); }