Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007995opensim[REGION] Script Functionspublic2016-08-14 11:252016-08-14 21:08
ReporterMandarinka Tasty 
Assigned Tomelanie 
PrioritynormalSeverityfeatureReproducibilityalways
Statuspatch readyResolutionopen 
PlatformUnix,Win,MacOSOS Version
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0007995: New OSSL function: osForceAttachToOtherAvatar(string rawAvatarId, int attachmentPoint)
DescriptionHello.

I've implemented new OSSL function:

osForceAttachToOtherAvatar(string rawAvatarId, int attachmentPoint)

I've noticed that are reasonable applications of usage of such function

in appropriately defined and secured grid environments.

Here is the OSSL example:

key id= "11112222-aaaa-bbbb-cccc-333344445555"; // example of avatar's uuid
default
{
    touch_start(integer num)
    {
        //force attach to right hand of other avatar
        osForceAttachToOtherAvatar(id,6);
    }
}

I have classified ThreaLevel of this function as VeryHigh

and defaulty I have set it in osslEnable.ini

as:

Allow_osForceAttachToOtherAvatar = false

Hence to try it please set other value in osslEnable.ini

The patch has been offered.
TagsNo tags attached.
Git Revision or version number
Run ModeStandalone (1 Region) , Standalone (Multiple Regions) , Grid (1 Region per Sim) , Grid (Multiple Regions per Sim)
Physics EngineBasicPhysics
Script Engine
EnvironmentMono / Linux32, Mono / Linux64, Mono / Windows, Mono / OSX, .NET / Windows32, .NET / Windows64
Mono Version4.0.1
Viewer
Attached Filespatch file icon 0001-Enhancement-of-OSSL-function-osForceAttachToAvatar-s.patch [^] (6,890 bytes) 2016-08-14 21:08 [Show Content]

- Relationships

-  Notes
(0031022)
melanie (administrator)
2016-08-14 11:36

Your function is a misnomer. It should be named osForceAttachToAvatarTemp. "OtherAvatar" is not appropriate because it doesn't deal with items from inventory and "Temp" should be added because no inventory item is created on the avatar the item is attached to, therefore it will poof when detached, making it a temp attachment. Unless I'm missing something here :)
(0031023)
Mandarinka Tasty (reporter)
2016-08-14 11:41

Hello Melanie :)

it does not poof when it is detached.

I have checked it and also please notice here what ive written:

return attachmentsModule.AttachObject(presence, grp, (uint)attachmentPoint, false, true, true);

bool addToInventory = true

I know the diferrence between llAttachToAvatarTemp

where this bool is set to false
(0031024)
melanie (administrator)
2016-08-14 11:42

Ok. I didn't see that. However, you do need to check and refuse to work if the object is set no copy or no transfer. The "Other" in the name is also still wrong.
(0031025)
Mandarinka Tasty (reporter)
2016-08-14 11:51

Well, there is name of function: osForceAttachToAvatar(int attachmentPoint)

but that is reserved only for m_host,OwnerID

Adn there is also function:

osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint)

so during construction of mine, i have simply consequently decided to remove

sufix FromInventory and

hence osForceAttachToOtherAvatar(string rawAvatarId, int attachmentPoint)

to assing role of avatar = is not m_host.OwnerID

checks referring to:

no transfer i have applied here:

if (target.UUID != m_host.OwnerID)
            {
                uint effectivePerms = m_host.ParentGroup.GetEffectivePermissions();

                if ((effectivePerms & (uint)PermissionMask.Transfer) == 0)
                    return;

                m_host.ParentGroup.SetOwnerId(target.UUID);
                m_host.ParentGroup.SetRootPartOwner(m_host.ParentGroup.RootPart, target.UUID, target.ControllingClient.ActiveGroupId);

                if (World.Permissions.PropagatePermissions())
                {
                    foreach (SceneObjectPart child in m_host.ParentGroup.Parts)
                    {
                        child.Inventory.ChangeInventoryOwner(target.UUID);
                        child.TriggerScriptChangedEvent(Changed.OWNER);
                        child.ApplyNextOwnerPermissions();
                    }
                }

                m_host.ParentGroup.RootPart.ObjectSaleType = 0;
                m_host.ParentGroup.RootPart.SalePrice = 10;

                m_host.ParentGroup.HasGroupChanged = true;
                m_host.ParentGroup.RootPart.SendPropertiesToClient(target.ControllingClient);
                m_host.ParentGroup.RootPart.ScheduleFullUpdate();
            }

but no copy why ?

if no copy, but transfer, then object can changed ownership and can be transfered , means: can be attached.

Or is there some other reason to deny attaching no copy ?

I know how to write in code such 'no copy' check:

if ((effectivePerms & (uint)PermissionMask.Copy) == 0)
                    return;

but is it necessary ?
(0031026)
melanie (administrator)
2016-08-14 11:52

well, if you place a copy in an avatar's inventory, you're copying it. unless the owner and the target are the same, you're also transferring it.

So it needs to be BOTH copy and trans. Else it could be used to make limitless copies of no copy items.
(0031027)
Mandarinka Tasty (reporter)
2016-08-14 12:04

ok. Let me add this check against PermissionMask.Copy

Next I also make some exercises with attaching no copy objects )

But the name of function, seems to be correct and proper and works with

names of analogous functions concerning attachment.

But personally, the name can be any, If there can be some better, I can set new one :)
(0031028)
melanie (administrator)
2016-08-14 12:05

There can't be an Other unless there is a This. There is no This in a prim rezzed on the ground. The "Other" needs to be dropped. Please change the patch.
(0031029)
Mandarinka Tasty (reporter)
2016-08-14 15:01

I have changed the way of applying this function and accordingly to our talk

I have used overloading of existing function in a following form:

osForceAttachToAvatar(string rawAvatarId, int attachmentPoint)

Here is the OSSL example:

key id= "11112222-aaaa-bbbb-cccc-333344445555"; // example of avatar's uuid
default
{
    touch_start(integer num)
    {
        //force attach to right hand of other avatar
        osForceAttachToAvatar(id,6);
    }
}

ThreadLevel = High , to be convergent with

osForceAttachToAvatar(int attachmentPoint)

I have also applied check of an object against PermissionMask.Copy

- Issue History
Date Modified Username Field Change
2016-08-14 11:25 Mandarinka Tasty New Issue
2016-08-14 11:25 Mandarinka Tasty File Added: 0001-New-OSSL-function-osForceAttachToOtherAvatar-string-.patch
2016-08-14 11:26 Mandarinka Tasty Status new => patch included
2016-08-14 11:36 melanie Note Added: 0031022
2016-08-14 11:41 Mandarinka Tasty Note Added: 0031023
2016-08-14 11:42 melanie Note Added: 0031024
2016-08-14 11:51 Mandarinka Tasty Note Added: 0031025
2016-08-14 11:52 melanie Note Added: 0031026
2016-08-14 12:04 Mandarinka Tasty Note Added: 0031027
2016-08-14 12:05 melanie Note Added: 0031028
2016-08-14 14:51 Mandarinka Tasty File Deleted: 0001-New-OSSL-function-osForceAttachToOtherAvatar-string-.patch
2016-08-14 14:55 Mandarinka Tasty File Added: 0001-Enhancement-of-OSSL-function-osForceAttachToAvatar-s.patch
2016-08-14 15:01 Mandarinka Tasty Note Added: 0031029
2016-08-14 15:34 melanie Assigned To => melanie
2016-08-14 15:34 melanie Status patch included => patch ready
2016-08-14 21:08 Mandarinka Tasty File Deleted: 0001-Enhancement-of-OSSL-function-osForceAttachToAvatar-s.patch
2016-08-14 21:08 Mandarinka Tasty File Added: 0001-Enhancement-of-OSSL-function-osForceAttachToAvatar-s.patch


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker