Fix #345 - Character Auction storage account

When storage_account_id is not configured in config.php and people want to try the character auction system
Give them an error message instead of a query crash. Telling them to edit config.php properly.
This commit is contained in:
Znote 2019-03-18 01:53:38 +01:00
parent 63357290a0
commit 7eebbde59e
2 changed files with 15 additions and 4 deletions

View File

@ -483,9 +483,20 @@ if ($auction['characterAuction']) {
AND `p`.`group_id` = 1
LIMIT 1
;");
if (isset($player['online']) && $player['online'] == 0) {
if (isset($player['alreadyInAuction']) && $player['alreadyInAuction'] == 0) {
$status = true;
// Verify storage account ID exist
$storage_account = mysql_select_single("
SELECT `id`
FROM `accounts`
WHERE `id`={$auction['storage_account_id']}
LIMIT 1;
");
if ($storage_account === false) {
data_dump($auction, false, "Configured storage_account_id in config.php does not exist!");
} else {
if (isset($player['online']) && $player['online'] == 0) {
if (isset($player['alreadyInAuction']) && $player['alreadyInAuction'] == 0) {
$status = true;
}
}
}
}

View File

@ -919,7 +919,7 @@
'characterAuction' => false, // Enable/disable this system
// Account ID of the account that stores players in the auction.
// Make sure storage account has a very secure password!
'storage_account_id' => 5, // Separate secure account ID, not your GM.
'storage_account_id' => 500000, // Separate secure account ID, not your GM.
'step' => 5, // Minimum amount someone can raise a bid by
'step_duration' => 1 * 60 * 60, // When bidding over someone else, extend bid period by 1 hour.
'lowestLevel' => 20, // Minimum level of sold character