Jump to content

RLV: Detect/Respond to relay queries?


Jenni Darkwatch
 Share

You are about to reply to a thread that has been inactive for 4068 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Odd problem :) 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?

 

Link to comment
Share on other sites

 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");    }}

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4068 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...