Changeset 93 for trunk/www/Application/Model/Realm.php
- Timestamp:
- Aug 15, 2013, 11:17:26 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Application/Model/Realm.php
r78 r93 9 9 var $Task; 10 10 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); 15 15 $this->Id = $Id; 16 16 $DbResult = $this->Database->query('SELECT * FROM `Realm` WHERE `Id`='.$Id); … … 31 31 32 32 function GetState() 33 { 34 global $System; 35 33 { 36 34 $State = array(); 37 $State['WorlddPortState'] = $ System->NetworkPortState('localhost', $this->Data['NetworkPortWorldd']);35 $State['WorlddPortState'] = $this->System->NetworkPortState('localhost', $this->Data['NetworkPortWorldd']); 38 36 $State['Online'] = $State['WorlddPortState']; 39 37 $State['Uptime'] = $this->Uptime(); … … 140 138 function UpdateRealmlist() 141 139 { 142 $Server = new Server($this-> Database, $this->Data['Server']);140 $Server = new Server($this->System, $this->Data['Server']); 143 141 $Server->UpdateRealmList(); 144 142 } … … 153 151 function UpdateScripts() 154 152 { 155 global $Config;156 157 153 $RealmBinDir = '../realm/'.$this->Id.'/bin/'; 158 154 if(!file_exists($RealmBinDir)) mkdir($RealmBinDir, 0777, true); … … 165 161 'info thread', 166 162 ); 167 for($I = 1; $I < $ Config['MangosWorlddThreadCountMax']; $I++)163 for($I = 1; $I < $this->Config['MangosWorlddThreadCountMax']; $I++) 168 164 $Content[] = 'thread apply '.$I.' bt full'; 169 165 file_put_contents($ScriptFileName, implode("\n", $Content)); … … 209 205 function SetupConfigurationFiles() 210 206 { 211 global $Config;212 213 207 $EmulatorEtcDir = '../emulator/'.$this->Data['Database']['Emulator']['Id'].'/etc/'; 214 208 $RealmEtcDir = '../realm/'.$this->Id.'/etc/'; … … 220 214 if(!file_exists($RealmEtcDir.'mangosd.conf')) 221 215 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); 223 217 $EmulatorConfig->Load($RealmEtcDir.'mangosd.conf'); 224 218 $EmulatorConfig->ParameterList['RealmID'] = $this->Data['Id']; … … 235 229 236 230 // scriptdev2.conf 237 $EmulatorConfig = new MangosConfigurationFile($this-> Database);231 $EmulatorConfig = new MangosConfigurationFile($this->System); 238 232 $EmulatorConfig->Load($EmulatorEtcDir.'scriptdev2.conf'); 239 233 $EmulatorConfig->ParameterList['ScriptDev2DatabaseInfo'] = 'localhost;3306;server'.$this->Data['Server'].';server'.$this->Data['Server'].';realm'.$this->Id.'_scriptdev2'; … … 255 249 if($DoBackup) 256 250 { 257 $Backup = new Backup($this-> Database, 0);251 $Backup = new Backup($this->System, 0); 258 252 $Output .= '<br />'.$Backup->Create($this->Id); 259 253 } … … 364 358 while($DbRow = $DbResult->fetch_assoc()) 365 359 { 366 $Realm = new Realm($this-> Database, $DbRow['Id']);360 $Realm = new Realm($this->System, $DbRow['Id']); 367 361 $Realm->UpdateState(); 368 362 } … … 380 374 } 381 375 } 382 383 ?>
Note:
See TracChangeset
for help on using the changeset viewer.