Changeset 20 for trunk/www/server.php


Ignore:
Timestamp:
Jun 12, 2009, 11:18:23 AM (15 years ago)
Author:
george
Message:
  • Přidáno: Generování souboru realmlist.wtf.
  • Upraveno: Uchování portu realmd a worldd v databází namísto výpočtu z Id serveru.
  • Opraveno: Zobrazení hodnot dle skriptů typů v obecné tabulce.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/server.php

    r19 r20  
    1010  var $Server;
    1111  var $Task;
    12   var $WorlddBaseNetworkPort = 8085;
    13   var $RealmdBaseNetworkPort = 3724;
    14   var $MangosWorlddThreadCountMax = 12;
    1512 
    1613  function __construct($Database, $Id)
     
    114111  {
    115112    $State = array();
    116     $State['RealmdPortState'] = $this->NetworkPortState('localhost', $this->RealmdBaseNetworkPort + $this->Server['Id']);
    117     $State['WorlddPortState'] = $this->NetworkPortState('localhost', $this->WorlddBaseNetworkPort + $this->Server['Id']);
     113    $State['RealmdPortState'] = $this->NetworkPortState('localhost', $this->Server['NetworkPortRealmd']);
     114    $State['WorlddPortState'] = $this->NetworkPortState('localhost', $this->Server['NetworkPortWorldd']);
    118115    $State['Online'] = $State['RealmdPortState'] and $State['WorlddPortState'];
    119116    $DbResult = $this->Database->query('SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = "server'.$this->Id.'_characters"');
     
    132129    } else
    133130    {
    134       $State['OnlinePlayerCount'] = 0;
     131      $State['CharacterOnlineCount'] = 0;
    135132      $State['CharacterCount'] = 0;
    136133      $State['AccountCount'] = 0;
     
    143140    global $Config;
    144141   
    145     $this->Database->query('UPDATE server'.$this->Id.'_realmd.realmlist SET name="'.addslashes($this->Server['Name']).'", address="'.$Config['Web']['Host'].'", port='.($this->WorlddBaseNetworkPort + $this->Id));
     142    $this->Database->query('UPDATE server'.$this->Id.'_realmd.realmlist SET name="'.addslashes($this->Server['Name']).'", address="'.$Config['Web']['Host'].'", port='.($this->Server['NetworkPortWorldd']));
    146143  }
    147144 
     
    155152  function UpdateScripts()
    156153  {
     154    global $Config;
     155   
    157156    $ServerBinDir = '../server/'.$this->Id.'/bin/';
    158157    if(!file_exists($ServerBinDir)) mkdir($ServerBinDir, 0777, true);   
     
    165164      'info thread',
    166165    );
    167     for($I = 1; $I < $this->MangosWorlddThreadCountMax; $I++)
    168     $Content[] = 'thread apply '.$I.' bt full';
     166    for($I = 1; $I < $Config['MangosWorlddThreadCountMax']; $I++)
     167      $Content[] = 'thread apply '.$I.' bt full';
    169168    file_put_contents($ScriptFileName, implode("\n", $Content));
    170169    chmod($ScriptFileName, 0666);   
     
    213212    $Config->ParameterList['CharacterDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_characters';
    214213    $Config->ParameterList['ScriptDev2DatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_scriptdev2';
    215     $Config->ParameterList['WorldServerPort'] = $this->WorlddBaseNetworkPort + $this->Id;
     214    $Config->ParameterList['WorldServerPort'] = $this->Server['NetworkPortWorldd'];
    216215    $Config->ParameterList['Motd'] = $this->Server['Motd'];
    217216    $Config->ParameterList['DataDir'] = 'wowclient/'.$this->Server['Database']['Emulator']['ClientVersion']['Version'];
     
    227226    $Config->Load($EmulatorEtcDir.'realmd.conf.dist');
    228227    $Config->ParameterList['LoginDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_realmd';
    229     $Config->ParameterList['RealmServerPort'] = $this->RealmdBaseNetworkPort + $this->Id;
     228    $Config->ParameterList['RealmServerPort'] = $this->Server['NetworkPortRealmd'];
    230229    $Config->ParameterList['LogsDir'] = 'server/'.$this->Id.'/log';
    231230    $Config->Save($ServerEtcDir.'realmd.conf');
Note: See TracChangeset for help on using the changeset viewer.