mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 10:49:23 +02:00
Character auction: Fixed points transfer to seller.
This commit is contained in:
parent
e61e5a85ce
commit
1ae01ee342
@ -71,7 +71,10 @@ if ($auction['characterAuction']) {
|
|||||||
// Passive check to see if bid period has expired and someone won a deal
|
// Passive check to see if bid period has expired and someone won a deal
|
||||||
$time = time();
|
$time = time();
|
||||||
$expired_auctions = mysql_select_multi("
|
$expired_auctions = mysql_select_multi("
|
||||||
SELECT `id`
|
SELECT
|
||||||
|
`id`,
|
||||||
|
`original_account_id`,
|
||||||
|
(`bid`+`deposit`) as `points`
|
||||||
FROM `znote_auction_player`
|
FROM `znote_auction_player`
|
||||||
WHERE `sold` = 0
|
WHERE `sold` = 0
|
||||||
AND `time_end` < {$time}
|
AND `time_end` < {$time}
|
||||||
@ -90,6 +93,14 @@ if ($auction['characterAuction']) {
|
|||||||
WHERE `id` IN(".implode(',', $soldIds).")
|
WHERE `id` IN(".implode(',', $soldIds).")
|
||||||
LIMIT ".COUNT($soldIds).";
|
LIMIT ".COUNT($soldIds).";
|
||||||
");
|
");
|
||||||
|
// Transfer points to seller account
|
||||||
|
foreach ($expired_auctions as $a) {
|
||||||
|
mysql_update("
|
||||||
|
UPDATE `znote_accounts`
|
||||||
|
SET `points` = (`points`+{$a['points']})
|
||||||
|
WHERE `account_id` = {$a['original_account_id']};
|
||||||
|
");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// end passive check
|
// end passive check
|
||||||
@ -179,12 +190,12 @@ if ($auction['characterAuction']) {
|
|||||||
WHERE `id` = {$character['zaid']}
|
WHERE `id` = {$character['zaid']}
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
");
|
");
|
||||||
// If character is sold, return deposit back to sellers account
|
// If character is sold, give points to seller
|
||||||
if (time() >= $character['time_end']) {
|
if (time() >= $character['time_end']) {
|
||||||
mysql_update("
|
mysql_update("
|
||||||
UPDATE `znote_accounts`
|
UPDATE `znote_accounts`
|
||||||
SET `points` = `points`+{$character['deposit']}
|
SET `points` = (`points`+{$character['deposit']}+{$price})
|
||||||
WHERE `account_id` = {$account['id']}
|
WHERE `account_id` = {$character['original_account_id']}
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
");
|
");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user