| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
// $Id: secondlife.module,v 1.4.2.5 2009/06/11 15:56:40 kbahey Exp $ |
// $Id: secondlife.module,v 1.4.2.6 2009/06/11 15:58:32 kbahey Exp $ |
| 4 |
|
|
| 5 |
define('SECONDLIFE_LINDEN_SERVERS', '8.2.32.0/22,63.210.156.0/22,64.129.40.0/22,64.129.44.0/22,64.154.220.0/22,8.4.128.0/22,8.10.144.0/21,216.82.0.0/18'); |
define('SECONDLIFE_LINDEN_SERVERS', '8.2.32.0/22,63.210.156.0/22,64.129.40.0/22,64.129.44.0/22,64.154.220.0/22,8.4.128.0/22,8.10.144.0/21,216.82.0.0/18'); |
| 6 |
|
|
| 136 |
secondlife_get_session(); |
secondlife_get_session(); |
| 137 |
return; |
return; |
| 138 |
} |
} |
| 139 |
if (secondlife_timer()) { |
|
| 140 |
$start = _secondlife_getmillisecs(); |
// Get a timer to compute the answer timing. |
| 141 |
|
$timer_enabled = variable_get('secondlife_timer', 0); |
| 142 |
|
|
| 143 |
|
if ($timer_enabled) { |
| 144 |
|
timer_start('secondlife_request'); |
| 145 |
} |
} |
| 146 |
|
|
| 147 |
$sl = secondlife_get_session(); |
$sl = secondlife_get_session(); |
| 156 |
$sl->response['message'] = "function $func does not exist"; |
$sl->response['message'] = "function $func does not exist"; |
| 157 |
} |
} |
| 158 |
|
|
| 159 |
if (secondlife_timer()) { |
if ($timer_enabled) { |
| 160 |
$end = _secondlife_getmillisecs(); |
$sl->response['timer'] = timer_stop('secondlife_request'); |
|
$timer = $end - $start; |
|
|
$sl->response['timer'] = round($timer * 1000, 3); |
|
| 161 |
} |
} |
| 162 |
|
|
| 163 |
secondlife_send_response($sl); |
secondlife_send_response($sl); |
| 251 |
file_put_contents($debug, "$string\n", FILE_APPEND); |
file_put_contents($debug, "$string\n", FILE_APPEND); |
| 252 |
} |
} |
| 253 |
} |
} |
|
/** |
|
|
* Get a timer to compute the answer timing. |
|
|
*/ |
|
|
function secondlife_timer() { |
|
|
$timer = variable_get('secondlife_timer', ''); |
|
|
if ($timer) { |
|
|
return TRUE; |
|
|
} |
|
|
return FALSE; |
|
|
} |
|
|
|
|
|
/** |
|
|
* Compute milliseconds. |
|
|
*/ |
|
|
function _secondlife_getmillisecs() { |
|
|
list($usec, $sec) = explode (' ', microtime()); |
|
|
return (double) $sec + $usec; |
|
|
} |
|
| 254 |
|
|
| 255 |
/** |
/** |
| 256 |
* Check the ip. |
* Check the ip. |