Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to determine grid?

Doran Zemlja
Registered User
Join date: 24 Dec 2006
Posts: 22
07-31-2007 16:01
The "hack" listed at http://rpgstats.com/wiki/index.php?title=Hacks for determining what grid a script is on does not work in all cases.

Is there any reliable way for a script to determine which grid it is running on?
Johnii Nowhere
Registered User
Join date: 20 Aug 2006
Posts: 6
uhm...
07-31-2007 16:51
Can you be a bit more specific... maybe we could get an inkling as to how this can be helped within the script forum.
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
07-31-2007 16:57
That hack (or one very much like it) has always worked for me, to my knowledge...

Can you provide more detail on "does not work in all cases" please?
_____________________
Doran Zemlja
Registered User
Join date: 24 Dec 2006
Posts: 22
08-01-2007 08:51
It has been reported to me that llGetSimulatorHostname() returns "agni" hostnames in some (all?) teen grid regions.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-01-2007 09:43
"agni" is the name for the production grid; it includes BOTH the regular "adult" grid AND the "Teen" grid.

We know for a fact that they use the same asset server.
Doran Zemlja
Registered User
Join date: 24 Dec 2006
Posts: 22
08-01-2007 15:21
Hence my original statement and subsequent question.

The hack in the wiki doesn't work. Is there any way within a script to tell which grid you're running on?
Doran Zemlja
Registered User
Join date: 24 Dec 2006
Posts: 22
08-01-2007 15:24
From: Talarus Luan
We know for a fact that they use the same asset server.


This is off topic for this question, but does this mean someone on the Teen grid could use a texture from the Main grid if they got hold of the texture key?
Doran Zemlja
Registered User
Join date: 24 Dec 2006
Posts: 22
08-02-2007 07:22
Bueller?

So far, this is the best I can do. It has obvious problems.

Does no one know how to do this reliably?

(sorry it's in perl, I'm doing this server side. I really want to know how to do this reliably on the LSL side.)

<pre>
sub isteengrid($) {
my $region = shift @_;

# In general, the teen grid regions all lie within a small
# bounding box. As of 2007-07-29, there are three exceptions;
# one teen grid outside this space, and two adult grids inside
# this space.

# the special cases, must be lower case
my %special = (
"focus" => 1,
"avatar project" => 0,
"virtual school" => 0,
);

foreach my $key (keys(%special)) {
if (lc($region) =~ /^$key \([0-9]+, [0-9]+\)/) {
return $special{$key};
}
}

my $x;
my $y;

$region =~ s/\(([0-9]+), ([0-9]+)\)/$x=$1,$y=$2/ge;
$x = $x / 256;
$y = $y / 256;

if ($x >= 1150 && $x <= 1179 && $y >= 980 && $y <= 1008) {
return 1;
}

return 0;
}
</pre>
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-02-2007 09:49
From: Doran Zemlja
This is off topic for this question, but does this mean someone on the Teen grid could use a texture from the Main grid if they got hold of the texture key?


Actually, it is on-topic to the question, since it is intended to disprove totally that using the simulator host name is useful for the purpose you are asking of it.

If they used the same map server, you might be able to discern it from global coordinates, but I don't believe they share the same map server, so they probably co-exist in the same global coordinate space.

Thus, the answer to your original question is "No". There is no known way in LSL to discern Teen/Adult grid, because, for the most part, they are the same grid, at least as far as the host names are concerned. They are both "agni".

As for the UUID question, it is possible, but I have never (and can never) test it.
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
08-02-2007 10:21
From: Talarus Luan
As for the UUID question, it is possible, but I have never (can can never) test it.


I tried it once back when my daughter first got her Teen Grid account, and it didn't work at that time. I'm not sure if that's just because I did it wrong, since my memory of how I tried is pretty hazy, but I think I threw the UUID into an llSetTexture() call.

[EDIT] Nevermind, I was wrong. I just asked her to verify, and in fact it does work!


.
_____________________
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-02-2007 10:32
Yep. Not surprised.

So adults can share all their pr0n across to the teen grid via publishing UUIDs. :P

Not like there isn't more pr0n on the Teen Grid than the adult grid. :P Well, maybe not, but only due to the size of the population, not the number of images per account.
Doran Zemlja
Registered User
Join date: 24 Dec 2006
Posts: 22
08-02-2007 13:42
Huh. This would seem to imply that if you had an agent key you could llGiveInventory from Teen to Main or vice-versa. Anyone tried that?
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-02-2007 14:35
I think anything specifically and explicitly targeting agents is blocked, like IMs and llGiveInventory. I have not tried it, though. Robby? :)

Keys are definitely the same from adult-to-teen, though, as teens who are caught on the adult grid and moved to the teen grid have the same UUID, and there is a way for them to recover their inventory, as it is normally cleared in the transfer process.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
08-02-2007 15:50
From: Talarus Luan
I think anything specifically and explicitly targeting agents is blocked, like IMs and llGiveInventory. I have not tried it, though. Robby? :)
Yipes. :eek: That must be some hairy code... wonder the odds of it actually working, one update to another. But it also suggests some big holes, if Objects can be llEmail()'d by UUID across grid boundaries (for example). (Kinda hope it doesn't work this way.)
Doran Zemlja
Registered User
Join date: 24 Dec 2006
Posts: 22
08-03-2007 10:41
It seems that, from the Main Grid, one can successfully use llGetAgentData() to get the name of an agent on the Teen Grid, given their asset key. I had hoped this wouldn't be the case (i.e. that I could use it to differentiate between Teen/Adult grids).

I wouldn't be surprised if llGiveInventory() also worked. I have no way to test though.