Changeset 20
- Timestamp:
- Jun 12, 2009, 11:18:23 AM (15 years ago)
- Location:
- trunk/www
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/config.sample.php
r15 r20 31 31 'MaxServerCount' => 20, 32 32 'CompilerParameters' => '', 33 'BaseNetworkPortWorldd' => 8085, 34 'BaseNetworkPortRealmd' => 3724, 35 'MangosWorlddThreadCountMax' => 12, 33 36 ); 34 37 -
trunk/www/form_classes.php
r16 r20 54 54 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => 'WoW server'), 55 55 'Description' => array('Type' => 'Text', 'Caption' => 'Popis', 'Default' => ''), 56 'Homepage' => array('Type' => ' String', 'Caption' => 'Webové stránky', 'Default' => ''),57 'Type' => array('Type' => ' TServerType', 'Caption' => 'Typ', 'Default' => 0),58 'Database' => array('Type' => ' TDatabase', 'Caption' => 'Databáze', 'Default' => 0),56 'Homepage' => array('Type' => 'Hyperlink', 'Caption' => 'Webové stránky', 'Default' => ''), 57 'Type' => array('Type' => 'ServerType', 'Caption' => 'Typ', 'Default' => 0), 58 'Database' => array('Type' => 'Database', 'Caption' => 'Databáze', 'Default' => 0), 59 59 'Motd' => array('Type' => 'String', 'Caption' => 'Zpráva dne', 'Default' => 'Vítejte na free WoW serveru'), 60 60 ), … … 80 80 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 81 81 'UserName' => array('Type' => 'String', 'Caption' => 'Správce', 'Default' => ''), 82 'NetworkPortRealmd' => array('Type' => 'Integer', 'Caption' => 'Realm d port', 'Default' => ''),82 'NetworkPortRealmd' => array('Type' => 'Integer', 'Caption' => 'Realmlist', 'Default' => ''), 83 83 'Version' => array('Type' => 'Integer', 'Caption' => 'Verze', 'Default' => 0), 84 84 'Online' => array('Type' => 'OnlineState', 'Caption' => 'Stav', 'Default' => 0), -
trunk/www/index.php
r17 r20 10 10 function ShowServerListOnRow($Row) 11 11 { 12 $Row['NetworkPortRealmd'] = $this->System->Config['Web']['Host'].':'.$Row['NetworkPortRealmd'];12 $Row['NetworkPortRealmd'] = '<a href="realmlist.php?Id='.$Row['Id'].'">'.$this->System->Config['Web']['Host'].':'.$Row['NetworkPortRealmd'].'</a>'; 13 13 $Row['Name'] = '<a href="?Action=ServerShow&Id='.$Row['Id'].'">'.$Row['Name'].'</a>'; 14 14 return($Row); … … 230 230 else 231 231 { 232 $DbResult = $this->Database->query('SELECT MAX(NetworkPortRealmd), MAX(NetworkPortWorldd) FROM Server'); 233 $DbRow = $DbResult->fetch_row(); 234 $NewPortRealmd = $DbRow[0] + 1; 235 if($NewPortRealmd < $Config['BaseNetworkPortRealmd']) $NewPortRealmd = $Config['BaseNetworkPortRealmd']; 236 $NewPortWorldd = $DbRow[1] + 1; 237 if($NewPortWorldd < $Config['BaseNetworkPortWorldd']) $NewPortWorldd = $Config['BaseNetworkPortWorldd']; 238 232 239 $Form = new Form('NewServer', array()); 233 240 $Form->LoadValuesFromForm(); 234 $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->User['Id'], 'Motd' => $Form->Values['Motd'], 'Homepage' => $Form->Values['Homepage'], 'Type' => $Form->Values['Type'], 'Database' => 1 ));241 $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->User['Id'], 'Motd' => $Form->Values['Motd'], 'Homepage' => $Form->Values['Homepage'], 'Type' => $Form->Values['Type'], 'Database' => 1, 'NetworkPortWorldd' => $NewPortWorldd, 'NetworkPortRealmd' => $NewPortRealmd)); 235 242 $LastInsertId = $this->Database->insert_id; 236 243 $Server = new Server($this->Database, $LastInsertId); -
trunk/www/page.php
r18 r20 35 35 $Output .= ' <a href="?Action=ServerDebug">Ladící záznamy</a>'; 36 36 } else $Output .= ' <a href="?Action=ServerAdd">Vytvořit vlastní server</a>'; 37 $Output .= ' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení </a>';37 $Output .= ' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení účtu</a>'; 38 38 if($this->System->Modules['User']->User['Role'] == USER_ROLE_ADMINISTRATOR) 39 39 { … … 55 55 $Time = round(GetMicrotime() - $ScriptTimeStart, 2); 56 56 $Output = '<div id="Footer"> 57 <i>| Správa webu: '.$this->System->Config['Web']['Admin'].' | e-mail: '.$this->System->Config['Web']['AdminEmail'].'|';57 <i>| Projekt: WoW hosting | Správce: '.$this->System->Config['Web']['Admin'].' | E-mail: '.$this->System->Config['Web']['AdminEmail'].' | <a href="http://svn.zdechov.net/trac/wowhosting/browser">Zdrojové kódy</a> |'; 58 58 if($this->System->Config['Web']['ShowRuntimeInfo'] == true) $Output .= ' Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s | Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B |'; 59 59 $Output .= '</i></div></body></html>'; -
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'); -
trunk/www/table.php
r16 r20 84 84 foreach($this->Definition['Items'] as $Index => $Item) 85 85 { 86 $DbRow[$Index] = ExecuteTypeEvent($Item['Type'], 'OnView', 87 array('Name' => $Index, 'Value' => $DbRow[$Index], 'Type' => $Item['Type'])); 86 88 $Row[] = $DbRow[$Index]; 87 89 } -
trunk/www/task.php
r16 r20 30 30 file_put_contents($this->TempScript, $Task['CommandList']); 31 31 chmod($this->TempScript, 0755); 32 passthru($this->TempScript, $Output);33 //exec($Script, $Output);34 $Output = ''; //implode("\n", $Output);35 //echo($Output);32 //passthru($this->TempScript, $Output); 33 exec($this->TempScript, $Output); 34 $Output = implode("\n", $Output); 35 echo($Output); 36 36 $this->Database->query('UPDATE Task SET State="Finished", Output="'.addslashes($Output).'" WHERE Id='.$Task['Id']); 37 37 } -
trunk/www/user.php
r15 r20 103 103 { 104 104 $this->Database->insert('User', array('Name' => $Name, 'Login' => $Login, 'Password' => sha1($Password), 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1, 'Role' => 2)); 105 $UserId = $ Database->insert_id;105 $UserId = $this->Database->insert_id; 106 106 107 107 $Subject = FromUTF8('Registrace nového účtu', 'iso2');
Note:
See TracChangeset
for help on using the changeset viewer.