21
replies
922 views
Description
As the title states - it'd be much easier than opening 100 tabs and trying to bump them separately!
Can be used to make Runewords:
As the title states - it'd be much easier than opening 100 tabs and trying to bump them separately!
Request fulfilledby Teebling • 3 years ago•Go 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.
You can now bump all your trades in one go, or delete all your trades in one go.
Misanthropia#2220
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
OP
Lets hope we see some kind of implementation!
Misanthropia#2220
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 . "'";
?>
I love the idea, but it seems ripe for abuse. Maybe implementing a cool down timer (4 hrs?) so people aren't spamming it?
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.
As for cooldown it will be 6 hours.
That new stash area looks incredible.
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
@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.
Diablo 2 New Player Guide (24 Key Topics)
Runewords & Runes Cheat Sheet (NEW incoming)
Trade Value Guides (Runes, Torches, Keys etc)
All Changes in Diablo 2 Resurrected (+More Soon)
Guides & Resource Links Collection
Runewords & Runes Cheat Sheet (NEW incoming)
Trade Value Guides (Runes, Torches, Keys etc)
All Changes in Diablo 2 Resurrected (+More Soon)
Guides & Resource Links Collection
OP
I was thinking it having the original cooldown (24h), but teebling made it 6 hours, which is even better and not easy for abuse!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?
Misanthropia#2220
great idea!
OP
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
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.
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!
I need to focus on other more important things now.
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.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.
I need to focus on other more important things now.
OP
Great job! That might actually ease some of the stress on the server!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.
As for the other thing - was thinking for a popup message like this one:
Misanthropia#2220
@waffels got something in place already, it shows this then refreshes the page after one second:
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
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
Yeah I know what you meant, but it isn't really necessary and I'm trying to cut down on queries where I can
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
Add me Standinsoe#2129 for fast trade
It's coming next week when I deploy the next patch.
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.
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
discord: Lunatiq#7761
Similar pages
Advertisment
Hide adsGreetings stranger!
You don't appear to be logged in...No matches
waffels
108