Changeset 630 for trunk/pages


Ignore:
Timestamp:
Aug 26, 2009, 3:07:07 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Podpora pro umístění světů na oddělených serverech. Vzdálené připojení k databázi.
  • Přidáno: Třída Realm pro sadu funkcí týkajících se světů.
  • Přidáno: Třída System pro reprezentaci obecných funkcí.
Location:
trunk/pages
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/pages/arena.php

    r614 r630  
    1818}
    1919
    20 $db->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
     20$Realm = new Realm($System, $_COOKIE['RealmIndex']);
     21$db = $Realm->Database;
     22$db->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);
     23
    2124$count = $db->query('SELECT COUNT(*) FROM arena_team')->fetch_row();
    2225$all_record = $count[0];
  • trunk/pages/commands.php

    r614 r630  
    44$Output .= $server->RealmSelection();
    55
    6 $db->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseMangos']);
     6$Realm = new Realm($System, $_COOKIE['RealmIndex']);
     7$db = $Realm->Database;
     8$db->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseMangos']);
    79
    810$Output .= '<ul>';
  • trunk/pages/events.php

    r614 r630  
    9090echo('<h3 class="PageTitle">Události ve hře</h3>');
    9191echo($server->RealmSelection());
     92$Realm = new Realm($System, $_COOKIE['RealmIndex']);
     93$db = $Realm->Database;
     94$db->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseMangos']);
    9295
    9396$Events = Events();
  • trunk/pages/gmteam.php

    r627 r630  
    33function ShowGMList($Realm)
    44{
    5   global $db, $Config;
     5  global $db, $db2, $Config;
    66 
    77  $Result = $db->query('SELECT * FROM `GmTeam` WHERE (`RealmId` = '.$Realm['Id'].') AND (`TimeTo` IS NULL) ORDER BY `RealmId`, `Nick`');
     
    2121    $Output .= '<td>';
    2222    $Characters = array();
    23     $ResultMangos = $db->query('SELECT * FROM `'.$Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters'].'`.`characters` WHERE `account` = "'.$Line['AccountId'].'"');
     23    $ResultMangos = $db2->query('SELECT * FROM `characters` WHERE `account` = "'.$Line['AccountId'].'"');
    2424    while($LineMangos = $ResultMangos->fetch_array())
    2525    {
     
    4949//$_COOKIE['RealmIndex']
    5050
     51$Realm = new Realm($System, $_COOKIE['RealmIndex']);
     52$db2 = $Realm->Database;
     53$db2->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);
     54
    5155$db->select_db($Config['Database']['Database']);
    5256$Output = '<h2 class="PageTitle">GM tým</h3>';
  • trunk/pages/guilda.php

    r609 r630  
    1010}
    1111
    12 $db->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
     12$Realm = new Realm($System, $_COOKIE['RealmIndex']);
     13$db = $Realm->Database;
     14$db->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);
    1315$id = (isset($_GET['id'])) ? $_GET['id'] : 0;
    1416if($id != 0)
  • trunk/pages/guildy.php

    r614 r630  
    4343  </tr>');
    4444
    45 $db->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
     45$Realm = new Realm($System, $_COOKIE['RealmIndex']);
     46$db = $Realm->Database;
     47$db->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);
    4648
    4749$sql = $db->query('SELECT `guild`.homepage, `guild`.name, `guild`.guildid, `guild`.createdate, COUNT(`guild_member`.`guildid`) AS member_count ,`leader`.`race` IN (1, 3, 4, 7, 11) AS fraction , `leader`.`guid` AS leader FROM `guild` JOIN `guild_member` ON `guild_member`.`guildid` = `guild`.`guildid` JOIN `characters` AS `memebers` ON `memebers`.`guid`= `guild_member`.`guid` JOIN `characters` AS `leader` ON `leader`.`guid`= `guild`.`leaderguid` GROUP BY guild.name ORDER BY '.$order_by.' '.$order_dir.';');
  • trunk/pages/online.php

    r615 r630  
    2424echo($server->RealmSelection());
    2525
    26 echo('<div style="text-align: center">Celkem '.$server->MangosOnline($_COOKIE['RealmIndex']).' hráčů.</div>'.
     26$Realm = new Realm($System, $_COOKIE['RealmIndex']);
     27echo('<div style="text-align: center">Celkem '.$Realm->OnlineCharactersCount().' hráčů.</div>'.
    2728'<table class="BaseTable">
    2829  <tr>
     
    3637    MakeLink('Aréna body', 'arena_points').'</th></tr>');
    3738
    38 $db->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
    39 $sql = $db->query('SELECT guid, name, race, class, zone, map, '.
     39$Realm->Database->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
     40$sql = $Realm->Database->query('SELECT guid, name, race, class, zone, map, '.
    4041  'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['HonorPoints'].'+1), " ", -1) AS UNSIGNED) AS highest_rank, '.
    4142  'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['Level'].' + 1), " ", -1) AS UNSIGNED) AS level, '.
  • trunk/pages/realmlist.php

    r616 r630  
    1818  if($DbResult->num_rows > 0)
    1919  {
     20    $Realm = new Realm($System, $Index);
    2021    $DbRow = $DbResult->fetch_assoc();
    21     $Output .= '<tr><td><a href="?page=online&amp;RealmIndex='.$Index.'">'.$RealmConfig['Name'].'</a></td><td>'.$RealmConfig['XPRate'].'x</td><td>'.$RealmConfig['Type'].'</td><td>'.$server->ServerImg($server->ServerOnline($DbRow['address'], $DbRow['port'])).'</td><td>'.$server->MangosOnline($Index).' / '.$RealmConfig['MaxOnlinePlayers'].' / '.$server->CharacterCount($Index).'</td></tr>';
     22    $Output .= '<tr><td><a href="?page=online&amp;RealmIndex='.$Index.'">'.$RealmConfig['Name'].'</a></td><td>'.$RealmConfig['XPRate'].'x</td><td>'.$RealmConfig['Type'].'</td><td>'.$server->OnlineStateImage($System->NetworkPortState($DbRow['address'], $DbRow['port'])).'</td><td>'.$Realm->OnlineCharactersCount($Index).' / '.$RealmConfig['MaxOnlinePlayers'].' / '.$Realm->CharacterCount($Index).'</td></tr>';
    2223    $Output .= '<tr><td colspan="5">'.$RealmConfig['Description'].'</td></tr>';
    2324    if(array_key_exists($Index + 1, $Config['Mangos']['RealmList'])) $Output .= '<tr><td colspan="5">&nbsp;</td></tr>';
  • trunk/pages/server.php

    r628 r630  
    88  <tr>
    99    <td>Přihlašovací server je</td>
    10     <td>'.$server->ServerImg($server->ServerOnline($Config['Web']['WoWServerAddr'], 3724)).'</td>
     10    <td>'.$server->OnlineStateImage($System->NetworkPortState($Config['Web']['WoWServerAddr'], 3724)).'</td>
    1111  </tr>
    1212  <tr>
     
    1616  <tr>
    1717    <td>Ve všech světech přítomno</td>
    18     <td>'.$server->ServerMangosOnline().' hráčů</td>
    19   </tr>
    20   <tr>
    21     <td>Server beží bez restartu</td>
    22     <td>'.$server->ServerUptime().' (hodiny)</td>
     18    <td>'.$server->OnlineAccountCount().' hráčů</td>
    2319  </tr>
    2420  <tr>
     
    2824  <tr>
    2925    <td>Ve všech světech uloženo</td>
    30     <td>'.$server->ServerCharacterCount().' postav</td>
     26    <td>'.$server->CharacterCount().' postav</td>
    3127  </tr>
    3228  <tr>
    3329    <td><a href="?page=teamspeak">TeamSpeak</a> server je</td>
    34     <td>'.$server->ServerImg($server->ServerOnline($Config['Web']['WoWServerAddr'], 51234)).'</td>
     30    <td>'.$server->OnlineStateImage($System->NetworkPortState($Config['Web']['WoWServerAddr'], 51234)).'</td>
    3531  </tr>
    3632  <tr>
    3733    <td><a href="http://www.heroesoffantasy.cz:6969/">Torrent</a> server je</td>
    38     <td>'.$server->ServerImg($server->ServerOnline($Config['Web']['WoWServerAddr'], 6969)).'</td>
     34    <td>'.$server->OnlineStateImage($System->NetworkPortState($Config['Web']['WoWServerAddr'], 6969)).'</td>
    3935  </tr>
    4036  <tr>
     
    6561{
    6662  $Realms = array();
    67   foreach($Server['Realms'] as $Realm)
    68     $Realms[] = $Config['Mangos']['RealmList'][$Realm]['Name'];
     63  foreach($Config['Mangos']['RealmList'] as $RealmIndex => $Realm)
     64  {
     65    if($Realm['Server'] == $Index) $Realms[] = $Realm['Name'];
     66  }
    6967   
    7068  $Output .= '<table class="BaseTable" style="width: 100%; margin: 5px;">
  • trunk/pages/tophraci.php

    r614 r630  
    2121}
    2222
    23 $db->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
     23$Realm = new Realm($System, $_COOKIE['RealmIndex']);
     24$db = $Realm->Database;
     25$db->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);
     26
    2427$sql = 'SELECT name, totaltime, online FROM characters ORDER BY totaltime DESC LIMIT '.$top;
    2528$result = $db->query($sql);
Note: See TracChangeset for help on using the changeset viewer.