Changeset 404


Ignore:
Timestamp:
Jan 28, 2009, 11:23:01 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Názvy databází MaNGOSu přesunuty do konfiguračního souboru a odkazované skripty upraveny k použití těchto proměnných.
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • administrace/global.php

    r362 r404  
    44
    55// Configuration
    6 $MangosConfFile = '/a/mangos/etc/mangosd.conf';
    7 $StdOutLogFile = '/a/log/mangos/mangos-worldd.log';
    8 $ErrOutLogFile = '/a/log/mangos/mangos-worldd.err';
    9 $MangosLogFile = '/a/log/mangos/Server.log';
    10 $MangosDbErrorsLogFile = '/a/log/mangos/DBErrors.log';
     6$MangosConfFile = '/a/mangos1/etc/mangosd.conf';
     7$StdOutLogFile = '/a/mangos1/log/mangos-worldd.log';
     8$ErrOutLogFile = '/a/mangos1/log/mangos-worldd.err';
     9$MangosLogFile = '/a/mangos1/log/Server.log';
     10$MangosDbErrorsLogFile = '/a/mangos1/log/DBErrors.log';
    1111$ItemPerPage = 35;
    1212
  • administrace/home.php

    r389 r404  
    33function Show()
    44{
    5   global $Database;
     5  global $Database, $Config;
    66 
    77  echo('<h3>Správa serveru</h3>');
     
    1111  echo('<a href="gm_rules.php">Pravidla pro GM</a><br>');
    1212  echo('</td><td valign="top">');
    13   echo('<a href="http://game.zdechov.net/statistic/">Statistiky provozu</a><br>');
     13  echo('<a href="http://stat.zdechov.net/game/">Statistiky provozu</a><br>');
    1414  echo('<a href="../navody/">Návody</a><br>');
    1515  echo('<a href="../db/index.php?id=bugreport">Bug report</a>');
     
    2929
    3030  echo('<table class="TableAdmin" cellspacing="0" width="100%" style="color: white;" border="1">');
    31   $DbResult = $Database->query('SELECT wow.gm_news.text as text, realmd.account.username as username FROM wow.gm_news JOIN realmd.account ON wow.gm_news.author = realmd.account.Id ORDER BY wow.gm_news.time DESC LIMIT '.$Page*$PerPage.', '.$PerPage);
     31  $DbResult = $Database->query('SELECT wow.gm_news.text as text, '.$Config['Mangos']['DatabaseRealmd'].'.account.username as username FROM wow.gm_news JOIN '.$Config['Mangos']['DatabaseRealmd'].'.account ON wow.gm_news.author = '.$Config['Mangos']['DatabaseRealmd'].'.account.Id ORDER BY wow.gm_news.time DESC LIMIT '.$Page*$PerPage.', '.$PerPage);
    3232  while($Row = $DbResult->fetch_array())
    3333  {
  • administrace/process_log.php

    r371 r404  
    2222
    2323// Get used database version from database
    24 $DbResult = $Database->query('SELECT * FROM `mangos`.`db_version`');
     24$DbResult = $Database->query('SELECT * FROM `'.$Config['Mangos']['DatabaseMangos'].'`.`db_version`');
    2525$DbRow = $DbResult->fetch_array();
    2626$DbVersion = $DbRow['version'];
    2727
    2828// Get last uptime info
    29 $DbResult = $Database->query('SELECT * FROM `mangos`.`uptime` ORDER BY `starttime` DESC LIMIT 1');
     29$DbResult = $Database->query('SELECT * FROM `'.$Config['Mangos']['DatabaseMangos'].'`.`uptime` ORDER BY `starttime` DESC LIMIT 1');
    3030echo($Database->error);
    3131$DbRow = $DbResult->fetch_array();
  • administrace/rss_tickets.php

    r389 r404  
    77// Get news from database by selected categories
    88$Items = array();
    9 $Database->select_db('characters');
     9$Database->select_db($Config['Mangos']['DatabaseCharacters']);
    1010$DbResult = $Database->query("SELECT `character_ticket`.`ticket_text` AS `text`, `characters`.`name` AS `name` FROM `character_ticket` JOIN `characters` ON `characters`.`guid` = `character_ticket`.`guid`");
    1111while($Row = $DbResult->fetch_array())
  • administrace/user.php

    r389 r404  
    2323  function Login($Username, $Password)
    2424  {
     25    global $Config;
    2526    global $Database;
    26     $Database->select_db('realmd');
     27    $Database->select_db($Config['Mangos']['DatabaseRealmd']);
    2728    $DbResult = $Database->select('account', 'Id,username', '(gmlevel > 0) AND (username = "'.$Username.'") AND (sha_pass_hash = SHA1(CONCAT(UCASE("'.$Username.'"),":",UCASE("'.$Password.'"))))');
    2829    if($DbResult->num_rows > 0)
  • config.sample.php

    r403 r404  
    2020    'MaxOnlinePlayers' => 100,
    2121    'RequiredOnlinePlayers' => 70,
     22    'DatabaseMangos' => 'mangos',
     23    'DatabaseCharacters' => 'characters',
     24    'DatabaseRealmd' => 'realmd',
     25    'DatabaseScriptDev2' => 'scriptdev2',
    2226  ),
    2327  'Web' => array(
  • events.php

    r389 r404  
    11<?php
     2include('global.php');
    23
    34$EventsLinks = array(
     
    4041function Events()
    4142{
    42   global $Database, $EventsLinks;
     43  global $Database, $EventsLinks, $Config;
     44
    4345  $Events = array('Running' => array(), 'Planned' => array());
    44   $Database->select_db('mangos');
     46  $Database->select_db($Config['Mangos']['DatabaseMangos']);
    4547 
    4648  // Add already started events
     
    8789}
    8890
    89 include('global.php');
    9091ShowHeader();
    9192
  • global.php

    r403 r404  
    4141function OnlinePlayerCount()
    4242{
    43   global $Database;
    44   $Database->select_db('characters');
     43  global $Database, $Config;
     44 
     45  $Database->select_db($Config['Mangos']['DatabaseCharacters']);
    4546  $Result = $Database->select('characters', 'COUNT(*)', 'online=1');
    4647  $Row = $Result->fetch_array();
     
    5051function CharacterCount()
    5152{
    52   global $Database;
    53   $Database->select_db('characters');
     53  global $Database, $Config;
     54  $Database->select_db($Config['Mangos']['DatabaseCharacters']);
    5455  $Result = $Database->select('characters', 'COUNT(*)');
    5556  $Row = $Result->fetch_array();
     
    5960function AccountCount()
    6061{
    61   global $Database;
    62   $Database->select_db('realmd');
     62  global $Database, $Config;
     63  $Database->select_db($Config['Mangos']['DatabaseRealmd']);
    6364  $DbResult = $Database->query('SELECT COUNT(*) FROM account');
    6465  $Row = $DbResult->fetch_array();
     
    6869function MangosUptime()
    6970{
    70   global $Database;
    71   $Database->select_db('mangos');
     71  global $Database, $Config;
     72  $Database->select_db($Config['Mangos']['DatabaseMangos']);
    7273  $DbResult = $Database->query('SELECT `starttime`, `uptime` FROM `uptime` ORDER BY `starttime` DESC LIMIT 1');
    7374  $Row = $DbResult->fetch_array();
     
    8586function RunningEventCount()
    8687{
    87   global $Database;
     88  global $Database, $Config;
    8889  $Count = 0;
    89   $Database->select_db('mangos');
     90  $Database->select_db($Config['Mangos']['DatabaseMangos']);
    9091  $DbResult = $Database->select('game_event', 'occurence, length, UNIX_TIMESTAMP(start_time) as start', 'end_time > NOW() AND start_time < NOW()');
    9192  while($Row = $DbResult->fetch_array())
  • gm.php

    r390 r404  
    1010
    1111$ChronosId = 11432;
    12 $Database->select_db('realmd');
     12$Database->select_db($Config['Mangos']['DatabaseRealmd']);
    1313$Result = $Database->query('SELECT * FROM account WHERE (locked = 0) AND (id != '.$ChronosId.') AND (gmlevel > 0) ORDER BY gmlevel DESC');
    1414echo('<table border="0">');
     
    3333  $Acc = $Line['AccID'];
    3434*/
    35   $Database->select_db('characters');
     35  $Database->select_db($Config['Mangos']['DatabaseCharacters']);
    3636  echo('<tr><td><p>GM Postavy ve hře:</p></td>');
    3737  echo('<td><p><b>');
     
    4646  echo('</b></p></td></tr>');
    4747
    48   $Database->select_db('realmd');
     48//  $Database->select_db($Config['Mangos']['DatabaseRealmd']);
    4949  if($Line['ForumId'] != 0)
    5050  {
  • guildy.php

    r389 r404  
    2828}
    2929
    30 $Database->select_db('characters');
     30$Database->select_db($Config['Mangos']['DatabaseCharacters']);
    3131if(!array_key_exists('guild', $_GET))
    3232{
  • honor.php

    r391 r404  
    44
    55  echo('<h3>Nejlepší hráči:</h3><div align="center">');
    6   $Database->select_db('characters');
     6  $Database->select_db($Config['Mangos']['DatabaseCharacters']);
    77
    88  $HonorRanks = array(
  • index.php

    r403 r404  
    3737include('registrace/reg_config.php');
    3838$AccountCount = AccountCount();
    39 $Remain = $MaximumAccountCount-$AccountCount;
     39$Remain = $MaximumAccountCount - $AccountCount;
    4040if($Remain <= 0) echo('VYČERPANÉ'); else echo('VOLNÉ');
    4141echo('</td></tr>');
     
    7474<div>');
    7575$ChronosId = 11432;
    76 $Database->select_db('realmd');
     76$Database->select_db($Config['Mangos']['DatabaseRealmd']);
    7777$Result = $Database->query('SELECT username FROM account WHERE (locked = 0) AND (id != '.$ChronosId.') AND (gmlevel > 0) ORDER BY gmlevel DESC');
    7878while($Row = $Result->fetch_array())
  • online_player.php

    r389 r404  
    44
    55  echo('<h3>Online hráči:</h3><div align="center">');
    6   $Database->select_db('characters');
     6  $Database->select_db($Config['Mangos']['DatabaseCharacters']);
    77
    88        $order_by = (isset($_GET['order_by'])) ? $Database->real_escape_string($_GET['order_by']) : "name";
  • registrace/index.php

    r403 r404  
    55include('reg_config.php');
    66
    7 $Database->select_db('realmd');
     7$Database->select_db($Config['Mangos']['DatabaseRealmd']);
    88$DbResult = $Database->query('SELECT COUNT(*) FROM account');
    99$Row = $DbResult->fetch_array();
  • stat/stat.php

    r313 r404  
    55$Username = $Config['Database']['User'];
    66$Password = $Config['Database']['Password'];
    7 $Database = 'mangos'; // must contains characters table
     7$Database = $Config['Mangos']['DatabaseMangos']; // must contains characters table
    88$RealmHostname = $Hostname;
    99$RealmUsername = $Username;
    1010$RealmPassword = $Password;
    11 $RealmDatabase = 'realmd';  // must contains zone_coordinates and accounts table
    12 $CharactersDatabase = 'characters';  // must contains zone_coordinates and accounts table
     11$RealmDatabase = $Config['Mangos']['DatabaseRealmd'];  // must contains zone_coordinates and accounts table
     12$CharactersDatabase = $Config['Mangos']['DatabaseCharacters'];  // must contains zone_coordinates and accounts table
    1313$EmuVersion = $Config['Mangos']['Version'];
    1414$Owner = $Config['Web']['Admin'];
  • system/freeze_restart.php

    r389 r404  
    33$RestartDeadTime = 3 * 60; // Maximum dead time [seconds]
    44$LoopSleepTime = 10; // Checking period [seconds]
    5 $MangosProcessName = '/a/mangos/bin/mangos-worldd';
     5$MangosProcessName = '/a/mangos1/bin/mangos-worldd';
    66
    77include('../global.php');
     
    99echo('MaNGOS freeze restarter. Checking DB every '.$LoopSleepTime." seconds\n");
    1010$Restarted = 0;
    11 $Database->select_db('mangos');
     11$Database->select_db('realm1_mangos');
    1212while(1)
    1313{
Note: See TracChangeset for help on using the changeset viewer.