Changeset 683


Ignore:
Timestamp:
Jan 23, 2010, 5:23:04 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Nové sloupce Enabled pro povolení/zakázání světů, přihlšaovacích serverů a počítačů.
Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/realm.php

    r681 r683  
    1111    parent::__construct($System);
    1212    $this->Id = $Id;
    13     $DbResult = $this->Database->query('SELECT * FROM Realm WHERE Id='.$Id);
     13    $DbResult = $this->Database->query('SELECT * FROM Realm WHERE Id='.$Id.' AND Enabled=1');
    1414    $this->Data = $DbResult->fetch_assoc();
    1515    $this->CharactersDatabase = new Database($this->Data['DatabaseHost'], $this->Data['DatabaseUser'], $this->Data['DatabasePassword'], $this->Data['DatabaseCharacters']);
  • trunk/inc/server.php

    r681 r683  
    1313    parent::__construct($System);
    1414    $this->Id = $Id;
    15     $DbResult = $this->Database->query('SELECT * FROM Logon WHERE Id='.$Id);
     15    $DbResult = $this->Database->query('SELECT * FROM Logon WHERE Id='.$Id.' AND Enabled=1' );
    1616    $this->Data = $DbResult->fetch_assoc();
    1717    $this->ServerDatabase = new Database($this->Data['DatabaseHost'], $this->Data['DatabaseUser'], $this->Data['DatabasePassword'], $this->Data['DatabaseRealmd']);
     
    5353  {
    5454    $TotalCount = 0;
    55     $DbResult = $this->Database->query('SELECT Id FROM Realm');
     55    $DbResult = $this->Database->query('SELECT Id FROM Realm WHERE Enabled=1');
    5656    while($DbRow = $DbResult->fetch_assoc())
    5757    {
     
    7171  {
    7272    $TotalCount = 0;
    73     $DbResult = $this->Database->query('SELECT Id FROM Realm');
     73    $DbResult = $this->Database->query('SELECT Id FROM Realm WHERE Enabled=1');
    7474    while($DbRow = $DbResult->fetch_assoc())
    7575    {
     
    372372  {
    373373    $Output = '';
    374     $DbResult = $this->Database->query('SELECT COUNT(*) FROM Realm');
     374    $DbResult = $this->Database->query('SELECT COUNT(*) FROM Realm WHERE Enabled=1');
    375375    $DbRow = $DbResult->fetch_row();
    376376    $RealmCount = $DbRow[0];
  • trunk/inc/update_state.php

    r682 r683  
    1313// Check logon servers
    1414$System = new System($Config);
    15 $DbResult = $System->Database->query('SELECT Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host');
     15$DbResult = $System->Database->query('SELECT Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host AND Logon.Enabled=1');
    1616while($Logon = $DbResult->fetch_assoc())
    1717{
     
    2323
    2424// Check realms
    25 $DbResult = $System->Database->query('SELECT Realm.Id, Host.Address, Realm.Port FROM Realm JOIN Host ON Host.Id=Realm.Host');
     25$DbResult = $System->Database->query('SELECT Realm.Id, Host.Address, Realm.Port FROM Realm JOIN Host ON Host.Id=Realm.Host AND Realm.Enabled=1');
    2626while($Realm = $DbResult->fetch_assoc())
    2727{
  • trunk/pages/gmteam.php

    r682 r683  
    5555
    5656$Output .= ShowGMList(array('Id' => 0, 'Name' => 'Všechny světy'));
    57 $DbResult = $System->Database->query('SELECT * FROM Realm');
     57$DbResult = $System->Database->query('SELECT * FROM Realm WHERE Enabled=1');
    5858while($Realm = $DbResult->fetch_assoc())
    5959{
  • trunk/pages/realmlist.php

    r681 r683  
    33if(array_key_exists('Server', $_GET))
    44{
    5   $DbResult = $System->Database->query('SELECT Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host WHERE Logon.Id='.$_GET['Server']);
     5  $DbResult = $System->Database->query('SELECT Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host WHERE Logon.Id='.$_GET['Server'].' AND   Logon.Enabled=1');
    66  if($DbResult->num_rows > 0)
    77  {
     
    1515  $Output = '<h2 align="center">Seznam světů</h2>';
    1616
    17   $DbResult = $System->Database->query('SELECT Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host');
     17  $DbResult = $System->Database->query('SELECT Logon.Name, Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host WHERE Logon.Enabled=1');
    1818  while($DbRow = $DbResult->fetch_assoc())
    1919  {
    2020    $Server = new Server($System, $DbRow['Id']);
    21     $Output .= '<div style="text-align: center">Realmlist <a href="?page=realmlist&amp;Server='.$DbRow['Id'].'">'.$DbRow['Address'];
     21    $Output .= '<div style="text-align: center">'.$DbRow['Name'].' <a href="?page=realmlist&amp;Server='.$DbRow['Id'].'">'.$DbRow['Address'];
    2222    if($DbRow['Port'] != 3724) $Output .= ':'.$DbRow['Port'];
    2323    $Output .= '</a></div>';
     
    3131    '</tr>';
    3232 
    33     $DbResult2 = $System->Database->query('SELECT * FROM Realm WHERE Logon='.$Server->Id.' ORDER BY Name');
     33    $DbResult2 = $System->Database->query('SELECT * FROM Realm WHERE Logon='.$Server->Id.' AND Enabled=1 ORDER BY Name');
    3434    while($DbRow = $DbResult2->fetch_assoc())
    3535    {
  • trunk/pages/server.php

    r682 r683  
    11<?php
    22
    3 $DbResult = $System->Database->query('SELECT COUNT(*) FROM Realm');
     3$DbResult = $System->Database->query('SELECT COUNT(*) FROM Realm WHERE Enabled=1');
    44$DbRow = $DbResult->fetch_row();
    55$RealmCount = $DbRow[0];
     6
     7 // Check servers online state.
     8$DbResult = $System->Database->query('SELECT COUNT(*) FROM Logon WHERE Online = 1 AND Enabled=1');
     9$DbRow = $DbResult->fetch_row();
     10$OnlineState = $DbRow[0] > 0; // Report online state if one of all servers is online.
    611
    712$Output = '<h3 class="PageTitle">Server Heroes of Fantasy</h3>'.
     
    1217  <tr>
    1318    <td>Přihlašovací server je</td>
    14     <td>'.$server->OnlineStateImage($System->NetworkPortState($Config['Web']['WoWServerAddr'], 3724)).'</td>
     19    <td>'.$server->OnlineStateImage($OnlineState).'</td>
    1520  </tr>
    1621  <tr>
Note: See TracChangeset for help on using the changeset viewer.