From 21f9ce2a604b53cec8d034cab43c117498d0f1ec Mon Sep 17 00:00:00 2001 From: Mike Dickson Date: Wed, 15 Nov 2023 11:58:32 -0500 Subject: [PATCH] Update LSL support for LinksetData to use string.Empty where appropriate --- .../Shared/Api/Implementation/LSL_Api.cs | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a72797d9118..2fd4ccaa110 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -18801,24 +18801,27 @@ public LSL_String llReplaceSubString(LSL_String src, LSL_String pattern, LSL_Str public LSL_Integer llLinksetDataWrite(LSL_String name, LSL_String value) { - return llLinksetDataWriteProtected(name, value, ""); + return llLinksetDataWriteProtected(name, value, string.Empty); } public LSL_Integer llLinksetDataWriteProtected(LSL_String name, LSL_String value, LSL_String pass) { - if (name == "") return ScriptBaseClass.LINKSETDATA_ENOKEY; + if (name == "") + return ScriptBaseClass.LINKSETDATA_ENOKEY; + var rootPrim = m_host.ParentGroup.RootPart; int ret = rootPrim.AddOrUpdateLinksetDataKey(name, value, pass); object[] parameters = new object[] { - new LSL_Integer(ScriptBaseClass.LINKSETDATA_UPDATE), name, "" + new LSL_Integer(ScriptBaseClass.LINKSETDATA_UPDATE), name, string.Empty }; if (ret == 0) { m_ScriptEngine.PostObjectEvent(rootPrim.LocalId, new EventParams("linkset_data", parameters, Array.Empty())); + return ScriptBaseClass.LINKSETDATA_OK; } else @@ -18826,9 +18829,15 @@ public LSL_Integer llLinksetDataWriteProtected(LSL_String name, LSL_String value if (ret == 1) { return ScriptBaseClass.LINKSETDATA_EMEMORY; - }else if (ret == 2) + } + else if (ret == 2) + { return ScriptBaseClass.LINKSETDATA_NOUPDATE; - else return ScriptBaseClass.LINKSETDATA_EPROTECTED; + } + else + { + return ScriptBaseClass.LINKSETDATA_EPROTECTED; + } } } @@ -18837,9 +18846,10 @@ public void llLinksetDataReset() var rootPrim = m_host.ParentGroup.RootPart; rootPrim.ResetLinksetData(); + object[] parameters = new object[] { - new LSL_Integer(ScriptBaseClass.LINKSETDATA_RESET), new LSL_String(""), new LSL_String("") + new LSL_Integer(ScriptBaseClass.LINKSETDATA_RESET), new LSL_String(string.Empty), new LSL_String(string.Empty) }; EventParams linksetdata_params = new EventParams("linkset_data", parameters, Array.Empty()); @@ -18860,7 +18870,7 @@ public LSL_Integer llLinksetDataCountKeys() public LSL_Integer llLinksetDataDelete(LSL_String name) { - return llLinksetDataDeleteProtected(name, ""); + return llLinksetDataDeleteProtected(name, string.Empty); } public LSL_List llLinksetDataDeleteFound(LSL_String pattern, LSL_String pass) @@ -18874,7 +18884,7 @@ public LSL_List llLinksetDataDeleteFound(LSL_String pattern, LSL_String pass) object[] parameters = new object[] { - new LSL_Integer(ScriptBaseClass.LINKSETDATA_MULTIDELETE), new LSL_String(removed_keys), new LSL_String("") + new LSL_Integer(ScriptBaseClass.LINKSETDATA_MULTIDELETE), new LSL_String(removed_keys), new LSL_String(string.Empty) }; if (deleted > 0) @@ -18904,7 +18914,7 @@ public LSL_Integer llLinksetDataDeleteProtected(LSL_String name, LSL_String pass { parameters = new object[] { - new LSL_Integer(ScriptBaseClass.LINKSETDATA_OK), name, new LSL_String("") + new LSL_Integer(ScriptBaseClass.LINKSETDATA_OK), name, new LSL_String(string.Empty) }; } else if (ret == 1) @@ -18934,7 +18944,7 @@ public LSL_List llLinksetDataListKeys(LSL_Integer start, LSL_Integer count) public LSL_String llLinksetDataRead(LSL_String name) { - return llLinksetDataReadProtected(name, ""); + return llLinksetDataReadProtected(name, string.Empty); } public LSL_String llLinksetDataReadProtected(LSL_String name, LSL_String pass)