[Opensim-dev] new LSL state to implement
Mana Janus
mana.janus at web.de
Tue Jul 29 21:45:58 UTC 2008
Hi Chang,
Thanks for the great summary!
Chang, Francis wrote:
> Moreover, for some scripts, it might be necessary to differentiate grids for correct behaviour. For example, a networked vendor or an auto-updater script need to be able to figure out which grid-specific server to contact.
>
Or a teleporter needs to know, if to use the warp pos hack. Totally
unnecessary in OpenSim. Not sure, it even works!
A builder tool probably needs to know about max. size of prims.
And many many more...
> 3) llGetSimulatorHostname() substring matching: drawbacks: heuristic - only works iff Lindenlab.com hosts all maingrid servers, and only maingrid servers.
>
You can improve your chances somewhat, by checking for
".agni.lindenlab.com". But still heuristic and likely to break, I agree.
> New suggestion: Use a magic variable - opensim compilers will automatigically change the value:
>
> string __MAGIC_VAR_SERVER_MAJOR_VERSION__ = "";
>
> string getCurrentGrid() {
> if ( __MAGIC_VAR_SERVER_MAJOR_VERSION__ == "" )
> return "LL_GRID";
> else if ( __MAGIC_VAR_SERVER_MAJOR_VERSION__ == "OPENSIM")
> return "OS_GRID";
> else
> return "UNKOWN_GRID";
> }
>
> It would work forever going forward, since we're just changing the result of well-defined correct behaviour. This could be handled at both at runtime or compile time.
>
> The drawback is it would be a total hack.
>
But a good one! ;-)
Love this idea!!
Mana
More information about the Opensim-dev
mailing list