Changeset 4 for trunk/www/index.php
- Timestamp:
- Jun 8, 2009, 9:50:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/index.php
r3 r4 169 169 if($_GET['Action'] == 'NewServer') 170 170 { 171 $Form = new Form('Server'); 171 $Form = new Form('NewServer'); 172 $Form->LoadValuesFromForm(); 173 $Form->OnSubmit = '?Action=ServerCreate'; 174 $Output .= $Form->ShowEditForm(); 175 } else 176 if($_GET['Action'] == 'ServerCreate') 177 { 178 $UserOptions = new Form('NewServer', array()); 179 $UserOptions->LoadValuesFromForm(); 180 $Output .= $this->SystemMessage('Nový server', 'Server vytvořen.'); 181 //$UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 182 $UserOptions->OnSubmit = '?Action=ServerCreate'; 183 $Output .= $UserOptions->ShowEditForm(); 184 } else 185 if($_GET['Action'] == 'EditServer') 186 { 187 $Form = new Form('EditServer'); 172 188 $Form->LoadValuesFromForm(); 173 189 $Form->OnSubmit = '?Action=ServerSave'; 174 190 $Output .= $Form->ShowEditForm(); 175 191 } else 176 if($_GET['Action'] == ' NewServerSave')177 { 178 $UserOptions = new Form(' Server', array());179 $UserOptions->LoadValuesFromForm(); 180 $Output .= $this->SystemMessage(' Nový server', 'Server vytvořen.');192 if($_GET['Action'] == 'ServerSave') 193 { 194 $UserOptions = new Form('EditServer', array()); 195 $UserOptions->LoadValuesFromForm(); 196 $Output .= $this->SystemMessage('Upravit server', 'Nastavení serveru uloženo.'); 181 197 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 182 198 $UserOptions->OnSubmit = '?Action=ServerSave'; 199 200 $DbResult = $this->Database->query('SELECT Id FROM Server WHERE User='.$this->System->Modules['User']->User['Id']); 201 $Server = $DbResult->fetch_assoc(); 202 $ServerId = $Server['Id']; 203 $Server = new Server($this->Database, $ServerId); 204 205 // Setup mangosd.conf 206 $Config = new MangosConfigurationFile($this->Database); 207 $Config->Load('../emu/mangos/'.$Server->Server['Database']['Emulator']['Revision'].'/etc/mangosd.conf'); 208 $Config->ParameterList['LoginDatabaseInfo'] = 'localhost:3306:server'.$ServerId.':server'.$ServerId.':server'.$ServerId.'_realmd'; 209 $Config->ParameterList['WorldDatabaseInfo'] = 'localhost:3306:server'.$ServerId.':server'.$ServerId.':server'.$ServerId.'_mangos'; 210 $Config->ParameterList['CharacterDatabaseInfo'] = 'localhost:3306:server'.$ServerId.':server'.$ServerId.':server'.$ServerId.'_characters'; 211 $Config->ParameterList['WorldServerPort'] = 8085 + $ServerId; 212 $Config->ParameterList['Motd'] = $Server->Server['Motd']; 213 $Config->Save('../server/'.$ServerId.'/etc/mangosd.conf'); 214 // Setup realmd.conf 215 $Config = new MangosConfigurationFile($this->Database); 216 $Config->Load('../emu/mangos/'.$Server->Server['Database']['Emulator']['Revision'].'/etc/realmd.conf'); 217 $Config->ParameterList['LoginDatabaseInfo'] = 'localhost:3306:server'.$ServerId.':server'.$ServerId.':server'.$ServerId.'_realmd'; 218 $Config->ParameterList['RealmServerPort'] = 3724 + $ServerId; 219 $Config->Save('../server/'.$ServerId.'/etc/realmd.conf'); 220 // Setup realmd.conf 221 $Config = new MangosConfigurationFile($this->Database); 222 $Config->Load('../emu/mangos/'.$Server->Server['Database']['Emulator']['Revision'].'/etc/scriptdev2.conf'); 223 $Config->ParameterList['ScriptDev2DatabaseInfo'] = 'localhost:3306:server'.$ServerId.':server'.$ServerId.':server'.$ServerId.'_scriptdev2'; 224 $Config->Save('../server/'.$ServerId.'/etc/scriptdev2.conf'); 225 183 226 $Output .= $UserOptions->ShowEditForm(); 184 227 } else
Note:
See TracChangeset
for help on using the changeset viewer.