|
Database Teleporter BRIGADOON-0009
An Open Simulator Teleporter using a central database.
|
Script to monitor life of known Teleporters. More...
Go to the source code of this file.
Functions | |
| rdWriteStatusNotercard () | |
| Write a Scan's results to the Status Notecard. | |
| integer | rdConvertTrueFalse (string TrueFalseString) |
| Convert "True/False" string into an integer. | |
| integer | rdCalcCommsChannel () |
| rdReadConfigNotecard (string NotecardName) | |
| rdsScanDestinationDatabase () | |
| Scan the Teleporters in the database. | |
| rdStateEntry () | |
| Routine to call to initialise the Script. | |
Variables | |
| string | VERSION_STRING = "1.0.0" |
| string | CONFIG_NOTECARD_NAME = "teleport_destination_monitor.conf" |
| string | STATUS_NOTECARD_NAME = "teleport_monitor.txt" |
| The name of the notcard holding the results. | |
| string | DATABASE_INTERFACE = "DATABASE_INTERFACE" |
| The Identifier for the Database Interface URL. | |
| string | MONITOR_INTERVAL = "MONITOR_INTERVAL" |
| The configuration prompt for the monitoring interval. | |
| string | LIFE_TIME = "LIFE_TIME" |
| The configuration prompt for the Teleporer LifeTime in the database. | |
| string | SCAN_ONLY = "SCAN_ONLY" |
| The configuratin prompt for the Scan-only or delete if expired flag. | |
| string | IN_WORLD_ONLY = "IN_WORLD_ONLY" |
| Configuration Setting Flag. | |
| string | COMMENT_PREAMBLE = "//" |
| integer | COMMENT_PREAMBLE_LENGTH = 2 |
| float | SECONDS_PER_HOUR = 3600.0 |
| The number of seconds in an hour. | |
| float | MINIMUM_INTERVAL = 1800.0 |
| Minimum internval between scans. | |
| float | MINIMUM_LIFETIME = 0.5 |
| Minimum time before a telepoter is off-line. | |
| vector | WHITE_COLOUR = <1.0, 1.0, 1.0> |
| The RGB values for the colour white. | |
| float | SOLID_ALPHA = 1.0 |
| Alhpa valid for non-transparent text. | |
| float | monitor_interval = 7200 |
| Interval between scans in seconds. | |
| float | lifetime = 24 |
| This is maximum time between heartbeats for a working teleporter. | |
| string | location_world |
| integer | in_world_scan_only = FALSE |
| string | database_interface |
| The HTTP address for invoking the php script to do the scanning & deleting. | |
| key | scan_key |
| The key to link the HTTP Request to the HTTP Response. | |
| list | scan_list |
| integer | scan_only = TRUE |
| A flag to request a scan for dead teleporter but without deleteing them. | |
Script to monitor life of known Teleporters.
NOTE: The file extension ".osl" indicates the script uses the Open Simulator Script language (OSSL) and will not function in the Second Life environment. If the script will function using just the Linden Scripting Language (LSL), it will have a a file extension of ".lsl".
Definition in file teleport_destination_monitor.osl.
| integer rdCalcCommsChannel | ( | ) |
Definition at line 265 of file teleport_destination_monitor.osl.
| integer rdConvertTrueFalse | ( | string | TrueFalseString | ) |
Convert "True/False" string into an integer.
| The | String to convert |
This routine is case insensitive when converting the string into a TRUE or FALSE value. For simplicity, only a "true" string will be converted into TRUE, while any other string or null string will default to FALSE. The string is trimmed or leading and trailing spaces and folded to upper case before testing.
Definition at line 252 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard().
| rdReadConfigNotecard | ( | string | NotecardName | ) |
Definition at line 278 of file teleport_destination_monitor.osl.
References COMMENT_PREAMBLE, COMMENT_PREAMBLE_LENGTH, DATABASE_INTERFACE, database_interface, IN_WORLD_ONLY, LIFE_TIME, lifetime, MINIMUM_INTERVAL, MINIMUM_LIFETIME, MONITOR_INTERVAL, monitor_interval, rdConvertTrueFalse(), SCAN_ONLY, scan_only, and SECONDS_PER_HOUR.
Referenced by rdStateEntry().
| rdsScanDestinationDatabase | ( | ) |
Scan the Teleporters in the database.
This routine send a trigger message the php script telling it to scan the teleporter table to see if any of the teleporters have timed out due to missed heartbeat messages from the teleporter. The routine also tells the php script whether to just report that a time-out hac occured, or to also delete timed out entries from the database table.
It should be noted that the php routine is also used to register and update teleporters that send their own heartbeat messages. Thw action taken by the php routine depend on the type of command sent to it.
If a teleporter was deleted as having timed out and is restored to operation, it will be treated as a new database and automatically put back in the database for inclusion in the destination lists sent to each teleporter when it next sends a heartbeat message.
Definition at line 334 of file teleport_destination_monitor.osl.
References database_interface, lifetime, location_world, scan_key, scan_only, and VERSION_STRING.
Referenced by rdStateEntry().
| rdStateEntry | ( | ) |
Routine to call to initialise the Script.
Definition at line 363 of file teleport_destination_monitor.osl.
References CONFIG_NOTECARD_NAME, location_world, monitor_interval, rdReadConfigNotecard(), and rdsScanDestinationDatabase().
| rdWriteStatusNotercard | ( | ) |
Write a Scan's results to the Status Notecard.
If there is not an existing Status Notecard, it will create a new one and including the results. If there is an existing Status Notecard, it wil append the new results to the end of the existing Notecard.
Definition at line 194 of file teleport_destination_monitor.osl.
References scan_list, STATUS_NOTECARD_NAME, and VERSION_STRING.
| string COMMENT_PREAMBLE = "//" |
Definition at line 68 of file teleport_destination_monitor.osl.
| integer COMMENT_PREAMBLE_LENGTH = 2 |
Definition at line 74 of file teleport_destination_monitor.osl.
| string CONFIG_NOTECARD_NAME = "teleport_destination_monitor.conf" |
Definition at line 26 of file teleport_destination_monitor.osl.
| string DATABASE_INTERFACE = "DATABASE_INTERFACE" |
The Identifier for the Database Interface URL.
The Configuration File Identifier for the Database Interface URL.
The configuration prompt for the database URL.
Definition at line 38 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard().
| string database_interface |
The HTTP address for invoking the php script to do the scanning & deleting.
The address of the database interface.
Definition at line 160 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard(), rdSendHeartbeatMessage(), and rdsScanDestinationDatabase().
| string IN_WORLD_ONLY = "IN_WORLD_ONLY" |
Configuration Setting Flag.
Definition at line 62 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard().
| integer in_world_scan_only = FALSE |
Definition at line 153 of file teleport_destination_monitor.osl.
| string LIFE_TIME = "LIFE_TIME" |
The configuration prompt for the Teleporer LifeTime in the database.
Definition at line 50 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard().
| float lifetime = 24 |
This is maximum time between heartbeats for a working teleporter.
If the last heartbeat was detected more than this time in the past, the teleporter is considered to be off-line.
Definition at line 135 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard(), and rdsScanDestinationDatabase().
| string location_world |
Definition at line 144 of file teleport_destination_monitor.osl.
| float MINIMUM_INTERVAL = 1800.0 |
Minimum internval between scans.
Definition at line 87 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard().
| float MINIMUM_LIFETIME = 0.5 |
Minimum time before a telepoter is off-line.
The minimum time that can be set is 30 minutes (0.5 hours), but so short a duration should only be used when teleporters are being removed by the owner to ensure that the database is updated quickly.
If the simulation does not run continuously, the minimum lifetime should at least be the longest period that the simulator does not run, plus two times the monitor interval to ensure that working teleporters are not temporarily removed when the system starts.
Definition at line 101 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard().
| string MONITOR_INTERVAL = "MONITOR_INTERVAL" |
The configuration prompt for the monitoring interval.
Definition at line 44 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard().
| float monitor_interval = 7200 |
Interval between scans in seconds.
This parameter is initially set at 2 hours, but this can be overwritten by the configuration parameters.
Initially this period is set at 2 hours, but can be changed by the configuration parameters. The accuracy of long term timers is low, but this is not considered important as the exact interval is not critical.
Definition at line 126 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard(), and rdStateEntry().
| key scan_key |
The key to link the HTTP Request to the HTTP Response.
Definition at line 166 of file teleport_destination_monitor.osl.
Referenced by rdsScanDestinationDatabase().
| list scan_list |
Definition at line 175 of file teleport_destination_monitor.osl.
Referenced by rdWriteStatusNotercard().
| string SCAN_ONLY = "SCAN_ONLY" |
The configuratin prompt for the Scan-only or delete if expired flag.
Definition at line 56 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard().
| integer scan_only = TRUE |
A flag to request a scan for dead teleporter but without deleteing them.
This flag will scan the teleporter database for teleporters who have not been reporting for longer than the set LIFE_TIME. It will report theses teleporters, but it will not remove them from the database.
Definition at line 185 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard(), and rdsScanDestinationDatabase().
| float SECONDS_PER_HOUR = 3600.0 |
The number of seconds in an hour.
Definition at line 80 of file teleport_destination_monitor.osl.
Referenced by rdReadConfigNotecard().
| float SOLID_ALPHA = 1.0 |
Alhpa valid for non-transparent text.
Definition at line 113 of file teleport_destination_monitor.osl.
| string STATUS_NOTECARD_NAME = "teleport_monitor.txt" |
The name of the notcard holding the results.
Definition at line 32 of file teleport_destination_monitor.osl.
Referenced by rdWriteStatusNotercard().
| string VERSION_STRING = "1.0.0" |
Definition at line 20 of file teleport_destination_monitor.osl.
| vector WHITE_COLOUR = <1.0, 1.0, 1.0> |
The RGB values for the colour white.
Definition at line 107 of file teleport_destination_monitor.osl.