329 "// Filename: teleport_destinations.config",
331 "// Date: " + llGetDate() +
" UTC",
332 "// Author: River Drifter",
333 "// Email: river-drifter@aussiebroadband.com.au",
334 "// Licence: Creative Commons Attribution Share Alike 4.0 International or better",
336 "// *NOTE*: This file is periodically recreated by the Teleporter Heartbeat script.",
337 "// All entries place here manually will be lost when the file is recreated. If you",
338 "// wish do testing with manual entries, disable the heartbeat script for the duration.",
339 "//=========================================================="
352 string failure_message;
354 list status = llParseString2List(FailureMessage, [
":"], [
"\n"]);
355 string failure_type = llList2String(status, 0);
358 if (failure_type ==
"BANNED")
360 failure_message =
"Teleporters owned by user " + llList2String(status, 1) +
" are not permitted to";
361 failure_message +=
" add teleporters to the database, update teleporter information or update teleporter destinations.";
365 else if (failure_type ==
"UPDATE")
367 failure_message =
"The updating of the Teleporter's information in the database has unexpectedly failure with the error message: ";
368 failure_message += llList2String(status, 1);
372 else if (failure_type ==
"INSERT")
374 failure_message =
"The insertion of a new teleporter's information into the database has failed unexpectedly with the error message: ";
375 failure_message += llList2String(status, 1);
379 else if (failure_type ==
"NAME_MATCH")
381 failure_message =
"Unable to insert the new teleporter's information into the database because the Teleporter's Name is already in use ";
382 failure_message +=
"by another teleporter located at " + llList2String(status, 1);
386 else if (failure_type ==
"EXTRACT")
388 failure_message =
"The extraction of the list of teleporter destinations has failed unexpectedly with the error message: ";
389 failure_message += llList2String(status, 1);
393 else if (failure_type ==
"INVADER")
395 failure_message =
"Teleports from home world '" + llList2String(status, 1) +
"' are not permitted to ";
396 failure_message +=
" add teleporters to the database, update teleporter information or update teleporter destinations.";
400 failure_message +=
"\n If you wish to report this as an error please send this message to River Drifter with details of what happened and when.\n";
401 llSay(0, failure_message);
427 list versions = llParseString2List(VersionString, [
"."], []);
428 version = (integer)llList2String(versions,2) + ((integer)llList2String(versions,1) * 100) + ((integer)llList2String(versions,0) * 10000);
443 integer location_buffer = 0;
449 list type_component = llParseString2List(ValueString, [
","], []);
450 integer list_size = llGetListLength(type_component);
454 for (; index < list_size; ++index)
456 string location_type = llStringTrim(llList2String(type_component, index), STRING_TRIM);
464 LocationInfo |= location_buffer;
478 list components = llParseString2List(Line, [
"|"], []);
480 string name = components[0];
481 vector init_pos = (vector)components[1];
482 rotation initial_rot = (rotation)components[2];
483 vector offset_info = (vector)components[3];
484 string location_group = components[4];
485 integer address_type = (integer)components[5];
487 if (address_type == 2)
489 region = components[6];
490 world = components[7];
492 else if (address_type == 1)
494 region = components[6];
497 else if (address_type == 0)
504 llSay(DEBUG_CHANNEL,
"Format Error");
510 float offset_distance = (float)offset_info.x;
511 float look_angle = (float)offset_info.y;
512 integer location_information = (integer)offset_info.z;
516 landing = init_pos + llRot2Fwd(initial_rot) * -offset_distance;
518 vector temp = llRot2Euler(initial_rot * llAxisAngle2Rot(<0,0,1>, look_angle));
519 look_at = <llCos(temp.z), llSin(temp.z), 0.0>;
523 output_line = name +
"|" + world +
"|" + region +
"|";
524 output_line += (string)landing +
'|' + (
string)look_at +
'|';
525 output_line += (string)location_information +
'|';
526 output_line += location_group +
"\n";
545 integer count = llGetInventoryNumber(INVENTORY_NOTECARD);
547 for (; index < count; ++index)
580 integer teleport_list_started = FALSE;
582 key teleporter_key = llGetKey();
583 list details = llGetObjectDetails(teleporter_key, [OBJECT_POS, OBJECT_ROT, OBJECT_OWNER, OBJECT_GROUP]);
587 +
"&key=" + teleporter_key
588 +
"&position=" + osReplaceString(llList2String(details, 0),
" ",
"", -1, 0)
589 +
"&rotation=" + osReplaceString(llList2String(details, 1),
" ",
"", -1, 0)
590 +
"&owner=" + llList2String(details, 2)
591 +
"&group=" + llList2String(details, 3)
593 +
"®ion=" + llGetRegionName()
599 heartbeat_key = llHTTPRequest(heartbeat_message, [HTTP_BODY_MAXLENGTH,16384], [
""]);
603 llSay(DEBUG_CHANNEL,
"Either the location_name or database_interface are undefined! Teleporter " +
location_name +
" has been disabled");
604 llSetScriptState(llGetScriptName(), FALSE);
629 list config_data = llParseString2List(config, [
"\n"], []);
633 integer list_length = llGetListLength(config_data);
634 for (; index < list_length; ++index)
637 string trimmed_line = llStringTrim(llList2String(config_data, index), STRING_TRIM);
643 list key_value = llParseString2List(trimmed_line, [
"="], []);
646 string key_object = llToUpper(llStringTrim(llList2String(key_value, 0), STRING_TRIM));
649 string value_object = llStringTrim(llList2String(key_value, 1), STRING_TRIM);
691 http_response(key RequestId, integer Status, list Metadata,
string Body)
701 llSay(DEBUG_CHANNEL,
"Heartbeat Request Failed with error " + (
string)Status);
706 list input_list = llParseString2List(Body, [
"\n"], []);
710 integer input_list_started = FALSE;
711 integer list_count = llGetListLength(input_list);
717 line = llList2String(input_list, index);
720 if (line ==
"EXTRACT_LIST=START") input_list_started = TRUE;
723 else if (line ==
"EXTRACT_LIST=END")
726 input_list_started = FALSE;
730 else if (input_list_started == TRUE)
739 list status_list = llParseString2List(line, [
"="], []);
745 while ( ++index < list_count);
integer REGION_FLAG
Number value of REgion Location flag.
integer COMMENT_PREAMBLE_LENGTH
THe number of characters in the comment preamble.
string CONFIG_DESTINATIONS_NAME
The automatically generated list of teleporter destinations.
string location_name
The display name of the current location.
string CONFIG_NOTECARD_NAME
The name of the notecard containing the Teleport's Configuration.
string LOCATION_NAME
THe Key Value for defining hte name of the location in the Config notecard.
float TIMER_OFF
Settings a Zero Time will turn off the Timer.
integer METAVERSE_FLAG
Number value of Metaverse Location flag.
string location_region
Region holding the Teleporter.
string VERSION_STRING
The Current version of the software.
integer WORLD_FLAG
Number value of World Location flag.
string COMMENT_PREAMBLE
Preamble for a comment line in the configuration file.
string location_world
The Teleporter Location's World.
string database_interface
The HTTP address for invoking the php script to do the scanning & deleting.
string DATABASE_INTERFACE
The Identifier for the Database Interface URL.
string WORLD_LOCATION
The Configuration File Identifier for the World Location.
float DEFAULT_LOCATION_OFFSET
The default offset from the landing teleport position when using a display panel;.
list destination_data
A list of the Teleport Destinations from the COnfiguration File.
float front_offset_angle
The LookAt angle after teleportation.
integer rdSetLocationType(string ValueString, integer LocationInfo)
Set the teleporter Location Type.
list teleport_list
The list of Teleport Destinations.
float landing_offset
The distance offset between the landing and the Teleporter.
string LOCALITY_GROUP
Configuration File Identifier for the Regional Location.
float MINIMUM_OFFSET
Minimum allowable offset.
string LANDING_OFFSET
The Configuration File Identifier for the Landing Offset Distance.
rdProcessFailureMessage(string FailureMessage)
Convert error messages into something that is more readable.
float MAXIMUM_OFFSET
Maximum allowable offset.
list destination_preamble
integer ANONYMOUS_FLAG
This flag designates the teleporter as anonymous.
float heartbeat_period
Interval in seconds between Heartbeat messages.
rdSaveNewTeleportNotecard(list teleport_list)
Save the Teleportation Destinations into a Notecard.
string REGION_LOCATION
The Configuration File Identifier for the Regional Location.
string GROUP_LOCATION
The Configuration File Identifier for all Goup Locations.
key heartbeat_key
The Heatbeat HTTP Requrest Key.
string HEARTBEAT_PERIOD
The Configuration File Identifier for the Heartbeat Period.
string LOCATION_TYPE
The Configuration File Identifier for the Location Type.
float MINIMUM_HEARTBEAT_INTERVAL
integer rdSetAnonType(string ValueObject, integer InfoInteger)
Set of Reset the Anonymous Flag.
string FRONT_OFFSET_ANGLE
The Configuration File Identifier for the Look At Angle.
string METAVERSE_LOCATION
The Configuration File Identifier for the Metaverse Location.
string rdAdjustPosition(string Line)
integer GROUP_FLAG
Numeric identifier of a Group Location.
integer LOCATION_MASK
A mask to remove locaiton information.
integer version_number
Version number as integer.
string ANONYMOUS_UNIT
The configuration Identifier for Anonymous Operation.
integer rdGetVersionNumber(string VersionString)
Convert Version String into an Integer.
integer location_info
Information on the Teleporter Location.
float MINIMUM_HEARTBEAT_PERIOD
The fastest allowable heartbeat.