Znote / ZnoteAAC

Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server.
MIT License
143 stars 127 forks source link

auctionChar Sorry if I'm missin something on the configuration #486

Open finndefi opened 2 years ago

finndefi commented 2 years ago

auctionChar.php string(671) " SELECT za.id AS zaid, CASE WHEN za.price > za.bid THEN za.price ELSE za.bid END AS price, za.time_begin, za.time_end, p.vocation, p.level, p.lookbody AS body, p.lookfeet AS feet, p.lookhead AS head, p.looklegs AS legs, p.looktype AS type, p.lookaddons AS addons FROM znote_auction_player za INNER JOIN players p ON za.player_id = p.id WHERE p.account_id = 999999 AND za.claimed = 0 AND za.sold = 1 AND za.bidder_account_id = 888888 ORDER BY p.level desc " (query - SQL error) Type: select_multi (select multiple rows from database)

Unknown column 'p.lookaddons' in 'field list'

admin_auction.php string(560) " SELECT za.id AS zaid, za.price, za.bid, za.time_begin, za.time_end, p.id AS player_id, p.name, p.vocation, p.level, p.lookbody AS body, p.lookfeet AS feet, p.lookhead AS head, p.looklegs AS legs, p.looktype AS type, p.lookaddons AS addons FROM znote_auction_player za INNER JOIN players p ON za.player_id = p.id WHERE p.account_id = 999999 AND za.claimed = 0 AND za.sold = 1 ORDER BY za.time_end desc " (query - SQL error) Type: select_multi (select multiple rows from database)

Unknown column 'p.lookaddons' in 'field list'

About the addon part. My server is 7.72 so there is no addons. But I don't think that is the only problem here. What am I doing wrong here?

Znote commented 2 years ago

Remove:

`p`.`lookaddons` AS `addons`

From the SQL queries that contains it. There might be more errors, but they won't appear until addon related code is removed first.

finndefi commented 2 years ago

Thanks for our response. Yes the error changed.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROMznote_auction_playerza INNER JOINplayersp ONza.player_id' at line 17`

Znote commented 2 years ago

There might be a , symbol right before FROM that you need to remove as well? Else could you show the full query?

finndefi commented 2 years ago

Didn't find any ,FROM Sure:

edited: I got it Znote.

As I deleted 'p.lookaddons' in 'field list' there was a , remaining on the code above:

`p`.`looktype` AS `type`**,** 
FROM `znote_auction_player` za 

Thank you so much.

finndefi commented 2 years ago

Another question. About refund and profit:

    // If we are refunding a player back to its original owner
    // silently continues to list
    if ($action === 'refund') {
        $zaid = (isset($_POST['zaid']) && (int)$_POST['zaid'] > 0) ? (int)$_POST['zaid'] : false;
        //data_dump($_POST, false, "POST");
        if ($zaid !== false) {
            $time = time();
            // If original account is the one trying to get it back,
            // and bidding period is over, 
            // and its not labelled as sold
            // and nobody has bid on it
            $character = mysql_select_single("
                SELECT `player_id`
                FROM `znote_auction_player`
                WHERE `id`= {$zaid} 
                AND `original_account_id` = {$this_account_id} 
                AND `time_end` <= {$time} 
                AND `bidder_account_id` = 0 
                AND `bid` = 0
                AND `sold` = 0 
                LIMIT 1
            ");

When user refund his own character he can't sell it anymore. I created an account with just one character. Put it to sell, wait bid time and refund it back. Now I'm getting that message when trying to sell it again, like I don't have the requirements.

Your account does not follow the required rules to sell characters.
1. Minimum level: 1
2. Minimum already earned shop points: 1
3. Eligible characters must be offline.

I realized the character is not set as claimed in DB. Idk if thats why this is happening.

And about the profit. User who sell his character is not getting points on his account. I didn't change anything beside removing the addon part. So did I forget to configure something?

mano368 commented 2 years ago

Another question. About refund and profit:

I realized the character is not set as claimed in DB. Idk if thats why this is happening.

And about the profit. User who sell his character is not getting points on his account. I didn't change anything beside removing the addon part. So did I forget to configure something?

I saw the same problem when changed the system to work on OTX 2.15(tfs 0.4).

corrected in a way here, but I can't tell if it's right. I did other tests after and did not find any problems, but idk... here we go:

look for If original account is the one trying to get it back

you will found something like in line 608

// Show character in public character list (in characterprofile.php) mysql_update(" UPDATE znote_players SET hide_char = 0 WHERE player_id = {$character['player_id']} LIMIT 1; ");

after "); press enter and insert this column:

// set claimed 1, to show the character again in list mysql_update(" UPDATE znote_auction_player SET claimed = 1 WHERE id= {$zaid} LIMIT 1; ");

All right, now every time a player withdraws for his own account, he can announce again!