Changeset 577 for trunk/inc/player.php


Ignore:
Timestamp:
Apr 29, 2009, 9:04:21 PM (15 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.