Changeset 7 for measure_scripts


Ignore:
Timestamp:
Oct 16, 2007, 10:23:06 PM (17 years ago)
Author:
george
Message:

Opraveno načítání infrormací o počítači do databáze.
Přidána sekce vývoje.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • measure_scripts/traffic.php

    r6 r7  
    9797while(1)
    9898{
    99  
    10099  // Network load
    101100  $NetworkStat = GetNetworkStat();
     
    115114 
    116115  // GM online
    117   DB_Init('localhost', 'root', '', 'realmd');
    118   DB_Query('SELECT COUNT(*) FROM account WHERE online=1 AND gmlevel > 0');
    119   $Row = DB_Row();
     116  $Database->select_db('realmd');
     117  $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1 AND gmlevel > 0');
     118  $Row = $DbResult->fetch_array();
    120119  $Value = $Row[0];
    121120  file_get_contents($URL.'?MeasureId=10&Value='.$Value);
    122121 
    123122  // Players online
    124   DB_Query('SELECT COUNT(*) FROM account WHERE online=1');
    125   $Row = DB_Row();
     123  $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1');
     124  $Row = $DbResult->fetch_array();
    126125  $Value = $Row[0];
    127126  file_get_contents($URL.'?MeasureId=5&Value='.$Value);
     
    132131 
    133132  // Account count
    134   DB_Query('SELECT COUNT(*) FROM account');
    135   $Row = DB_Row();
     133  $DbResult = $Database->query('SELECT COUNT(*) FROM account');
     134  $Row = $DbResult->fetch_array();
    136135  $Value = $Row[0];
    137136  file_get_contents($URL.'?MeasureId=8&Value='.$Value);
    138137 
    139138  // Character count
    140   DB_Init('localhost', 'root', '', 'mangos');
    141   DB_Query('SELECT COUNT(*) FROM `character`');
    142   $Row = DB_Row();
     139  $Database->select_db('mangos');
     140  $DbResult = $Database->query('SELECT COUNT(*) FROM `character`');
     141  $Row = $DbResult->fetch_array();
    143142  $Value = $Row[0];
    144143  file_get_contents($URL.'?MeasureId=13&Value='.$Value);
    145144 
    146145  // Guild count
    147   DB_Query('SELECT COUNT(*) FROM guild');
    148   $Row = DB_Row();
     146  $DbResult = $Database->query('SELECT COUNT(*) FROM guild');
     147  $Row = $DbResult->fetch_array();
    149148  $Value = $Row[0];
    150149  file_get_contents($URL.'?MeasureId=14&Value='.$Value);
    151150
    152151  // MaNGOS restarts count
    153   DB_Init('localhost', 'root', '', 'wow');
    154   DB_Query('SELECT COUNT(*) FROM mangos_restart');
    155   $Row = DB_Row();
     152  $Database->select_db('wow');
     153  $DbResult = $Database->query('SELECT COUNT(*) FROM mangos_restart');
     154  $Row = $DbResult->fetch_array();
    156155  $Value = $Row[0];
    157156  file_get_contents($URL.'?MeasureId=6&Value='.$Value);
    158  
    159  
    160  
     157   
    161158  sleep(60);
    162159}
Note: See TracChangeset for help on using the changeset viewer.