196 string header_string;
203 if (result == INVENTORY_NONE)
205 header_string =
"//###################################################################\n";
206 header_string +=
"//###################################################################\n";
207 header_string +=
"//## File: Teleport_Monitor.txt\n";
208 header_string +=
"//## Author: River Drifter (river_drifter@aussiebroadband.com.au\n";
209 header_string +=
"//## Contact: river_drifter@aussiebroadband.com.au\n";
210 header_string +=
"//###################################################################\n";
211 header_string +=
"//## This notecard contains a list of Teleporters that have\n";
212 header_string +=
"//## exceeded their LIFE_TIME which indicates that the Teleporter\n";
213 header_string +=
"//## may have failed and has been removed from the Teleport table.\n";
214 header_string +=
"//## It the teleporter was restarted, the teleporter will be\n";
215 header_string +=
"//## restored to the table.\n";
217 header_string +=
"//## Started: " + llGetTimestamp() +
"\n";
218 header_string +=
"//###################################################################\n";
219 header_string +=
"//###################################################################\n";
254 string temp = llToUpper(llStringTrim(TrueFalseString, STRING_TRIM));
255 if (temp ==
"TRUE")
return TRUE;
else return FALSE;
267 integer random_value = 0x80000000 | (integer)llFrand(65536) | ((integer)llFrand(65536) << 16);
268 return(random_value);
281 string config = osGetNotecard(NotecardName);
282 list config_data = llParseString2List(config, [
"\n"], []);
286 integer list_length = llGetListLength(config_data);
287 for (; index < list_length; ++index)
290 string trimmed_line = llStringTrim(llList2String(config_data, index), STRING_TRIM);
296 list key_value = llParseString2List(trimmed_line, [
"="], []);
299 string key_object = llToUpper(llStringTrim(llList2String(key_value, 0), STRING_TRIM));
302 string value_object = llStringTrim(llList2String(key_value, 1), STRING_TRIM);
338 if (in_world_only == TRUE) world_state =
location_world;
else world_state =
"###";
341 key controller_key = llGetKey();
342 list details = llGetObjectDetails(controller_key, [OBJECT_OWNER, OBJECT_GROUP]);
346 +
"&key=" + controller_key
347 +
"&owner=" + llList2String(details, 0)
348 +
"&group=" + llList2String(details, 1)
352 +
"&world=" + world_state;
355 scan_key = llHTTPRequest(heartbeat_message, [], [
""]);
414 http_response(key RequestId, integer Status, list Metadata,
string Body)
422 llSay(0,
"Scan Request Failed with error " + (
string)Status);
427 list input_list = llParseString2List(llUnescapeURL(Body), [
"\n"], []);
431 integer input_list_started = FALSE;
432 integer list_count = llGetListLength(input_list);
437 line = llList2String(input_list, index);
440 if (line ==
"SCAN_LIST=START") input_list_started = TRUE;
443 else if (line ==
"SCAN_LIST=END")
446 input_list_started = FALSE;
450 else if (input_list_started == TRUE)
457 while ( ++index < list_count);
460 integer scan_list_length = llGetListLength(
scan_list);
461 string message_string;
462 if (scan_list_length != 0)
468 message_string =
"Examine Status Notecard for retired Teleporters\nBefore touching the Desk\nbecause this will reset the notecard.\n";
470 else message_string =
"";
490 touch(integer TouchCount)
integer COMMENT_PREAMBLE_LENGTH
THe number of characters in the comment preamble.
string CONFIG_NOTECARD_NAME
The name of the notecard containing the Teleport's Configuration.
string VERSION_STRING
The Current version of the software.
string COMMENT_PREAMBLE
Preamble for a comment line in the configuration file.
string location_world
The Teleporter Location's World.
The Default State of the Script.
float MINIMUM_INTERVAL
Minimum internval between scans.
float SECONDS_PER_HOUR
The number of seconds in an hour.
string IN_WORLD_ONLY
Configuration Setting Flag.
vector WHITE_COLOUR
The RGB values for the colour white.
rdWriteStatusNotercard()
Write a Scan's results to the Status Notecard.
integer in_world_scan_only
string database_interface
The HTTP address for invoking the php script to do the scanning & deleting.
rdStateEntry()
Routine to call to initialise the Script.
float lifetime
This is maximum time between heartbeats for a working teleporter.
integer rdCalcCommsChannel()
key scan_key
The key to link the HTTP Request to the HTTP Response.
float SOLID_ALPHA
Alhpa valid for non-transparent text.
rdReadConfigNotecard(string NotecardName)
integer rdConvertTrueFalse(string TrueFalseString)
Convert "True/False" string into an integer.
string DATABASE_INTERFACE
The Identifier for the Database Interface URL.
string MONITOR_INTERVAL
The configuration prompt for the monitoring interval.
integer scan_only
A flag to request a scan for dead teleporter but without deleteing them.
string LIFE_TIME
The configuration prompt for the Teleporer LifeTime in the database.
float MINIMUM_LIFETIME
Minimum time before a telepoter is off-line.
string STATUS_NOTECARD_NAME
The name of the notcard holding the results.
float monitor_interval
Interval between scans in seconds.
rdsScanDestinationDatabase()
Scan the Teleporters in the database.
string SCAN_ONLY
The configuratin prompt for the Scan-only or delete if expired flag.