Reply
Advisor
Jenni Darkwatch
Posts: 1,569
0 Kudos

RLV: Detect/Respond to relay queries?

Odd problem :smileyhappy: I never used RLV nor do I have a RLV capable viewer. In essence I wonder if it's possible to create an object to behave like a RLV-enabled client, to a point. For that I need to figure out what the accepted way to detect "open" relays is. As a sidenote I'm also trying to improve a few objects I've created a while ago to comply better with the RLV relay specification.

From what I gather at http://wiki.secondlife.com/wiki/LSL_Protocol/Restrained_Love_Relay/Specification I'm guessing the !version query is what I'm looking at to detect if an avatar has an open relay?

 

Innula Zenovka
Posts: 6,603
Registered: ‎06-02-2009
0 Kudos

Re: RLV: Detect/Respond to relay queries?

Reply to Jenni Darkwatch - view message

 While !version would certainly do it, or should do,  it's not normally how it's done, since !version reports the version of the relay protocol rather than the version of RLV/RLVa you're using (which far more useful to know).

The command used to be @version, but that's now discouraged and we're supposed  to use @versionnew or @versionnum (which I use because that gives me the version number, and that's usually the most interesting to know about).

Try something like this:

integer rlvrc = -1812221819;
integer handle;
integer ArbitraryPositiveInteger = 12345;
key victim;
string ArbitraryCommandName;

default
{
    state_entry()
    {

    }

    touch_start(integer total_number)
    {
        victim = llDetectedKey(0);
        llListenRemove(handle);
        handle = llListen(ArbitraryPositiveInteger,"","","");
        ArbitraryCommandName ="testing";
        llRegionSayTo(victim, rlvrc,ArbitraryCommandName+","+(string)victim+",@versionnum="+(string)ArbitraryPositiveInteger);
        llSetTimerEvent(5.0);
    }

    listen(integer channel, string name, key id, string message)
    {

        if(llGetOwnerKey(id)!=victim){
            return;
        }
        if("testing"==ArbitraryCommandName ){
            llSetTimerEvent(0.0);
            llListenRemove(handle);
            llOwnerSay(llGetDisplayName(victim)+" is using RLV version "+message);
        }

    }

    timer()
    {
        llSetTimerEvent(0.0);
        llListenRemove(handle);
        llOwnerSay(llGetDisplayName(victim)+" doesn't seem to be using an active RLV relay");
    }


}

 

Advisor
Jenni Darkwatch
Posts: 1,569
0 Kudos

Re: RLV: Detect/Respond to relay queries?

Reply to Innula Zenovka - view message

Thank you kindly, that does answer the question. It also answers another one... it seems that the relay must be worn, and consequently also means rezzed objects (i.e. scripted pets, to give one example) can't be "controlled" via RLV commands.

Innula Zenovka
Posts: 6,603
Registered: ‎06-02-2009
0 Kudos

Re: RLV: Detect/Respond to relay queries?

[ Edited ]

Reply to Jenni Darkwatch - view message

RLV is a protocol that allows scripted objects to communicate with the viewer and instruct it to perform certain behaviours.  So yes, it can only be used for controlling avatars (or bots, I guess).  But you can't use it to make scripted pets do stuff.   The whole point is that if an RLV viewer encouters an llOwnerSay string starting with "@", it doesn't display it like an ordinary llOwnerSay.   Instead, it intercepts it, parses it, and if it's a valid command, executes it.

The point of the relay is that it's an object that belongs to you that listens on the rlv relay channel, parses what it hears and, if appropriate, turns it into an RLV command that it repeats to the wearer.    That's how objects that don't belong to you -- traps, for example -- can use RLV on you. 

 

In brief, pets (at least the ones made out of prims and scripts) can't be controlled by RLV.   It's a viewer thing for avatars.

Advisor
Jenni Darkwatch
Posts: 1,569
0 Kudos

Re: RLV: Detect/Respond to relay queries?

Reply to Innula Zenovka - view message

That was the part that wasn't quite clear to me. I know how RLV relays communicate with the viewer, and that _only_ relays communicate with the viewer.

Most of the RLV protocol makes little sense on objects anyway, though I wondered if it would be possible to assert control over free-roaming pathfinding critters that way. I.e. send a broadcast, have the critter respond, send a simple force-tp RLV command to get the critter to heel etc.pp. - in essence subverting existing RLV control HUDs to be able to somewhat control NPCs as well.

Since the detection method seems to be targeted-only and not a region broadcast, this won't work. If it _were_ possible to get all open relays in a region, the idea would have worked (unless RLV itself has a safeguard of sorts to prevent exactly that kind of behavior).

Either way the code helps me get some doors to be RLV-aware and hopefully more compliant. I already have a HUD that does indeed allow force-TP of an avi even without a RLV client by implementing a subset of RLV, but it doesn't properly act as a relay yet - it's non-discoverable.

Innula Zenovka
Posts: 6,603
Registered: ‎06-02-2009
0 Kudos

Re: RLV: Detect/Respond to relay queries?

Reply to Jenni Darkwatch - view message

If the critters are on the same region, wouldn't llSetRegionPos() do the trick?

As to force tp-ing avatars, if someone's wearing a hud, then can't you give the hud coordinates and then use llTeleportAgentGlobalCoordinates (or whatever it's called)? I don't think you need bother with RLV if that's all you need to do.

Advisor
Jenni Darkwatch
Posts: 1,569
0 Kudos

Re: RLV: Detect/Respond to relay queries?

Reply to Innula Zenovka - view message

Yes it would. The question was how to let the critter know. Personally, I prefer re-using existing protocols, and RLV came to mind because it's exactly that: a remote control protocol.

The HUD does exactly that. It gets the coordinates by one of two means: Stargate Event Horizon or RLV. Both work, though I noticed I didn't quite implement the RLV part right since I worked off a Stargate script to get the RLV bit - it's missing the "I'm here!" parts which seem to confuse some control HUDs into thinking there's no relay. Technically they're right: there isn't, but that failure prevents teleports occasionally.