Commit Graph

762 Commits

Author SHA1 Message Date
UbitUmarov
25ad17d068 mantis 9230: flag need for prims inventory saves in more 9un0link cases 2026-01-24 21:40:00 +00:00
UbitUmarov
4833652d9b let osNpcPlayAnimation play any animation from asset service, if a uuid is provided, instead of only default animations 2026-01-14 02:46:18 +00:00
Vincent Sylvester
67e7dbc2e2 Cosmetics, unnecessary strings
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
2025-09-16 18:43:22 +01:00
UbitUmarov
0d71b6d871 very useless changes 2025-06-25 02:22:28 +01:00
UbitUmarov
0fa1d54d5b typo 2025-05-09 21:28:47 +01:00
UbitUmarov
d92940b62b add functions osListAs*(list src, integer index) identical to llList2*, but a bit faster with no typecast and index only from origin ( ie >= 0) 2025-05-09 20:00:19 +01:00
UbitUmarov
ef2fce034f a few , mostly cosmetic, changes to osSetTerrainTextures and add prim inventory osSetTerrainTextures with a list of possible asset types to match 2025-05-06 23:40:40 +01:00
UbitUmarov
23ad195e7a add osSetTerrainTextures(LSL_List textures, LSL_Integer types) to set terrain textures for legacy viewers it types == 0 or 2; textures for new viewers if types == 1 or 2 or PBR materials if types == 1 (untested :( ) 2025-05-06 01:29:24 +01:00
Vincent Sylvester
1847b6be24 Tooltips for ossl
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
2025-05-01 18:54:57 +01:00
UbitUmarov
4b5d9c0696 ooops 2025-04-12 04:10:05 +01:00
UbitUmarov
47e9a13e2b ugly cosmetics 2025-04-11 20:49:05 +01:00
UbitUmarov
d76f0437cd ugly cosmetics 2025-04-11 20:19:49 +01:00
UbitUmarov
748d7d08db a few more chances also the the ossl version 2025-04-11 18:57:42 +01:00
UbitUmarov
e862eab358 allow negative instance to also index results from end (bad) on osListFindListNext. Untested, sorry 2025-04-04 11:13:11 +01:00
UbitUmarov
bde18322eb add LSL_Integer osListFindListNext(LSL_List src, LSL_List test, LSL_Integer lstart, LSL_Integer lend, LSL_Integer instance), like ll one but with search restricted to a substring. Untested, sorry 2025-04-04 01:30:41 +01:00
UbitUmarov
1ff28960f1 cosmetics 2024-11-19 04:25:32 +00:00
UbitUmarov
27361a4472 miss one minor changes, for coerence 2024-09-16 21:20:15 +01:00
UbitUmarov
833d8f4991 minor changes 2024-09-16 21:08:11 +01:00
Adil El Farissi
70f3b02f65 Fixing changes 2024-09-15 22:09:24 +00:00
Adil El Farissi
c2eb8083cb Revert "Re-sync repo"
This reverts commit 1c214566f3.
2024-08-21 02:52:29 +00:00
Adil El Farissi
1c214566f3 Re-sync repo 2024-08-21 00:20:35 +00:00
Adil El Farissi
3bcc96e42d Merge branch 'opensim:master' into master 2024-06-13 22:21:39 +00:00
UbitUmarov
54fe5747ea add storage for pbr terrain feature that viewers for opensim may add 2024-06-08 21:58:46 +01:00
Adil El Farissi
6ab23c8d6b Merge branch 'opensim:master' into master 2024-06-07 21:03:53 +00:00
UbitUmarov
ecdc979687 oops it is sRGB not linear, so rename to osTemperature2sRGB 2024-06-04 09:46:11 +01:00
UbitUmarov
1d9d39328d add osTemperatureToLinearColor() 2024-06-04 09:05:03 +01:00
UbitUmarov
30586b34f6 replace Util.Clamp<T>() 2024-06-04 09:01:10 +01:00
UbitUmarov
270427ba2a add vector osGetLinkColor(LSL_Integer linknum, LSL_Integer face) 2024-05-18 22:17:10 +01:00
Adil El Farissi
cc79aa0c23 Add selfsigned certificates support to Robust and osGetLinkInventoryKeys plus some fixes 2024-03-29 03:56:03 +00:00
AdilElFarissi
88704a641f Merge branch 'opensim:master' into master 2024-03-26 22:16:17 +00:00
UbitUmarov
acbec23f48 clean appdomain related things 2024-03-26 21:34:33 +00:00
UbitUmarov
782bad9944 and rename it again as just osGetLinkInventoryKey, so it is coerent with llGetInventoryKey (mantis 9119) 2024-03-26 18:32:05 +00:00
UbitUmarov
7c63ff1150 rename new osGetLinkInventoryItemKey as osGetLinkInventoryItemAssetKey 2024-03-24 11:34:23 +00:00
Jeff Kelley
1aa7bea608 osGetLinkInventoryAssetKey
deleted:    bin/System.Drawing.Common.dll

Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
2024-03-24 11:25:09 +00:00
AdilElFarissi
3542d5461b Merge branch 'opensim:master' into master 2024-03-19 21:50:59 +00:00
UbitUmarov
6afa7d564b same for osGetLinkInventoryItemKeys 2024-03-05 19:04:36 +00:00
UbitUmarov
c618c4a6c4 rename the new osGetInventoryKeys as osgetinventoryitemkeys and osgetlinkinventorykey as osgetinventoryitemkey for coerence and to make clear that key means the item key within prim inventory and not its asset key as in ll funtion 2024-03-05 18:51:42 +00:00
Jeff Kelley
d58f9f0f5d osGetSitTarget
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
2024-02-29 20:28:20 +00:00
Adil El Farissi
df8fe33007 Last cosmetics and PHP/LSL test scripts
All is working fine :)

The following script send a request to the PHP file where the encrypted  string using osAESEncrypt() is decrypted and re-encrypted using the PHP openssl_XXXX. the return is the original string and the re-encrypted separated by "|"... the script decrypt the returned re-encrypted using osAESDecrypt() and log it in the chat.

LSL script:
<pre><code>
// Change the url to point to your PHP file.
string url =  "http://127.0.0.1/aesTest.php";
string plainText = "Hello World :)";
string secret = "#!qUeRtY$@123^456€!#";
key r_id;

default
{
    touch_start(integer i)
    {
        string encryptedText = osAESEncrypt(secret, plainText);
        llOwnerSay("\nEncrypted with osAESEncrypt:\n"+ encryptedText);

        r_id = llHTTPRequest(url, [HTTP_METHOD,"POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded",HTTP_BODY_MAXLENGTH,"16384"], "data="+ encryptedText);
    }

    http_response(key id, integer status, list metaData, string Response){
        if(status = 200 ){
            if(id == r_id){
                if(Response != ""){
                    list temp = llParseString2List(Response,"|",[]);
                    llOwnerSay("\nDecrypted using PHP openssl_decrypt:\n"+ llList2String(temp,0));
                    llOwnerSay("\nEncrypted using PHP openssl_encrypt:\n"+ llList2String(temp,1));
                    string decryptedText = osAESDecrypt(secret, llList2String(temp,1));
                    llOwnerSay("\nDecrypted with osAESDecrypt from PHP:\n"+ decryptedText);
                }
                else{
                    llOwnerSay("Enc/Dec Failed! Response:\n"+ Response);
                }
            }
        }
        else{
             llOwnerSay("Destination not available.\nstatus: "+ status);
        }
    }
}
</code></pre>

The PHP file:
<pre><code>
<?php
    if(getenv('REQUEST_METHOD') == 'POST') {
	    $script_data = file_get_contents("php://input");
        if($script_data){
            $data = $_POST['data'];
            $secret = "#!qUeRtY$@123^456€!#";
            $key = hex2bin(strtoupper(hash('sha256', $secret)));
            $iv = hex2bin(strtoupper(explode(":", $data)[0]));
            $encryptedText = hex2bin(strtoupper(explode(":", $data)[1]));
            $plainText = openssl_decrypt($encryptedText, "AES-256-CBC", $key, $options=OPENSSL_RAW_DATA, $iv);
            $retIv = openssl_random_pseudo_bytes(16);
            $reEncrypted = openssl_encrypt($plainText, "AES-256-CBC", $key, $options=OPENSSL_RAW_DATA, $retIv);

            echo $plainText && $reEncrypted ? $plainText."|".bin2hex($retIv).":".bin2hex($reEncrypted) : "";

        }
    };
?>
</code></pre>

Co-Authored-By: Ubit Umarov <469643+UbitUmarov@users.noreply.github.com>
2024-02-29 01:09:20 +00:00
Adil El Farissi
60214e6e81 Add 2 OSSL functions to the LinkInventory collection
Add Functions:
+ osGiveLinkInventoryList(integer linkNumber, key destination, string category, list inventory)
Give a group of items located in a child prim inventory

+ osRemoveLinkInventory(integer linkNumber, string name)
Remove an item from a child prim inventory

LSL Script example:
<pre><code>
default
{
    touch_start(integer a){

        integer linkNumber = llDetectedLinkNumber(0);
        list linkInventoryNames = osGetLinkInventoryNames(linkNumber, INVENTORY_ALL);
        osGiveLinkInventoryList(linkNumber, llDetectedKey(0), llGetLinkName(linkNumber), linkInventoryNames);

        for(integer i = 0; i < llGetListLength(linkInventoryNames); i++){
            osRemoveLinkInventory(linkNumber, llList2String(linkInventoryNames, i));
        }
    }
}
</code></pre>
2024-02-25 07:14:49 +00:00
UbitUmarov
eb9afdaffc break them a bit more... 2024-02-24 15:47:06 +00:00
UbitUmarov
121f270414 a few changes to last PR (aes methods) - all still untested 2024-02-24 14:50:54 +00:00
Adil El Farissi
b4f33ad594 Replaced OSSLError by OSSLShoutError 2024-02-23 23:42:18 +00:00
Adil El Farissi
db80781e7d Basic implementation of AES encryption/decryption and respective OSSL functions
Add methods:
+ private static string AESEncryptString(string secret, string plainText, string ivString= null)
AES Encrypt a string using a password and a random or custom Initialization Vector.

+ private static string AESDecryptString(string secret, string encryptedText, string ivString= null)
AES Decrypt the string encrypted by AESEncryptString with the same password and ivString used in the encryption.

Methods implementations:
+ Util.AESEncrypt(string secret, string plainText)
+ Util.AESDecrypt(string secret, string encryptedText)
+Util.AESEncryptTo(string secret, string plainText, string ivString)
+ Util.AESDecryptFrom(string secret, string encryptedText, string ivString)

OSSL functions as first case of use:
+ osAESEncrypt(string secret, string plainText)
+ osAESDecrypt(string secret, string encryptedText)
+ osAESEncryptTo(string secret, string plainText, string ivString)
+ osAESDecryptFrom(string secret, string encryptedText, string ivString)

LSL script example:
<pre><code>
string plainText = "Hello World :)";
string secret = "#!qUeRtY$@123^456€!#";

default
{
    touch_start(integer i)
    {
        string encryptedText = osAESEncrypt(secret, plainText);
        llOwnerSay("\nEncrypted with osAESEncrypt:\n"+ encryptedText);
        string decryptedText = osAESDecrypt(secret, encryptedText);
        llOwnerSay("\nDecrypted with osAESDecrypt:\n"+ decryptedText);

        // Encription / Decription with custom Initialization Vector.
        string ivString = (string)llGetOwner() /* +"_"+ llGenerateKey() */;
        string encryptedToText = osAESEncryptTo(secret, plainText, ivString);
        llOwnerSay("\nEncrypted with osAESEncryptTo:\n"+ encryptedToText);
        string decryptedFromText = osAESDecryptFrom(secret, encryptedToText, ivString);
        llOwnerSay("\nDecrypted with osAESDecryptFrom:\n"+ decryptedFromText);
    }
}
</code></pre>

Web Rain :)
2024-02-23 21:14:33 +00:00
UbitUmarov
35a40ada77 fix ossl set ProjectionFocus range 2024-02-22 18:16:25 +00:00
UbitUmarov
76c813c2e4 useless changes 2024-02-22 01:47:24 +00:00
UbitUmarov
b383a027dc cosmetics... 2024-02-21 15:58:05 +00:00
UbitUmarov
152b64179b a few changes to last PR, let getlink select root; add getkeys permissions checks (don't remember why we have those) plus cosmetics 2024-02-21 15:20:53 +00:00
Adil El Farissi
e835a46ec8 Fix uuid to string 2024-02-20 21:58:39 +00:00
Adil El Farissi
ca722ecdd8 Add some OSSL functions related to child prims inventory manipulations
Add functions:

+ osGiveLinkInventory(integer linkNumber, key destination, string inventory)
Give an item located in a child prim inventory.

+ osGetInventoryNames(integer type)
Return a list of items names by type (or INVENTORY_ALL) located in the prim inventory.

+ osGetLinkInventoryNames(integer linkNumber, integer type)
Return a list of items names by type (or INVENTORY_ALL) located in a child prim inventory.

+ osGetInventoryKeys(integer type)
Return a list of the items UUIDs by type (or INVENTORY_ALL) located in the prim inventory.

+ osGetLinkInventoryKeys(integer linkNumber, integer type)
Return a list of the items UUIDs by type (or INVENTORY_ALL) located in a child prim inventory.

+ osGetLinkInventoryKey(integer linkNumber, string name)
Return the UUID of the specified item name located in a child prim inventory.

+ osGetLinkInventoryDesc(integer linkNumber, string itemNameorid)
Return the description of an item located in a child prim inventory.

+ osGetLinkInventoryName(integer linkNumber, key itemId)
Return the name of an item located in a child prim inventory.

Note: the LinkInventory functions don't have access to the root prim contents. This may change if requested by the community...
2024-02-20 17:36:33 +00:00