forked from opensim/opensim
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Manually applied the Linkset Data patch from zontreck (Aria) that had been posted to OpenSim Core Mantis with permission. I had to make a few small changes because this branch is still targetting Mono and only implements C# 7.3 and a few C# 8.0 features were used. It's otherwise essentially as it was submitted. * Add using around binary compression of linksetdata so that Dispose is called correctly on completion. Remove the IsRoot check in BuildPrims for linksetdata. At this stage we don't yet have a fully instantiated prim so the SOG is undefined. * Declare and set linksetdata to null when updating prims table where there is no linkdata on a prim. Previously it was left off an being explicitely set and the connector considers that an error. * Update the script syntax XML * Apparently forgot to add the Read and Delete protected methods * Rewrite null checks for older dot net * Update linkset data accounting on reset * Rename ProtectedData to LinksetDataEntry * Fix protected attribute not being set on new entries * Add the new linkset data functions * Finish adding remaining linkset data functions * Fix a compile error due to typo * Parity: Don't send value on write protected in event * Do some code cleanup and fixes in multi-delete function * Parity: When testing passwords, even for unsecured values, treat as secured * Parity: Fix some return values * Oops... compile error * Fix up a few CodqQL scanner errors. * For LinkSetData Find and returning a list of keys a count value of < 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. * Reformat LinksetDataEntry to be consistent with coding standards. Function and Property names are MixedCase with Initial upper case letter. Changed references to empty strings to use string.Empty and tests to use string.IsNullOrEmpty in the LinksetDataEntry data model class. * Change the underlying storage to a SortedList so we return keys in alphabetic order as required. This is a lightweight list with Dictionary behaviour added. Mark the SOG dirty on operations that change the LinksetData field so persistence is reliable. Rework the support functions to use string.Empty and string.IsNullOrEmpty where needed. Cleaned up what should be the last of the CodeQL comments. * Fix list handling in llLinksetDataDeleteFound, we can't delete keys from a list we are traversing. Also a potential lock contention issue. * Update LSL support for LinksetData to use string.Empty where appropriate * Rework the scheme migration to use MEDIUMTEXT for the linksetdata field and to serialize/deserialize to/from JSON. We calculate size based on the size of the serialization which means there is a little bit of overhead for each field. We'll also let things go slightly over 128k to simplify the cost accounting but the field we're using can store well beyond 128k so thats not an issue. * Revert to using a binary count for the space accounting for the linksetData field. This way we match more closely SL semantics. We'll still serialize in json text format when writing to the database. * For llLinksetDeleteFound take a copy of the KVP's so we can delete as we iterate the copied list. deleted and not_deleted only apply to matches, not all the entries. Thx to Aria for the review comments. * Add missing stub functions * Cleaned unused System.Text.Json references in Data namespaces. Added it to Opensim.Region.Framework --------- Co-authored-by: zontreck <[email protected]>
- Loading branch information
Showing
23 changed files
with
1,049 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace OpenSim.Region.Framework.Scenes | ||
{ | ||
public class LinksetDataEntry | ||
{ | ||
public LinksetDataEntry(string value, string password) | ||
{ | ||
this.Value = value; | ||
this.Password = password; | ||
} | ||
|
||
public string Value { get; private set; } | ||
public string Password { get; private set; } = string.Empty; | ||
|
||
public bool IsProtected() | ||
{ | ||
return (string.IsNullOrEmpty(this.Password) == false); | ||
} | ||
|
||
public bool CheckPassword(string pass) | ||
{ | ||
// A undocumented caveat for LinksetData appears to be that even for unprotected values, if a pass is provided, it is still treated as protected | ||
if (this.Password == pass) | ||
return true; | ||
else | ||
return false; | ||
} | ||
|
||
public string CheckPasswordAndGetValue(string pass) | ||
{ | ||
if (string.IsNullOrEmpty(this.Password) || (this.Password == pass)) | ||
return this.Value; | ||
else | ||
return string.Empty; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.