-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LinkSet Data feature from SL #64
Conversation
… 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.
… 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.
…here is no linkdata on a prim. Previously it was left off an being explicitely set and the connector considers that an error.
okay, i have it working, but YEngine needs to be fixed at some point. It appears to be running statements out of sync. for instance... EDIT: Updated the script and the sample output to include my final patches S([llLinksetDataWrite("Test-001", "This is a test"), llLinksetDataAvailable()]); Should output
Instead, it outputs
As if it called the data available function and caches the value before it finishes evaluating the statement to write. This is a separate issue from Linksetdata of course, but just a inconsistency i am noting. I am going to add the two remaining new functions, that were not in this patch previously. Then it is ready. Here is a test script Expected Outputs
Script
S(string name, list X)
{
llOwnerSay("[ " + name + " ] : "+llDumpList2String(X," ~ "));
}
default
{
state_entry()
{
S("BEGIN", [ "MARK BEGIN" ]);
llLinksetDataReset();
S("COUNT", [llLinksetDataCountKeys()]);
S("LIST", llLinksetDataListKeys(0, llLinksetDataCountKeys())); // Should output nothing at this stage
S("FREE MEM", [llLinksetDataAvailable()]);
S("Write 001", [llLinksetDataWrite("Test-001", "This is a test"), llLinksetDataAvailable()]);
S("Delete 002", [llLinksetDataDelete("Test-002"), llLinksetDataAvailable()]); // Outputs 4, not found
S("Write Protected 003", [llLinksetDataWriteProtected("Test-003", "Testing", "Pass"), llLinksetDataAvailable()]);
S("Protection Test", [llLinksetDataWriteProtected("Test-003", "Testing", "PassInvalid"), llLinksetDataRead("Test-003"), llLinksetDataReadProtected("Test-003", "Pass")]);
S("Delete 003", [llLinksetDataDelete("Test-003"), llLinksetDataAvailable()]);
S("Delete w/ false key 003", [llLinksetDataDeleteProtected("Test-003", "PassInvalid"), llLinksetDataAvailable()]);
S("Delete w/ key 003", [llLinksetDataDeleteProtected("Test-003", "Pass"), llLinksetDataAvailable()]);
S("Write protected 004", [llLinksetDataWriteProtected("Test-004","Val", "NoMultiDelete"), llLinksetDataAvailable()]);
S("Write protected 005", [llLinksetDataWriteProtected("Test-005","Val", "NoMultiDelete"), llLinksetDataAvailable()]);
S("Write 006", [llLinksetDataWrite("Test-006", "Value"), llLinksetDataAvailable()]);
S("Delete w/ false key 006", [llLinksetDataDeleteProtected("Test-006", "Pass"), llLinksetDataAvailable()]);
S("Read w/ false key 006", [llLinksetDataReadProtected("Test-006", "Pass")]);
S("Write to not be found", [llLinksetDataWrite("NotHere-001", "Testing"), llLinksetDataAvailable()]);
S("Read 001", [llLinksetDataRead("Test-001")]);
S("COUNT", [llLinksetDataCountKeys()]);
S("LIST", llLinksetDataListKeys(0, llLinksetDataCountKeys()));
S("FREE MEM", [llLinksetDataAvailable()]);
S("COUNT 'Test'", [llLinksetDataCountFound("Test")]);
S("MultiDelete Test", llLinksetDataDeleteFound("Test", "") + llLinksetDataDeleteFound("Test", "NoMultiDelete"));
llLinksetDataReset();
S("END", [ "MARK END" ]);
}
linkset_data(integer action, string K, string V)
{
S("Event", [action, K, V]);
}
} |
On further testing, it seems, and this is a separate issue altogether, but SL evaluates statements left to right, and YEngine is evaluating from right to left. |
…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.
…ction 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.
…phabetic 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.
…rom a list we are traversing. Also a potential lock contention issue.
…ld 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.
…etData field. This way we match more closely SL semantics. We'll still serialize in json text format when writing to the database.
… we iterate the copied list. deleted and not_deleted only apply to matches, not all the entries. Thx to Aria for the review comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LSL Stub needs to be updated
...penSim.Data.MySQL.MoneyData/OpenSim.Data.MySQL.MoneyData/OpenSim.Data.MySQL.MoneyData.csproj
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the possible unneeded using statements are okay, then looks good to me!
…it to Opensim.Region.Framework
…C/OpenSim-Sasquatch into feature/zontreck-linkset-data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Changeset with code from Zontreck (Aria) that had originally been posted to OpenSim Core Mantis with permission. The Core team refused the changes. I had to make a few small changes because this branch is still targeting Mono and only implements C# 7.3 and a few C# 8.0 features were used. It's otherwise essentially as it was submitted. Many thanks to Zontreck for making this feature available to our users!