Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
finndefi opened this issue Aug 17, 2021 · 6 comments
Open

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

finndefi opened this issue Aug 17, 2021 · 6 comments
Labels
Support/Help Asking for help or guidance to solve a problem or challenge

Comments

@finndefi
Copy link

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?

@finndefi finndefi changed the title Sorry if I'm missin something on the configuration auctionChar Sorry if I'm missin something on the configuration Aug 17, 2021
@Znote
Copy link
Owner

Znote commented Aug 17, 2021

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.

@Znote Znote added the Support/Help Asking for help or guidance to solve a problem or challenge label Aug 17, 2021
@finndefi
Copy link
Author

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 'FROM znote_auction_playerza INNER JOINplayersp ONza.player_id' at line 17`

@Znote
Copy link
Owner

Znote commented Aug 17, 2021

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

@finndefi
Copy link
Author

finndefi commented Aug 17, 2021

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
Copy link
Author

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
Copy link

mano368 commented Feb 20, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support/Help Asking for help or guidance to solve a problem or challenge
Projects
None yet
Development

No branches or pull requests

3 participants