Skip to content

Commit

Permalink
Parity: Fix some return values
Browse files Browse the repository at this point in the history
  • Loading branch information
zontreck committed Nov 7, 2023
1 parent f29ec1b commit 9613376
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
14 changes: 11 additions & 3 deletions OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5884,8 +5884,11 @@ public void DeserializeLinksetData(Byte[] data)
/// Adds or updates a entry to linkset data
/// </summary>
/// <returns>-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</returns>
/// 1 if the data could not be added or updated due to memory
/// 2 if the data is unchanged
/// </returns>
public int AddOrUpdateLinksetDataKey(string key, string value, string pass)
{
lock (linksetDataLock)
Expand All @@ -5900,13 +5903,16 @@ 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;
}
else return -1;
}
else
{
if(original != null)
if (original.val == value) return 2;
pd = new LinksetDataEntry(value, pass);
LinksetData[key] = pd;
}
Expand Down Expand Up @@ -5946,9 +5952,11 @@ public string ReadLinksetData(string name, string pass)
/// <summary>
/// Deletes a named key from the key value store
/// </summary>
/// <returns>0 if successful.
/// <returns>
/// 0 if successful.
/// 1 if not due to the password.
/// -1 if no such key was found</returns>
/// -1 if no such key was found
/// </returns>
public int DeleteLinksetDataKey(string key, string pass)
{
lock (linksetDataLock)
Expand Down
10 changes: 5 additions & 5 deletions OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 9613376

Please sign in to comment.