llIsFriend fails if owner is not present on region
complete
Peter Stindberg
The wiki page for llIsFriend says that the function fails if
"If neither the owner, nor the target agent are in the region."
I am not an English native speaker, but I asked two native speakers and both agreed with my interpretation that the functions fails if
both
, owner and
target, are not present. However it should not fail if either
the owner or
the target are present.Test, however, show that
solely the owner
has
to be present for the function to work.Test script
key friend = "99d8181a-4395-4c7f-9784-e67d774834b4";
integer i = 0;
default
{
state_entry()
{
while (i < 50) {
llOwnerSay((string) llIsFriend(friend));
llSleep(1);
i++;
}
}
}
Observed behavior
Given are region A and region B. The object with the test script is on region A. During the duration of the test, owner and friend move to an adjacent region and back several times.
owner on A, friend on A: pass
owner on A, friend on B: pass
owner on B, friend on A:
fail
owner on B, friend on B: fail
Expected behavior
owner on A, friend on A: pass
owner on A, friend on B: pass
owner on B, friend on A:
pass
owner on B, friend on B: fail
I sincerely hope this is an actual bug, and not the intended behavior paired with an ambiguous description on the wiki. The functionality would be severely limited if this would be the intended behavior.
Log In
This post was marked as
complete
Uggo Vieria
Fun fact is that it seems to work fine if the owner is not present when the object is rezzed. I made a boat that uses this function to let friends use it.
If the owner was present in the region then leaves, the boat won't work for friends anymore but a freshly rezzed boat from a rezzer when owner is not present will work.
So it looks like information is fetched from the owner data when they are present in the region or have been present, which fails when they left but from the friend's data when owner has not been seen recently.
Maybe always fetching data from the friend (who is always present when they want to use it) even when owner is present would fix the issue
Peter Stindberg
Uggo Vieria I'm watching the release notes constantly, but as Maestro Linden told me, this seems to be a not-easy-to-catch one.
Uggo Vieria
Peter Stindberg, Maestro Linden is certainlly right. What I'm thinking is that as much as I see this function really useful and long time awaited to give permissions to friends of the object owner, I'm not sure there is a real need of the opposite way where the object would need to ckeck a list of keys to see whether they are friends of the owner or not.
I think checking if the owner is a friend of the agent that is present in the region and actually interacting with the object would fill 99,99% of the use cases of this function. This would reduce the need to checking the friends list of the agent that is present and would never fail.
Maestro Linden
tracked
Thanks for the information about how you reproduced this issue. When I change my steps to have the script owner move into an adjacent region (instead of (1) TPing into a remote region or (2) logging off), then
llIsFriend()
unexpectedly returns FALSE, even though the friend agent is in the same region as the script.Maestro Linden
needs info
Maestro Linden
Hi Peter Stindberg what are your steps to reproduce the failure? I don't observe them when I try this, with 3 agents:
* UserA: script owner
* UserB: UserA's friend, and the target of llIsFriend()
* UserC: observing agent. Remains in the region to observe script output even when UserA and UserB leave
- UserA: login, and rez the script shown below
- UserB: Login to UserA's location, and touch the object
- UserC: Login to UserA's location, and observe the results.
- Observe that the script reports a result of 1 for llIsFriend(). This is as expected, because UserA and UserB are friends and are in the region.
- UserA: Teleport to a far away region
- UserC: After a few minutes (waiting for UserA's viewer to fully disconnect from the source region), note the script output.
- At this point I see the expected results - llIsFriend() returns TRUE because UserB is still connected to the region.
- UserB: Teleport to a far away region
- UserC: After a few minutes (waiting for UserA's viewer to fully disconnect from the source region), note the script output.
- At this point I see the expected results - llIsFriend() returns FALSE because neither UserA nor UserB is connected to the region.
- UserB: Teleport back to the region with the script
- At this point I see the expected results - llIsFriend() returns TRUE because UserB is connected to the region.
default
{
touch_start(integer total_number)
{
while(TRUE)
{
llSay(0, "I am owned by " + (string)llGetOwner()
+ ". llIsFriend(\"" + (string)llDetectedKey(0) + "\") returns "
+ (string)llIsFriend(llDetectedKey(0)));
llSleep(2);
}
}
}
Peter Stindberg
Maestro Linden We have a private full region and a connected homestead (I can send the names via IM). The friend was static on the full region, I had my test script running either on the full region or - for the counter test - on the homestead. While the script did its output, I crossed the region line several times and observed the output shown in my post. When friend and script where on full region, and I was as well, the output was "1". As soon as I crossed the region line to the homestead, the output immediately switched to "0". When I crossed the region line back, it switched back to "1". Placing the script into the homestead showed the same results, only in reverse.
The tests happened at 3700 meters altitude, if that is of importance.
I have not tested it on other regions, but could do this. You are also welcome to check it on our regions.