Changeset 20 for trunk/www/server.php
- Timestamp:
- Jun 12, 2009, 11:18:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/server.php
r19 r20 10 10 var $Server; 11 11 var $Task; 12 var $WorlddBaseNetworkPort = 8085;13 var $RealmdBaseNetworkPort = 3724;14 var $MangosWorlddThreadCountMax = 12;15 12 16 13 function __construct($Database, $Id) … … 114 111 { 115 112 $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']); 118 115 $State['Online'] = $State['RealmdPortState'] and $State['WorlddPortState']; 119 116 $DbResult = $this->Database->query('SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = "server'.$this->Id.'_characters"'); … … 132 129 } else 133 130 { 134 $State[' OnlinePlayerCount'] = 0;131 $State['CharacterOnlineCount'] = 0; 135 132 $State['CharacterCount'] = 0; 136 133 $State['AccountCount'] = 0; … … 143 140 global $Config; 144 141 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'])); 146 143 } 147 144 … … 155 152 function UpdateScripts() 156 153 { 154 global $Config; 155 157 156 $ServerBinDir = '../server/'.$this->Id.'/bin/'; 158 157 if(!file_exists($ServerBinDir)) mkdir($ServerBinDir, 0777, true); … … 165 164 'info thread', 166 165 ); 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'; 169 168 file_put_contents($ScriptFileName, implode("\n", $Content)); 170 169 chmod($ScriptFileName, 0666); … … 213 212 $Config->ParameterList['CharacterDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_characters'; 214 213 $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']; 216 215 $Config->ParameterList['Motd'] = $this->Server['Motd']; 217 216 $Config->ParameterList['DataDir'] = 'wowclient/'.$this->Server['Database']['Emulator']['ClientVersion']['Version']; … … 227 226 $Config->Load($EmulatorEtcDir.'realmd.conf.dist'); 228 227 $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']; 230 229 $Config->ParameterList['LogsDir'] = 'server/'.$this->Id.'/log'; 231 230 $Config->Save($ServerEtcDir.'realmd.conf');
Note:
See TracChangeset
for help on using the changeset viewer.