llIsFriend fails if owner is not present on region
tracked
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
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.