Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007872opensim[REGION] Script Functionspublic2016-04-03 17:502019-02-06 11:29
ReporterMandarinka Tasty 
Assigned Tomelanie 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformUnixOSUnix 3.14.32.6OS Version64-bit
Product Version 
Target VersionFixed in Version 
Summary0007872: CHANGED_OWNER is not triggered on rez after changing object's ownership
DescriptionWhen object is rezzed on ground or worn after changing its ownership, then changed_event does not fire at all.

That is big limitation, because, it is often when we need script be reset after changing ownership=first time rezzing, but we do not want this script be reset after each next on_rez event.

for example scripted shoes: script inside should be reset on first rezzing by new owner, that should be done by changed_event in such way:

changed(integer change)
    {
        if(change & CHANGED_OWNER)
        {
            llResetScript();
        }
    }
and next resident continues his/her settings and wishes, that after next rezzing, they wil not be lost, so
 i can't use resetting script via on_rez event !

I have noticed that changed_event with the flag CHANGED_OWNER only works properly when scripted object is deeded to the group, then ownership is correctly detected and event fires properly.
Steps To ReproduceSteps to reproduce problem with CHANGED_OWNER after rezzing object

1. Create default cube
2. create default new script
3. include following simple code:

default
{
    changed(integer change)
    {
        if(change & CHANGED_OWNER)
        {
            llResetScript();
        }
    }
    state_entry()
    {
        llSay(0, "Script running");
    }
}
4 take cube to your inventory and send to another resident
5 let resident rezzes cube in-world: on ground or wears

in both cases changed event does not work at all.

TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineBulletSim
EnvironmentMono / Linux64
Mono VersionOther
Viewer
Attached Filespatch file icon 0001-Fix-for-CHANGED_OWNER-Event.patch [^] (1,897 bytes) 2016-06-15 19:34 [Show Content]
diff file icon ScriptInstance.cs.diff [^] (6,937 bytes) 2016-06-17 11:41 [Show Content]

- Relationships

-  Notes
(0030536)
Mandarinka Tasty (reporter)
2016-06-15 19:35

Hello :)

I have prepared solution for CHANGED_OWNER Event.

I'd be very grateful if someone could compile my patch and test it.
(0030537)
Mandarinka Tasty (reporter)
2016-06-15 20:50

I can see now, that my patch does too much.

I need to correct it. I think it needs new StateSource,

something like StateSource.FirstRez

So it looks, that I need to work on it much more.
(0030545)
kcozens (administrator)
2016-06-17 09:47
edited on: 2016-06-17 09:48

I ran a couple of diffs to compare the ScriptInstance.cs file referenced in the attached patch and found the git master version is identical to the version in the 080PF branch. The git master version has reverted changes made to the file in 082PF.

(0030546)
Diva (administrator)
2016-06-17 09:58

Is this a regression from 082? Did this work in 082?

@kcozens, can you please post the differences you found? Eyeballing the pertinent code, I don't find any differences between 082 and 090.
(0030547)
Diva (administrator)
2016-06-17 10:04
edited on: 2016-06-17 10:05

@mandarinka, I don't think your patch is right. The event should only trigger when the object actually changed owner, not always when it's NewRez and when it's AttachedRez. Your patch makes the erroneous situation work but it also makes the event trigger when it shouldn't, I think.

Update: I saw your comment only after I saw the patch.

(0030548)
Mata Hari (reporter)
2016-06-17 10:56

@Diva: I would expect that in a case where I hand you a scripted object from my inventory and you rez it to ground or attach it, the CHANGED_OWNER event ought to trigger (since the script isn't active at all until one of those two things happens). Is that not the case?
(0030549)
Mandarinka Tasty (reporter)
2016-06-17 11:41

Hello :)

@Diva Problem also exists in 0.8.2 version of opensim.

After publishing I noticed, that my patch made script to be triggered every time, when NewRez and AttachedRez are initialised,

and that's not good, It should work for NewRez and AttachedRez, but only

for the first time of their firing. Not for the second.
(0030550)
kcozens (administrator)
2016-06-17 11:43

@Diva, I have attached the ScriptInstances differences between 082PF and master generated using "diff -bu".
(0030953)
kcozens (administrator)
2016-07-24 20:43

I tested change of ownership in todays master branch by passing an object between two avatars. The script in the object would report the name of its owner in on_rez and attach. It would also report if it detected a change in ownership. Each time I passed the object to another avatar I received the report of change in ownership whether I rezzed the object or just wore the object directly from inventory.

I don't see the problem being reported in this report. Close this report as fixed?
(0030954)
Mandarinka Tasty (reporter)
2016-07-25 04:04

I have compiled last master: opensim-0.9.0-485-g67a32c9

And it absolutely does not work at all.

Please test this LSL code:

default
{
    changed(integer change)
    {
        if(change & CHANGED_OWNER)
        {
            llResetScript();
        }
    }
    state_entry()
    {
        llSay(0, "Script running");
    }
}

When avatar A sends prim with this code to another avatar B,

and avatar B rezzes the prim on the groud or wears it,

then changed_owner event is not triggered at all !

It only works when avatar deeds the prim to the group, then

group becomes new owner of the prim and event is fired

And it also works when object is set for sale by avatar A and avatar B

buys the prim, then event is also fired.
(0030955)
Mandarinka Tasty (reporter)
2016-07-25 04:09
edited on: 2016-07-25 04:10

my patch, that i have attached here earlier, makes too much.

Changed_owner event is triggered in each required situation,

but it also fires, on second and next rezzes. And that is not acceptable,

because changed_owner event should be triggered only on the first time when it is

rezzed by new owner.

(0031543)
melanie (administrator)
2017-01-06 15:43

The script engine isn't responsible for this, the sim is. The attached patch fixes it in the wrong place.
Also, CHANGED_OWNER _will_ fire on every rez of a received item unless the item is rezzed and taken back. Rezzing the taken back item then doesn't fire the event anymore. However, this is fixed now by making the script engine confirm to the requirement that after ResumeScripts, the scripts MUST be able to accept queued events.
(0034464)
BillBlight (developer)
2019-02-06 11:29

Marked as Resolved but never closed, can be reopened if needed.

- Issue History
Date Modified Username Field Change
2016-04-03 17:50 Mandarinka Tasty New Issue
2016-04-03 17:52 Mandarinka Tasty Steps to Reproduce Updated View Revisions
2016-06-15 19:34 Mandarinka Tasty File Added: 0001-Fix-for-CHANGED_OWNER-Event.patch
2016-06-15 19:35 Mandarinka Tasty Note Added: 0030536
2016-06-15 19:35 Mandarinka Tasty Status new => patch included
2016-06-15 20:50 Mandarinka Tasty Note Added: 0030537
2016-06-17 09:47 kcozens Note Added: 0030545
2016-06-17 09:48 kcozens Note Edited: 0030545 View Revisions
2016-06-17 09:58 Diva Note Added: 0030546
2016-06-17 10:04 Diva Note Added: 0030547
2016-06-17 10:05 Diva Note Edited: 0030547 View Revisions
2016-06-17 10:56 Mata Hari Note Added: 0030548
2016-06-17 11:41 Mandarinka Tasty Note Added: 0030549
2016-06-17 11:41 kcozens File Added: ScriptInstance.cs.diff
2016-06-17 11:43 kcozens Note Added: 0030550
2016-07-24 20:43 kcozens Note Added: 0030953
2016-07-25 04:04 Mandarinka Tasty Note Added: 0030954
2016-07-25 04:09 Mandarinka Tasty Note Added: 0030955
2016-07-25 04:10 Mandarinka Tasty Note Edited: 0030955 View Revisions
2017-01-06 15:41 melanie Status patch included => resolved
2017-01-06 15:41 melanie Resolution open => fixed
2017-01-06 15:41 melanie Assigned To => melanie
2017-01-06 15:43 melanie Note Added: 0031543
2019-02-06 11:29 BillBlight Note Added: 0034464
2019-02-06 11:29 BillBlight Status resolved => closed


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker