Changeset 614 for trunk/stat


Ignore:
Timestamp:
Aug 7, 2009, 11:38:12 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Výběr světa i na začátku stránek, kterých se výběr týká.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/stat/stat.php

    r591 r614  
    55$Username = $Config['Database']['User'];
    66$Password = $Config['Database']['Password'];
    7 $Database = $Config['Mangos']['DatabaseMangos']; // must contains characters table
     7$Database = $Config['Mangos']['RealmList'][1]['DatabaseMangos']; // must contains characters table
    88$RealmHostname = $Hostname;
    99$RealmUsername = $Username;
    1010$RealmPassword = $Password;
    1111$RealmDatabase = $Config['Mangos']['DatabaseRealmd'];  // must contains zone_coordinates and accounts table
    12 $CharactersDatabase = $Config['Mangos']['DatabaseCharacters'];  // must contains zone_coordinates and accounts table
     12$CharactersDatabase = $Config['Mangos']['RealmList'][1]['DatabaseCharacters'];  // must contains zone_coordinates and accounts table
    1313$EmuVersion = $Config['Mangos']['ClientVersion'];
    1414$Owner = $Config['Web']['Admin'];
     
    5252"    <players>\r\n";
    5353
    54         $realm_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword);
    55         mysql_select_db($RealmDatabase, $realm_db);
     54  $realm_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword);
     55  mysql_select_db($RealmDatabase, $realm_db);
    5656  $db_result = mysql_query("SET NAMES $DatabaseEncoding", $realm_db);
    5757
    58         $mangos_db = mysql_connect($Hostname, $Username, $Password, TRUE);
    59         mysql_select_db($Database, $mangos_db);
     58  $mangos_db = mysql_connect($Hostname, $Username, $Password, TRUE);
     59  mysql_select_db($Database, $mangos_db);
    6060  $db_result = mysql_query("SET NAMES $DatabaseEncoding", $mangos_db);
    6161 
    62         $characters_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword);
    63         mysql_select_db($CharactersDatabase, $characters_db);
     62  $characters_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword);
     63  mysql_select_db($CharactersDatabase, $characters_db);
    6464  $db_result = mysql_query("SET NAMES $DatabaseEncoding", $characters_db);
    6565
    6666  $db_result = mysql_query("SELECT * FROM `characters` WHERE `online`='1' ORDER BY `name`", $characters_db);
    67         while($result = mysql_fetch_array($db_result))
    68         {
     67  while($result = mysql_fetch_array($db_result))
     68  {
    6969    // Get GM level by character
    7070    $db_result2 = mysql_query("SELECT gmlevel FROM `account` WHERE `id`='".$result['account']."'", $realm_db);
     
    7373   
    7474    $char_data = explode(' ',$result['data']);
    75                 $Result .= "      <player>\r\n".
     75    $Result .= "      <player>\r\n".
    7676    "        <name>".$result['name']."</name>\r\n".
    7777    "        <race>".$result['race']."</race>\r\n".
     
    9292function get_zone_name($mapid, $x, $y)
    9393{
    94         global $realm_db;
    95         $query = mysql_query("SELECT * FROM `zone_coordinates` ORDER BY `priory`", $realm_db);
    96         $zmap = 0;
    97         while($result = mysql_fetch_array($query))
    98         {
    99         if ($result['map']==$mapid AND $result['y_min'] < $x  AND $result['y_max'] > $x AND $result['x_max'] < $y  AND $result['x_min'] > $y) $zmap=$result['zone_id'];
    100         }
    101         return $zmap;
     94  global $realm_db;
     95  $query = mysql_query("SELECT * FROM `zone_coordinates` ORDER BY `priory`", $realm_db);
     96  $zmap = 0;
     97  while($result = mysql_fetch_array($query))
     98  {
     99    if ($result['map']==$mapid AND $result['y_min'] < $x  AND $result['y_max'] > $x AND $result['x_max'] < $y  AND $result['x_min'] > $y) $zmap=$result['zone_id'];
     100  }
     101  return $zmap;
    102102}
    103103
Note: See TracChangeset for help on using the changeset viewer.