Skip to content

Commit

Permalink
For LinkSetData Find and returning a list of keys a count value of < …
Browse files Browse the repository at this point in the history
…1 is an indication to return all available. Adjust the code to behave that way. It was originally looking at -1 as an indication to do that.
  • Loading branch information
mdickson committed Nov 13, 2023
1 parent 646b345 commit 017381a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion OpenSim/Framework/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class VersionInfo
{
public const string VersionNumber = "0.9.2.2";
public const string AssemblyVersionNumber = "0.9.2.2";
public const string Release = "8711";
public const string Release = "8717";

public static string Version
{
Expand Down
12 changes: 8 additions & 4 deletions OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5819,14 +5819,18 @@ public void DeSerializeAnimations(Byte[] data)

public string[] FindLinksetDataKeys(string pattern, int start, int count)
{
List<string> all_keys = new List<string>(GetLinksetDataSubList(0, -1));
List<string> all_keys = new List<string>(GetLinksetDataSubList(0, 0));
RegexOptions options = RegexOptions.CultureInvariant;
Regex rx = new Regex(pattern, options);
if (count == -1) count = all_keys.Count;

if (count < 1)
count = all_keys.Count;

List<string> matches = new List<string>();
foreach (var str in all_keys)
{
if(rx.IsMatch(str)) matches.Add(str);
if (rx.IsMatch(str))
matches.Add(str);
}

return matches.Skip(start).Take(count).ToArray();
Expand Down Expand Up @@ -5984,7 +5988,7 @@ public string[] GetLinksetDataSubList(int start, int count)
{
lock (linksetDataLock)
{
if (count == -1)
if (count < 1)
count = LinksetDataKeys;

if (LinksetData == null)
Expand Down

0 comments on commit 017381a

Please sign in to comment.