- Timestamp:
- Apr 29, 2009, 9:04:21 PM (16 years ago)
- Location:
- trunk/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/config.sample.php
r576 r577 28 28 'GMCommandsLog' => 'gm_commands.log', 29 29 'MaxAccountCount' => 13000, 30 'CharacterDataOffset' => array 31 ( 32 'Exp' => 1010, 33 'Level' => 53, 34 'Gender' => 22, 35 'HonorPoints' => 1648, 36 'ArenaPoints' => 1649, 37 ), 30 38 ), 31 39 'Web' => array -
trunk/inc/player.php
r576 r577 107 107 $this->db->select_db($Config['Mangos']['DatabaseCharacters']); 108 108 $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)'. 110 110 ' AS UNSIGNED) AS `level` FROM `characters` WHERE `guid` = "'.$guid.'" LIMIT 1;'); 111 111 $row = $DbResult->fetch_assoc(); … … 148 148 $row = $this->db->query('SELECT `data` FROM `characters` WHERE `guid` = "'.$guid.'" LIMIT 1')->fetch_assoc(); 149 149 $data = explode(' ', $row['data']); 150 $data[ 926] = 0;150 $data[$Config['Mangos']['CharacterDataOffset']['Exp']] = 0; 151 151 $data = implode(' ', $data); 152 152 $this->db->query('UPDATE `characters` SET `data` = "'.$data.'" WHERE `guid` ="'.$guid.'" LIMIT 1'); … … 360 360 $this->db->select_db($Config['Mangos']['DatabaseCharacters']); 361 361 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'); 363 363 echo($this->db->error); 364 364 while($row = $sql->fetch_array())
Note:
See TracChangeset
for help on using the changeset viewer.