Jump to content

Dataserver lookup by region name


animats
 Share

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

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

Recommended Posts

If I call llRequestSimulatorData("Vallone",DATA_SIM_POS), I get a dataserver event with "<462592,306944,0>" as a string, which is the correct global location of that region. Fine.

If I call llRequestSimulatorData("bogussimname",DATA_SIM_POS), for an unknown sim name, I get no dataserver event at all. Which is lame.

If I call llRequestSimulatorData("bogussimname",DATA_SIM_STATUS), I get a dataserver event with "unknown". That tells me not to ask for the position. If I get "up", it's OK to make a second dataserver request for the position.

Question: If I call llRequestSimulatorData("simname",DATA_SIM_STATUS), and get a dataserver event of "down", "stopped", "crashed", etc, should I ask for the position?

(All this is to read a config notecard with sim names and positions within the sim. That seems like a common operation, and it takes way too much code.)

(By the way, case matters in this lookup.)

 

Link to comment
Share on other sites

If http would be acceptable in place of a dataserver event, there's a Map API cap to be called with region name that returns a JSON-esque string with region location (global coords / 256),
a la "https://cap.secondlife.com/cap/0/d661249b-2b5a-4436-966a-3d3b8d7a574f?var=coords&sim_name=Vallone" returns "var coords = {'x' : 1807, 'y' : 1199 };"
and "https://cap.secondlife.com/cap/0/d661249b-2b5a-4436-966a-3d3b8d7a574f?var=coords&sim_name=bogussimname" returns "var coords = {'error' : true };"

 

  • Like 1
Link to comment
Share on other sites

17 hours ago, Qie Niangao said:

If http would be acceptable in place of a dataserver event, there's a Map API cap to be called with region name that returns a JSON-esque string with region location (global coords / 256),
a la "https://cap.secondlife.com/cap/0/d661249b-2b5a-4436-966a-3d3b8d7a574f?var=coords&sim_name=Vallone" returns "var coords = {'x' : 1807, 'y' : 1199 };"
and "https://cap.secondlife.com/cap/0/d661249b-2b5a-4436-966a-3d3b8d7a574f?var=coords&sim_name=bogussimname" returns "var coords = {'error' : true };"

Thanks.

That JSON-esque string is valid Javascript. This probably dates from the era when using "eval" on foreign data was considered a reasonable way to pass data around in Javascript land. Created huge security holes, since the "data" had full program privileges. Hence JSON. Probably easier to do this in LSL than deal with parsing that stuff in LSL.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1597 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...