mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-10-13 18:04:54 +02:00
Much quicker item parser (335 items in 12ms instead of 2100ms)
Now checking if character is offline before changing gender. Restructured Admin_shop.php, it will now show pending orders and the whole transaction log.
This commit is contained in:
@@ -16,6 +16,20 @@ function getItemNameById($id) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns a PHP array $id => 'name'
|
||||
$items = getItemList();
|
||||
echo $items[2160]; // Returns 'Crystal Coin'
|
||||
*/
|
||||
function getItemList() {
|
||||
$item_list = explode(PHP_EOL, file_get_contents('item_list.txt'));
|
||||
$ia = array();
|
||||
for ($i = 0; $i < count($item_list) - 1; $i++) {
|
||||
$it = explode('@', $item_list[$i]);
|
||||
$ia[(int)$it[0]] = ucfirst($it[1]);
|
||||
}
|
||||
return $ia;
|
||||
}
|
||||
|
||||
function getItemIdByName($name) {
|
||||
|
||||
$item_list = explode(PHP_EOL, file_get_contents('item_list.txt'));
|
||||
|
Reference in New Issue
Block a user