Changeset 46
- Timestamp:
- Jun 19, 2009, 9:41:07 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/backup.sh
r43 r46 1 1 #!/bin/sh 2 cd /a3 2 php www/shell.php BackupCreateAll 4 3 -
trunk/bin/start.sh
r43 r46 1 1 #!/bin/sh 2 cd /a3 2 php www/shell.php ServerStartAll 4 3 bin/task_process.sh& -
trunk/bin/task_process.sh
r43 r46 1 1 #!/bin/sh 2 cd /a3 2 php www/shell.php TaskProcess 4 3 -
trunk/www/error.php
r12 r46 28 28 $Backtrace[0]['function'] = ''; 29 29 $Backtrace[0]['args'] = ''; 30 if(!array_key_exists('line', $Backtrace[0])) $Backtrace[0]['line'] = ''; 31 if(!array_key_exists('file', $Backtrace[0])) $Backtrace[0]['file'] = ''; 30 32 //$First = array_shift($Backtrace); 31 33 //print_r($First); -
trunk/www/form_classes.php
r45 r46 248 248 RegisterType('ServerType', 'Enumeration', array('Normální', 'PvP', 'RP', 'RPPvP')); 249 249 RegisterType('OnlineState', 'Enumeration', array('Neaktivní', 'Aktivní')); 250 RegisterType('Database', 'PointerOneToOne', array('Table' => 'Database', 'Id' => 'Id', 'Name' => 'CONCAT(Name, " ", Version, " r", Revision)' ));250 RegisterType('Database', 'PointerOneToOne', array('Table' => 'Database', 'Id' => 'Id', 'Name' => 'CONCAT(Name, " ", Version, " r", Revision)', 'Condition' => 'Emulator <> 0')); 251 251 RegisterType('Client', 'PointerOneToOne', array('Table' => 'Client', 'Id' => 'Id', 'Name' => 'Version')); 252 252 -
trunk/www/index.php
r45 r46 52 52 53 53 $Server = new Server($this->Database, $Id); 54 if(isset($Server->Server)) 55 { 54 56 $Output = '<h4>Podrobnosti serveru</h4>'; 55 57 $Form = new Form('ServerView'); … … 88 90 $Output .= ' <a href="?Action=GameAccountRegister&Id='.$Server->Id.'">Vytvoření herního účtu</a>'; 89 91 $Output .= '</div>'; 92 } else $Output = $this->SystemMessage('Zobrazení serveru', 'Server se zadaným id nenalezen.'); 90 93 return($Output); 91 94 } … … 482 485 $Output .= $Form->ShowEditForm(); 483 486 } 484 } else $Output .= $this->SystemMessage('Nový serve ', 'Nelze vytvářet další servery');487 } else $Output .= $this->SystemMessage('Nový server', 'Nelze vytvářet další servery'); 485 488 } else $Output .= USER_BAD_ROLE; 486 489 } else … … 503 506 $Form = new Form('ServerCreate', array()); 504 507 $Form->LoadValuesFromForm(); 505 $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, 'Lock' => 1, 'TimeCreate' => 'NOW()'));508 $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' => $Form->Values['Database'], 'NetworkPortWorldd' => $NewPortWorldd, 'NetworkPortRealmd' => $NewPortRealmd, 'Lock' => 1, 'TimeCreate' => 'NOW()')); 506 509 $LastInsertId = $this->Database->insert_id; 507 510 $Server = new Server($this->Database, $LastInsertId); -
trunk/www/server.php
r45 r46 69 69 )); 70 70 } 71 // Lookup nearest database with full import 72 $DbResult = $this->Database->query('SELECT * FROM `Database` WHERE (`Emulator` <> 0) AND (`Revision` <= '.$this->Server['Database']['Revision'].') AND (`SourceFileName` <> "") ORDER BY `Revision` DESC'); 73 $Database = $DbResult->fetch_assoc(); 74 71 75 $CommandList = array_merge($CommandList, array( 72 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_mangos < database/'.$ this->Server['Database']['Id'].'/'.$this->Server['Database']['SourceFileName'],73 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_scriptdev2 < emulator/'.$ this->Server['Database']['Emulator']['Id'].'/source/src/bindings/ScriptDev2/sql/scriptdev2_create_structure.sql',74 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_scriptdev2 < emulator/'.$ this->Server['Database']['Emulator']['Id'].'/source/src/bindings/ScriptDev2/sql/scriptdev2_script_full.sql',75 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_mangos < emulator/'.$ this->Server['Database']['Emulator']['Id'].'/source/src/bindings/ScriptDev2/sql/mangos_scriptname_full.sql',76 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_realmd < emulator/'.$ this->Server['Database']['Emulator']['Id'].'/share/mangos/sql/realmd.sql',77 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_characters < emulator/'.$ this->Server['Database']['Emulator']['Id'].'/share/mangos/sql/characters.sql',78 'php www/shell.php ServerDatabaseChange '.$this->Id.' '.$ this->Server['Database']['Id'],76 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_mangos < database/'.$Database['Id'].'/'.$Database['SourceFileName'], 77 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_scriptdev2 < emulator/'.$Database['Emulator']['Id'].'/source/src/bindings/ScriptDev2/sql/scriptdev2_create_structure.sql', 78 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_scriptdev2 < emulator/'.$Database['Emulator']['Id'].'/source/src/bindings/ScriptDev2/sql/scriptdev2_script_full.sql', 79 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_mangos < emulator/'.$Database['Emulator']['Id'].'/source/src/bindings/ScriptDev2/sql/mangos_scriptname_full.sql', 80 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_realmd < emulator/'.$Database['Emulator']['Id'].'/share/mangos/sql/realmd.sql', 81 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_characters < emulator/'.$Database['Emulator']['Id'].'/share/mangos/sql/characters.sql', 82 'php www/shell.php ServerDatabaseChange '.$this->Id.' '.$Database['Id'], 79 83 'php www/shell.php ServerUnLock '.$this->Id, 80 84 )); 81 85 $this->Task->Add('Inicializace databáze', $CommandList); 86 87 if($Database['Id'] != $this->Server['Database']['Id']) 88 { 89 $NewDatabaseId = $this->Server['Database']['Id']; 90 $this->Server['Database']['Id'] = $Database['Id']; 91 $this->Update($NewDatabaseId, false, false); 92 } 82 93 return('Úloha načtení nové databáze zařazena do fronty.'); 83 94 } … … 297 308 } 298 309 299 function Update($DatabaseId )310 function Update($DatabaseId, $DoBackup = true, $DoStop = true) 300 311 { 301 312 $this->Lock(); 313 $Output = ''; 302 314 303 315 // Stop server before update 304 $Output = $this->Stop(); 316 if($DoStop) 317 { 318 $Output .= $this->Stop(); 319 } 305 320 306 321 // Backup current 307 $Backup = new Backup($this->Database, 0); 308 $Output .= '<br />'.$Backup->Create($this->Id); 322 if($DoBackup) 323 { 324 $Backup = new Backup($this->Database, 0); 325 $Output .= '<br />'.$Backup->Create($this->Id); 326 } 309 327 310 328 // Do update … … 326 344 { 327 345 $Parts = explode('|', $Update); 328 $Command = 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_'.$Parts[0].' < database/'.$DbRow[' Database'].'/update/'.$Parts[1];346 $Command = 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_'.$Parts[0].' < database/'.$DbRow['Id'].'/'.$Parts[1]; 329 347 $Commands[] = $Command; 330 348 } -
trunk/www/types/PointerOneToOne.php
r22 r46 28 28 $Output = '<select name="'.$Item['Name'].'">'; 29 29 $Type = $TypeDefinitionList[$Item['Type']]; 30 $DbResult = $Database->query('SELECT '.$Type['Parameters']['Name'].' AS Name,'.$Type['Parameters']['Id'].' AS Id FROM `'.$Type['Parameters']['Table'].'`'); 30 if(array_key_exists('Condition', $Type['Parameters'])) $Where = ' WHERE '.$Type['Parameters']['Condition']; 31 else $Where = ''; 32 $DbResult = $Database->query('SELECT '.$Type['Parameters']['Name'].' AS Name,'.$Type['Parameters']['Id'].' AS Id FROM `'.$Type['Parameters']['Table'].'`'.$Where.' ORDER BY Name DESC'); 31 33 while($DbRow = $DbResult->fetch_assoc()) 32 34 { -
trunk/www/user.php
r45 r46 44 44 { 45 45 $SID = session_id(); 46 47 // Check login 48 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"'); 49 $Row = $Query->fetch_assoc(); 50 if($Row['User'] != $this->AnonymousUserId) 51 { 52 $Query = $this->Database->select('User', '*', 'Id='.$Row['User']); 53 $this->User = $Query->fetch_assoc(); 54 $Result = USER_LOGGED; 55 } else 56 { 57 $Query = $this->Database->select('User', '*', 'Id='.$this->AnonymousUserId); 58 $this->User = $Query->fetch_assoc(); 59 $Result = USER_NOT_LOGGED; 60 } 46 61 47 62 // Remove nonactive users
Note:
See TracChangeset
for help on using the changeset viewer.