|
Open Sim Global Calculations BRIGADOON-0011
Provide a php class that provides a series of calculations using global coordinates
|
Load a Table with Region Information from Open Simulator Config File Regions.ini. More...
Go to the source code of this file.
Functions | |
| rdOpenDatabase ($Database, $Host, $Username, $Password) | |
| Open the Support Database for Use. | |
| rdSaveRegion ($Parameters, $Pdo) | |
| Save a region to the Region Table. | |
Variables | |
| $pdo = rdOpenDatabase($db, $host, $db_username, $db_password) | |
| $region_data = [] | |
| $source_file = "/opt/ls_opensim/bin/Regions/Regions.ini" | |
| $lines = file($source_file, FILE_IGNORE_NEW_LINES) | |
| $array_size = count($lines) | |
Load a Table with Region Information from Open Simulator Config File Regions.ini.
The creation of this table is an interim step until access to this data becaomes available by a more supported method. Besides providing the data in the Regions.ini file, it also calculates the boundaries of the regions in global coordinates. This allows a simple method of determining which regon any position using global coordinates is in, by just using four comparisons in an SQL query. As in
This script is used to parse an Open Simulator "Regiion.ini" file into a database table. This is a very elemertary script as it assumes that is scanning a standard Regions.ini file where each region in the file is in the standard format below:
Definition in file load_region_table.php.
| rdOpenDatabase | ( | $Database, | |
| $Host, | |||
| $Username, | |||
| $Password ) |
Open the Support Database for Use.
| $Database | The Name of the Database to Open |
| $Host | The name of the computer use to conenct to the Database |
| $Username | The username to access the Database |
| $Password | The password to access the database. |
If this routine fails, it will case the program to abort and the heartbeat will neither identify itself as being on-line and it will not update the list of destinations.
Definition at line 61 of file load_region_table.php.
References $pdo.
| rdSaveRegion | ( | $Parameters, | |
| $Pdo ) |
Save a region to the Region Table.
| $Parameters | The Region Information |
| $Pdo | The Database Driver Instance |
Definition at line 96 of file load_region_table.php.
| $array_size = count($lines) |
Definition at line 137 of file load_region_table.php.
| $lines = file($source_file, FILE_IGNORE_NEW_LINES) |
Definition at line 136 of file load_region_table.php.
| $pdo = rdOpenDatabase($db, $host, $db_username, $db_password) |
Definition at line 128 of file load_region_table.php.
Referenced by OS_GLOBAL_CALCS\__construct(), OS_GLOBAL_CALCS\GlobalToLocal(), OS_GLOBAL_CALCS\LocalToGlobal(), rdOpenDatabase(), and OS_GLOBAL_CALCS\RegionBoundsGlobal().
| $region_data = [] |
Definition at line 130 of file load_region_table.php.
| $source_file = "/opt/ls_opensim/bin/Regions/Regions.ini" |
Definition at line 133 of file load_region_table.php.