Ignore:
Timestamp:
Aug 15, 2013, 11:17:26 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: System variable as parameter to constructors of descendents of Module class.
  • Removed: End PHP mark "?>" from all files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/Application/Model/Realm.php

    r78 r93  
    99  var $Task;
    1010 
    11   function __construct($Database, $Id)
    12   {
    13     $this->Database = $Database;
    14     $this->Task = new Task($Database);
     11  function __construct($System, $Id)
     12  {
     13    parent::__construct($System);
     14    $this->Task = new Task($System);
    1515    $this->Id = $Id;
    1616    $DbResult = $this->Database->query('SELECT * FROM `Realm` WHERE `Id`='.$Id);
     
    3131
    3232  function GetState()
    33   {
    34     global $System;
    35    
     33  {   
    3634    $State = array();
    37     $State['WorlddPortState'] = $System->NetworkPortState('localhost', $this->Data['NetworkPortWorldd']);
     35    $State['WorlddPortState'] = $this->System->NetworkPortState('localhost', $this->Data['NetworkPortWorldd']);
    3836    $State['Online'] = $State['WorlddPortState'];
    3937    $State['Uptime'] = $this->Uptime();
     
    140138  function UpdateRealmlist()
    141139  {
    142     $Server = new Server($this->Database, $this->Data['Server']);
     140    $Server = new Server($this->System, $this->Data['Server']);
    143141    $Server->UpdateRealmList();
    144142  }
     
    153151  function UpdateScripts()
    154152  {
    155     global $Config;
    156    
    157153    $RealmBinDir = '../realm/'.$this->Id.'/bin/';
    158154    if(!file_exists($RealmBinDir)) mkdir($RealmBinDir, 0777, true);   
     
    165161      'info thread',
    166162    );
    167     for($I = 1; $I < $Config['MangosWorlddThreadCountMax']; $I++)
     163    for($I = 1; $I < $this->Config['MangosWorlddThreadCountMax']; $I++)
    168164      $Content[] = 'thread apply '.$I.' bt full';
    169165    file_put_contents($ScriptFileName, implode("\n", $Content));
     
    209205  function SetupConfigurationFiles()
    210206  {
    211     global $Config;
    212    
    213207    $EmulatorEtcDir = '../emulator/'.$this->Data['Database']['Emulator']['Id'].'/etc/';
    214208    $RealmEtcDir = '../realm/'.$this->Id.'/etc/';
     
    220214    if(!file_exists($RealmEtcDir.'mangosd.conf'))
    221215      file_put_contents($RealmEtcDir.'mangosd.conf', file_get_contents($EmulatorEtcDir.'mangosd.conf.dist'));
    222     $EmulatorConfig = new MangosConfigurationFile($this->Database);
     216    $EmulatorConfig = new MangosConfigurationFile($this->System);
    223217    $EmulatorConfig->Load($RealmEtcDir.'mangosd.conf');
    224218    $EmulatorConfig->ParameterList['RealmID'] = $this->Data['Id'];
     
    235229     
    236230    // scriptdev2.conf
    237     $EmulatorConfig = new MangosConfigurationFile($this->Database);
     231    $EmulatorConfig = new MangosConfigurationFile($this->System);
    238232    $EmulatorConfig->Load($EmulatorEtcDir.'scriptdev2.conf');
    239233    $EmulatorConfig->ParameterList['ScriptDev2DatabaseInfo'] = 'localhost;3306;server'.$this->Data['Server'].';server'.$this->Data['Server'].';realm'.$this->Id.'_scriptdev2';
     
    255249    if($DoBackup)
    256250    {
    257       $Backup = new Backup($this->Database, 0);
     251      $Backup = new Backup($this->System, 0);
    258252      $Output .= '<br />'.$Backup->Create($this->Id);
    259253    }
     
    364358    while($DbRow = $DbResult->fetch_assoc())
    365359    {
    366       $Realm = new Realm($this->Database, $DbRow['Id']);   
     360      $Realm = new Realm($this->System, $DbRow['Id']);   
    367361      $Realm->UpdateState();
    368362    }   
     
    380374  }
    381375}
    382 
    383 ?>
Note: See TracChangeset for help on using the changeset viewer.