/[drupal]/contributions/modules/secondlife/secondlife.module
ViewVC logotype

Diff of /contributions/modules/secondlife/secondlife.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.4.2.6, Thu Jun 11 15:58:32 2009 UTC revision 1.4.2.7, Thu Jun 11 18:17:39 2009 UTC
# Line 1  Line 1 
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    
# Line 136  function secondlife_request() { Line 136  function secondlife_request() {
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();
# Line 152  function secondlife_request() { Line 156  function secondlife_request() {
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);
# Line 249  function secondlife_debug($string) { Line 251  function secondlife_debug($string) {
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.

Legend:
Removed from v.1.4.2.6  
changed lines
  Added in v.1.4.2.7

  ViewVC Help
Powered by ViewVC 1.1.2