[sldev] Using llGetAgentLanguage() in a different way...

Henri Beauchamp sldev at free.fr
Wed Jan 21 16:15:00 PST 2009


On Wed, 21 Jan 2009 21:50:55 +0100, Marine Kelley wrote:

> Hello all,
> 
> I am sending this message to gather thoughts about a little experience I
> have made today, and possibly some insight...
> 
> Lately the SL viewer has been given the ability to "export" its language
> setting out to the sim, and to a LSL function called "llGetAgentLanguage(key
> id)". This feature is useful for scripters who want to localize their
> scripts according to the language chosen by the user. However, some people
> may not want to disclose which language they use

Indeed... I prefer proper English to "petit nègre" French... There is a
setting to switch language sharing on or off, in the General tab of the
Preferences floater... In my prefs, it's off and will stay so, just like
I use the English locale in the UI of my viewer (the French translation
is so lame that using it would give me urticaria, lol !).

> so it is an optional feature that scripters may not really want to exploit
> automatically.

I doubt very much many will use that feature at all... For a start, the
scripter must be able to properly write several different languages... and
then, if they use different languages in their scripted objects, they also
will have to write the documentation in the same languages (else it's pretty
much inconsistant), multiplying the work by as many times as they are
languages... Economically irrealistic for all but big companies.

> With my own flavour of the viewer, a script is able to find out whether the
> user is using it or not by issuing a llOwnerSay ("@version=nnnn") command
> (where "nnnn" is a positive channel number), requiring both a listener and a
> timer. I was thinking of using the language feature to convey the version of
> the viewer directly, making it a synchornous call : just call
> llGetAgentLanguage() once and you get the version, or just the language or
> even nothing at all in the case of another viewer. Much easier for scripts.
> This change is trivial and takes place in
> secondlife-bin/llagentlanguage.cpp,
> 
> I have tried it already and it works like a charm. But there are still some
> uncertainties I would like to clear out :
> 
> - This feature only works if the sim the agent is in has the capability. Is
> this the case for every sim now ? If so, will it stay that way ? And if not,
> will this be the case later ?

It seems to be working with the v1.25.4 servers (and v1.21 or later viewers).
By the way, the "Share language with objects" setting in the General
Preferences tab should have a "(require a restart)" comment added...

> - It obviously masks the real language setting. I don't know whether it is
> used a lot or not yet (emphasis on "yet"). As the language is optional,
> scripts have to rely on another way to change their localization anyway.
> Through a dialog, a notecard or anything the creator can think of. The LSL
> Wiki seems to concur : http://wiki.secondlife.com/wiki/LlGetAgentLanguage

Indeed, that's a bad thing for compatibility to divert a feature to implement
another...

> - Unlike my current llOwnerSay() trick, any script is able to check the
> version of the viewer as long as the avatar and the script are in the same
> sim. The script does would not have to belong to the agent anymore. Good or
> bad, I don't know yet.

As everything, such a feature can be abused. Even a script you own but that
was created by someone else could be used to broadcast data they would gather
via owner-restricted commands. I.e., even with your llOwnerSay() method, a
malicious scripter could make others accept a scripted object that would
broadcast the data that only the script owner is supposed to be able to see/
use.
Restricting the function to the script owner only prevents griefers to get
the data without needing for the victim to accept their scripted object.

> - Is this a good idea at all ? As far as I checked, this is *the only way*
> I've found to directly "upload" a string of chars to a sim and to share it
> with a script through a synchronous LSL call. This is a dirty hack, though,
> since it takes the place of a genuine feature.
> 
> - Would LL consider "extending" this kind of feature by allowing a viewer to
> upload one custom string (not changed by the user), retrieved by another
> call like this llGetAgentLanguage() function in the future ? Something along
> the lines of llGetCustomString(key id) or llGetSignature(key id), maybe even
> llGetOwnerSignature() that would only work for the owner of the script.

What about generalizing the concept ?

I would suggest:
string llGetDebugSetting(key agent_id, string setting_name)

which would allow to retreive the settings of agent_id's viewer provided they
are part of a white (CSV) list itself contained in a new setting (say
"WhiteSettingsList").

For your RestrainedLife viewer you could then have a "RestrainedLiveVersion"
setting and get it listed by default in "WhiteSettingsList", and then using:

llGetDebugSetting(agent_id, "RestrainedLifeVersion")

would do the trick nicely, while also allowing paranoid users to disable
this feature if they so wish.

Regards,

Henri.


More information about the SLDev mailing list