Changeset 577 for trunk/inc


Ignore:
Timestamp:
Apr 29, 2009, 9:04:21 PM (16 years ago)
Author:
george
Message:
  • Opraveno: Vyčítání položek ze sloupce Data u postav je nyní nastavování přes konfigurační soubor. Nutno synchronizovat např. dle minimanageru souboru scripts/defines.php při každé změně verze herního klienta.
Location:
trunk/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/config.sample.php

    r576 r577  
    2828    'GMCommandsLog' => 'gm_commands.log',
    2929    'MaxAccountCount' => 13000,
     30    'CharacterDataOffset' => array
     31    (
     32      'Exp' => 1010,
     33      'Level' => 53,
     34      'Gender' => 22,
     35      'HonorPoints' => 1648,
     36      'ArenaPoints' => 1649,
     37    ),
    3038  ),
    3139  'Web' => array
  • trunk/inc/player.php

    r576 r577  
    107107    $this->db->select_db($Config['Mangos']['DatabaseCharacters']);
    108108      $DbResult = $this->db->query(
    109       'SELECT CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", 34), " ", -1)'.
     109      'SELECT CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.($Config['Mangos']['CharacterDataOffset']['Level'] + 1).'), " ", -1)'.
    110110      ' AS UNSIGNED) AS `level` FROM `characters` WHERE `guid` = "'.$guid.'" LIMIT 1;');
    111111    $row = $DbResult->fetch_assoc();
     
    148148        $row = $this->db->query('SELECT `data` FROM `characters` WHERE `guid` = "'.$guid.'" LIMIT 1')->fetch_assoc();
    149149        $data = explode(' ', $row['data']);
    150         $data[926] = 0;
     150        $data[$Config['Mangos']['CharacterDataOffset']['Exp']] = 0;
    151151        $data = implode(' ', $data);
    152152        $this->db->query('UPDATE `characters` SET `data` = "'.$data.'" WHERE `guid` ="'.$guid.'" LIMIT 1');
     
    360360    $this->db->select_db($Config['Mangos']['DatabaseCharacters']);
    361361    echo($this->db->error);
    362     $sql = $this->db->query('SELECT `guid`,`name`,`race`,`totaltime`,`class`, mid(lpad( hex( CAST(substring_index(substring_index(data, " ", 37), " ",-1) AS unsigned) ), 8, 0), 4, 1) AS gender FROM `characters` WHERE `account`='.$accid.' ORDER BY `totaltime` DESC LIMIT 0, 10');
     362    $sql = $this->db->query('SELECT `guid`,`name`,`race`,`totaltime`,`class`, mid(lpad( hex( CAST(substring_index(substring_index(data, " ", '.($Config['Mangos']['CharacterDataOffset']['Gender'] + 1).'), " ",-1) AS unsigned) ), 8, 0), 4, 1) AS gender FROM `characters` WHERE `account`='.$accid.' ORDER BY `totaltime` DESC LIMIT 0, 10');
    363363    echo($this->db->error);
    364364    while($row = $sql->fetch_array())
Note: See TracChangeset for help on using the changeset viewer.