Changeset 44
- Timestamp:
- Jun 16, 2009, 9:08:11 PM (15 years ago)
- Location:
- trunk/www
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/config.sample.php
r38 r44 31 31 'BaseDir' => '/opt/wowhosting/', 32 32 'MaxServerCount' => 20, 33 'MaxOnlinePlayerCountPerServer' => 100, 33 34 'CompilerParameters' => '', 34 35 'BaseNetworkPortWorldd' => 8085, -
trunk/www/form.php
r29 r44 13 13 global $FormClasses; 14 14 15 $this->Definition = &$FormClasses[$ClassName]; 16 foreach($this->Definition['Items'] as $Index => $Item) 15 if(array_key_exists($ClassName, $FormClasses)) 17 16 { 18 $this->Values[$Index] = ''; 19 } 17 $this->Definition = &$FormClasses[$ClassName]; 18 foreach($this->Definition['Items'] as $Index => $Item) 19 { 20 $this->Values[$Index] = ''; 21 } 22 } else 23 { 24 $this->Definition = array('Title' => 'Neznámý formulář', 'Table' => '', 'Items' => array()); 25 } 20 26 } 21 27 -
trunk/www/form_classes.php
r39 r44 207 207 ), 208 208 ), 209 'ServerSettingDetailed' => array( 210 'Title' => 'Podrobné nastavení serveru', 211 'Table' => '', 212 'Items' => array( 213 'ServerId' => array('Type' => 'Hidden', 'Caption' => 'Id', 'Default' => 0), 214 'SkipCinematics' => array('Type' => 'SkipCinematics', 'Caption' => 'Zobrazovat úvodní video', 'Default' => ''), 215 'StartPlayerLevel' => array('Type' => 'Integer', 'Caption' => 'Počáteční úroveň hráčů', 'Default' => 1), 216 'MaxPlayerLevel' => array('Type' => 'Integer', 'Caption' => 'Max. úroveň hráčů', 'Default' => 80), 217 'StartHeroicPlayerLevel' => array('Type' => 'Integer', 'Caption' => 'Počáteční úroveň hrdinských postav', 'Default' => 55), 218 'StartPlayerMoney' => array('Type' => 'Integer', 'Caption' => 'Počáteční množství peněz', 'Default' => 0), 219 'StartHonorPoints' => array('Type' => 'Integer', 'Caption' => 'Počáteční počet bodů cti', 'Default' => 0), 220 'MaxHonorPoints' => array('Type' => 'Integer', 'Caption' => 'Max. počet bodů cti', 'Default' => 75000), 221 'StartArenaPoints' => array('Type' => 'Integer', 'Caption' => 'Počáteční počet bodů arén', 'Default' => 0), 222 'MaxArenaPoints' => array('Type' => 'Integer', 'Caption' => 'Max. počet bodů arén', 'Default' => 5000), 223 'MaxArenaPoints' => array('Type' => 'Integer', 'Caption' => 'Max. počet bodů arén', 'Default' => 5000), 224 'InstantLogout' => array('Type' => 'SecurityLevel', 'Caption' => 'Povolit okamžitého odhlášení', 'Default' => 1), 225 'DisableWaterBreath' => array('Type' => 'SecurityLevel', 'Caption' => 'Zakázat dýchání pod vodou', 'Default' => 1), 226 'AllFlightPaths' => array('Type' => 'Boolean', 'Caption' => 'Povoleny všechny létací cesty', 'Default' => 0), 227 'AlwaysMaxSkillForLevel' => array('Type' => 'Boolean', 'Caption' => 'Vždy max. dovednost na úroveň', 'Default' => 0), 228 'ActivateWeather' => array('Type' => 'Boolean', 'Caption' => 'Aktivní počasí', 'Default' => 1), 229 'CastUnstuck' => array('Type' => 'Boolean', 'Caption' => 'Povolit odblokovací kouzlo pomocí .start', 'Default' => 1), 230 'MinPetitionSigns' => array('Type' => 'Integer', 'Caption' => 'Min. počet podpisů k zápisu spolku', 'Default' => 9), 231 'MaxGroupXPDistance' => array('Type' => 'Integer', 'Caption' => 'Max. rozdíl XP ve skupině', 'Default' => 74), 232 'MailDeliveryDelay' => array('Type' => 'Integer', 'Caption' => 'Zpoždění doručení pošty', 'Default' => 3600), 233 'Event.Announce' => array('Type' => 'Boolean', 'Caption' => 'Ohlašování událostí', 'Default' => 0), 234 'AllowTwoSide.Accounts' => array('Type' => 'Boolean', 'Caption' => 'Povolit účty s postavami obou stran', 'Default' => 0), 235 'AllowTwoSide.Interaction.Chat' => array('Type' => 'Boolean', 'Caption' => 'Povolit komunikaci mezi stranami', 'Default' => 0), 236 'AllowTwoSide.Interaction.Channel' => array('Type' => 'Boolean', 'Caption' => 'Povolit kanály mezi stranami', 'Default' => 0), 237 'AllowTwoSide.WhoList' => array('Type' => 'Boolean', 'Caption' => 'Povolit obě strany v seznamu přítomných', 'Default' => 0), 238 ), 239 ), 209 240 ); 210 241 242 RegisterType('YesNo', 'Enumeration', array('Ano', 'Ne')); 243 RegisterType('NoYes', 'Enumeration', array('Ne', 'Ano')); 244 RegisterType('SecurityLevel', 'Enumeration', array('Hráči', 'Moderátoři', 'GM', 'Administrátoři', 'Nikdo')); 245 RegisterType('SkipCinematics', 'Enumeration', array('Ukázat vždy', 'Ukázat pouze pro první postavu rasy', 'Neukazovat vůbec')); 211 246 RegisterType('TaskState', 'Enumeration', array('Čekající', 'Běžící', 'Dokončeno')); 212 247 RegisterType('ServerExpansion', 'Enumeration', array('Classic', 'The Burning Crusade', 'Wrath of The Lich King')); -
trunk/www/index.php
r41 r44 79 79 else $Output .= ' <a href="?Action=ServerStart&Id='.$Server->Id.'">Spustit</a>'; 80 80 } 81 if($Server->Server['Lock'] == 0) $Output .= ' <a href="?Action=ServerEdit&Id='.$Server->Id.'">Upravit</a>'; 81 if($Server->Server['Lock'] == 0) 82 { 83 $Output .= ' <a href="?Action=ServerEdit&Id='.$Server->Id.'">Upravit základní nastavení</a>'; 84 $Output .= ' <a href="?Action=ServerEditDetailed&Id='.$Server->Id.'">Upravit podrobné nastavení</a>'; 85 } 82 86 //$Output .= ' <a href="?Action=ServerDatabaseImport&Id='.$Server->Id.'">Načtení čisté databáze</a>'; 83 87 } … … 547 551 } else $this->SystemMessage('Nastavení serveru', 'Nemáte oprávnění'); 548 552 } else 553 if($_GET['Action'] == 'ServerEditDetailed') 554 { 555 $Server = new Server($this->Database, $_GET['Id']); 556 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 557 { 558 $Form = new Form('ServerSettingDetailed'); 559 $EmulatorConfig = new MangosConfigurationFile($this->Database); 560 $EmulatorConfig->Load('../server/'.$Server->Id.'/etc/mangosd.conf'); 561 $Form->Values = $EmulatorConfig->ParameterList; 562 $Form->Values['ServerId'] = $_GET['Id']; 563 $Form->OnSubmit = '?Action=ServerSaveDetailed'; 564 $Output .= $Form->ShowEditForm(); 565 } else $this->SystemMessage('Nastavení serveru', 'Nemáte oprávnění'); 566 } else 567 if($_GET['Action'] == 'ServerSaveDetailed') 568 { 569 $Server = new Server($this->Database, $_POST['ServerId']); 570 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 571 { 572 $Form = new Form('ServerSettingDetailed', array()); 573 $Form->LoadValuesFromForm(); 574 $EmulatorConfig = new MangosConfigurationFile($this->Database); 575 $EmulatorConfig->Load('../server/'.$Server->Id.'/etc/mangosd.conf'); 576 foreach($Form->Values as $Index => $Item) 577 $EmulatorConfig->ParameterList[$Index] = $Item; 578 $EmulatorConfig->Save('../server/'.$Server->Id.'/etc/mangosd.conf'); 579 $ServerId = $_POST['ServerId']; 580 unset($Form->Values['ServerId']); 581 $Output .= $this->SystemMessage('Upravit server', 'Nastavení serveru uloženo.'); 582 //$Form->SaveValuesToDatabase($_POST['ServerId']); 583 $Form->OnSubmit = '?Action=ServerSaveDetailed'; 584 585 $Server = new Server($this->Database, $_POST['ServerId']); 586 $Server->SaveConfiguration(); 587 $Form->Values['ServerId'] = $ServerId; 588 $Output .= $Form->ShowEditForm(); 589 } else $this->SystemMessage('Nastavení serveru', 'Nemáte oprávnění'); 590 } else 549 591 if($_GET['Action'] == 'ServerStart') 550 592 { -
trunk/www/server.php
r41 r44 219 219 function SetupConfigurationFiles() 220 220 { 221 global $Config; 222 221 223 $EmulatorEtcDir = '../emulator/'.$this->Server['Database']['Emulator']['Id'].'/etc/'; 222 224 $ServerEtcDir = '../server/'.$this->Id.'/etc/'; … … 226 228 227 229 // mangosd.conf 228 $Config = new MangosConfigurationFile($this->Database); 229 $Config->Load($EmulatorEtcDir.'mangosd.conf.dist'); 230 $Config->ParameterList['LoginDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_realmd'; 231 $Config->ParameterList['WorldDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_mangos'; 232 $Config->ParameterList['CharacterDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_characters'; 233 $Config->ParameterList['ScriptDev2DatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_scriptdev2'; 234 $Config->ParameterList['WorldServerPort'] = $this->Server['NetworkPortWorldd']; 235 $Config->ParameterList['Motd'] = $this->Server['Motd']; 236 $Config->ParameterList['DataDir'] = 'wowclient/'.$this->Server['Database']['Emulator']['Client']['Version']; 237 $Config->ParameterList['LogsDir'] = 'server/'.$this->Id.'/log'; 238 $Config->ParameterList['LogLevel'] = 1; 239 $Config->ParameterList['LogSQL'] = 0; 230 $EmulatorConfig = new MangosConfigurationFile($this->Database); 231 $EmulatorConfig->Load($EmulatorEtcDir.'mangosd.conf.dist'); 232 $EmulatorConfig->ParameterList['LoginDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_realmd'; 233 $EmulatorConfig->ParameterList['WorldDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_mangos'; 234 $EmulatorConfig->ParameterList['CharacterDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_characters'; 235 $EmulatorConfig->ParameterList['ScriptDev2DatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_scriptdev2'; 236 $EmulatorConfig->ParameterList['WorldServerPort'] = $this->Server['NetworkPortWorldd']; 237 $EmulatorConfig->ParameterList['Motd'] = $this->Server['Motd']; 238 $EmulatorConfig->ParameterList['DataDir'] = 'wowclient/'.$this->Server['Database']['Emulator']['Client']['Version']; 239 $EmulatorConfig->ParameterList['LogsDir'] = 'server/'.$this->Id.'/log'; 240 $EmulatorConfig->ParameterList['LogLevel'] = 1; 241 $EmulatorConfig->ParameterList['PlayerLimit'] = $Config['MaxOnlinePlayerCountPerServer']; 242 $EmulatorConfig->ParameterList['PlayerSaveInterval'] = 300000; 243 $EmulatorConfig->ParameterList['LogSQL'] = 0; 240 244 $ServerTypes = array(0 => 0, 1 => 1, 2 => 6, 3 => 8); 241 $ Config->ParameterList['GameType'] = $ServerTypes[$this->Server['Type']];242 $ Config->Save($ServerEtcDir.'mangosd.conf');245 $EmulatorConfig->ParameterList['GameType'] = $ServerTypes[$this->Server['Type']]; 246 $EmulatorConfig->Save($ServerEtcDir.'mangosd.conf'); 243 247 244 248 // realmd.conf 245 $ Config = new MangosConfigurationFile($this->Database);246 $ Config->Load($EmulatorEtcDir.'realmd.conf.dist');247 $ Config->ParameterList['LoginDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_realmd';248 $ Config->ParameterList['RealmServerPort'] = $this->Server['NetworkPortRealmd'];249 $ Config->ParameterList['LogsDir'] = 'server/'.$this->Id.'/log';250 $ Config->Save($ServerEtcDir.'realmd.conf');249 $EmulatorConfig = new MangosConfigurationFile($this->Database); 250 $EmulatorConfig->Load($EmulatorEtcDir.'realmd.conf.dist'); 251 $EmulatorConfig->ParameterList['LoginDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_realmd'; 252 $EmulatorConfig->ParameterList['RealmServerPort'] = $this->Server['NetworkPortRealmd']; 253 $EmulatorConfig->ParameterList['LogsDir'] = 'server/'.$this->Id.'/log'; 254 $EmulatorConfig->Save($ServerEtcDir.'realmd.conf'); 251 255 252 256 // scriptdev2.conf 253 $ Config = new MangosConfigurationFile($this->Database);254 $ Config->Load($EmulatorEtcDir.'scriptdev2.conf');255 $ Config->ParameterList['ScriptDev2DatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_scriptdev2';256 $ Config->Save($ServerEtcDir.'scriptdev2.conf');257 $EmulatorConfig = new MangosConfigurationFile($this->Database); 258 $EmulatorConfig->Load($EmulatorEtcDir.'scriptdev2.conf'); 259 $EmulatorConfig->ParameterList['ScriptDev2DatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_scriptdev2'; 260 $EmulatorConfig->Save($ServerEtcDir.'scriptdev2.conf'); 257 261 } 258 262
Note:
See TracChangeset
for help on using the changeset viewer.