Search the database
Search forum topics
Search members
Search for trades
diablo2.io is supported by ads
diablo2.io is supported by ads
21 replies   930 views
1

Suggestion: Bump all of your active trades

No data yet

Site Feedback

2

Description

As the title states - it'd be much easier than opening 100 tabs and trying to bump them separately!
5

Can be used to make Runewords:

7
As the title states - it'd be much easier than opening 100 tabs and trying to bump them separately!
Request fulfilledby Teebling3 years agoGo to post
Fixed/feature request fulfilled in v1.0 - see patch notes here.

You can now bump all your trades in one go, or delete all your trades in one go.

Misanthropia#2220
7
User avatar

Beardozer 461Moderator

Sorceress Americas PC
Not a bad idea tbh. If I sit down to play, all my items are now up for trade. I get up and leave, they all go offline with me. It's kind of an 'I'm here' button.

diablo2.io janitor | Odunga Brotherhood
7
OP
Lets hope we see some kind of implementation!

Misanthropia#2220
7
User avatar

Teebling 6882Admin

Europe PC
I liked this idea so much that I coded it straight away on the dev environment :) Working-ish and will ship with patch 1.0 when it's ready.

Code: Select all

<?php
//                (     (     
//                )\ )  )\ )  
//               (()/( (()/(  
//              (/(_)) /(_)))   
//               |_ _| |_ _|  
//                | |   | |   
//               |___| |___|  
//                            
//            https://diablo2.io
//
//            <>~~~~~~<>~~~~~~<>
//
//         Bump all trades in one go
//
//        By Teebling (Copyright 2021).
//      Protected and registered with DMCA.    

// Start phpBB session management
$user->session_begin();
$auth->acl($user->data);

// Set const now to request UNIX timestamp when script executed
$now = time();

// Set window in which bumps are possible by subtracting six hours from $now
$sixhoursago = ($now - 21600);

// Get the current logged in user's ID (more secure than URL param)
$user_id_real = $user->data['user_id'];

// Query to update all trades with bump stuff in one go, if bumping is possible (out of timespan specified by $sixhoursago )
$sql = "UPDATE phpbb_topics SET topic_last_post_time = '" . $now . "', topic_bumped='1', topic_bumper='" . $user_id_real . "' WHERE forum_id=16 AND sold!=1 AND topic_poster='" . $user_id_real . "' AND topic_last_post_time < '" . $sixhoursago . "'";

?>
Bump all button in new stash area
Bump all button in new stash area

7
I love the idea, but it seems ripe for abuse. Maybe implementing a cool down timer (4 hrs?) so people aren't spamming it?
7
User avatar

Teebling 6882Admin

Europe PC
Testing this more and it seems that it's not enough to just update the last post tim in the query, looking into it further but no promises on if it's possible or not...

As for cooldown it will be 6 hours.

7
That new stash area looks incredible.
7
User avatar

Beardozer 461Moderator

Sorceress Americas PC
Along the same lines, I don't want to volunteer you for more work teebs, but a 'close all trades' for when I am done for the night would be cash as well.

diablo2.io janitor | Odunga Brotherhood
7
User avatar

BillyMaysed 2262Moderator

Sorceress Americas PC
@Teebling I love how you tossed this trade system together right before launch and now its become the hottest thing on the internet for diablo.

7
OP
CantankerousCrow wrote: 3 years ago
I love the idea, but it seems ripe for abuse. Maybe implementing a cool down timer (4 hrs?) so people aren't spamming it?
I was thinking it having the original cooldown (24h), but teebling made it 6 hours, which is even better and not easy for abuse!

Misanthropia#2220
7
great idea!
7
OP
Teebling wrote: 3 years ago
<snip>
Might be nice to return the number of bumped items out of the total number active trades for that user.

Some pseudo (going by your code):

Code: Select all

// Get all active trades of a give user
$total_user_trades = "SELECT COUNT(*) FROM phpbb_topics WHERE forum_id = 16 AND sold != 1 AND topic_poster = '" . $user_id_real . "' ";

// Query to update all trades with bump stuff in one go, if bumping is possible (out of timespan specified by $sixhoursago )
$sql = "UPDATE phpbb_topics SET topic_last_post_time = '" . $now . "', topic_bumped='1', topic_bumper='" . $user_id_real . "' WHERE forum_id=16 AND sold!=1 AND topic_poster='" . $user_id_real . "' AND topic_last_post_time < '" . $sixhoursago . "'";

// How many trades have been bumped
$bumped_cnt =  @@ROWCOUNT;

// User receives a message 
>> "You've successfully bumped '" . $bumped_cnt . "' trades out of '" . $total_user_trades. "' total."

Misanthropia#2220
7
User avatar

Teebling 6882Admin

Europe PC
Happy to say that I managed to get both of these things working with my own scripts :) You'll be able to bump all your trades in one go, or if you want, delete all your active trades in one go.
Mass bump/deletion working
Mass bump/deletion working
phpBB's topic deletion/topic bumping methods are actually a lot more comprehensive than I thought and this required a fair bit of work to get running from standalone scripts, but aye both working fully on dev now hooray!
waffels wrote: 3 years ago
Might be nice to return the number of bumped items out of the total number active trades for that user.
Too much - I'd have to then find a place in the GUI for that etc... on page refresh it shows that all your trades have been bumped/delete as appropriate and this will be enough for everyone.
I need to focus on other more important things now.

7
OP
Teebling wrote: 3 years ago
Happy to say that I managed to get both of these things working with my own scripts :) You'll be able to bump all your trades in one go, or if you want, delete all your active trades in one go.

Too much - I'd have to then find a place in the GUI for that etc... on page refresh it shows that all your trades have been bumped/delete as appropriate and this will be enough for everyone.
I need to focus on other more important things now.
Great job! That might actually ease some of the stress on the server!

As for the other thing - was thinking for a popup message like this one: But of course everything in due its time. :)

Misanthropia#2220
7
User avatar

Teebling 6882Admin

Europe PC
@waffels got something in place already, it shows this then refreshes the page after one second:

7
OP
@Teebling Was thinking like this: That would mean the other 23 trades have been bumped or created in the last 6 hours.
I attached some pseudocode for that up above.

Of course I have no idea what's below, so it might be hard to achieve =P

Misanthropia#2220
7
User avatar

Teebling 6882Admin

Europe PC
Yeah I know what you meant, but it isn't really necessary and I'm trying to cut down on queries where I can :P

7
Hey @Teebling , happy Friday! could you please share the full screenshot on where this 'bump all' button is located? do not see it in profile

Feel free to check all my trades
Add me Standinsoe#2129 for fast trade
7
Thanks for pointing to this topic (any no thanks for using rude words in my original ones, where I've clearly asked if my plugin is ok for you).

A small suggestion about the current approach, if you code is equal to the one you've posted above, I would suggest to check last time user used `bump all` button and limit it to some timeframe.
Yes, you are using single update statement for the entire orders (check if you have all proper indexes, but I bet you do), but that Update will not be super-fast, since user to orders is 1:N relation. So, checking if user is eligible to use bump should be faster.

bnet: Lunatiq#2926
discord: Lunatiq#7761
9

Advertisment

Hide ads
999

Greetings stranger!

You don't appear to be logged in...

99

Who is online

Users browsing Feedback: No registered users and 2 guests.

No matches
 

 

 

 

Value:
Hide ads forever by supporting the site with a donation.

Greetings adblocker...

Warriv asks that you consider disabling your adblocker when using diablo2.io

Ad revenue helps keep the servers going and supports me, the site's creator :)

A one-time donation hides all ads, forever:
Make a donation