[Fix] Add trader/buyer cleanup actions#4843
Merged
Akkadius merged 2 commits intoEQEmu:masterfrom May 15, 2025
Merged
Conversation
Add trader/buyer db cleanup for - on zone idle - on client first login - when world drops a zone connection - in Client::ProcessMovePC Cleanup several compiler warnings
Akkadius
reviewed
Apr 10, 2025
world/zonelist.cpp
Outdated
Comment on lines
+88
to
+100
| auto port = (*iter)->GetCPort(); | ||
| auto zone_id = (*iter)->GetZoneID(); | ||
| auto instance_id = (*iter)->GetInstanceID(); | ||
| if (zone_id == Zones::BAZAAR) { | ||
| TraderRepository::DeleteWhere( | ||
| database, | ||
| fmt::format("`char_zone_id` = '{}' AND `char_zone_instance_id` = '{}'", zone_id, instance_id) | ||
| ); | ||
| BuyerRepository::DeleteBuyers(database, zone_id, instance_id); | ||
|
|
||
| LogTradingDetail("Removed trader abd buyer entries for Zone ID {} and Instance ID {}", zone_id, instance_id); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Can we make a function that takes in the ZS as input and performs this action if Bazaar?
Akkadius
reviewed
Apr 10, 2025
zone/trading.cpp
Outdated
Comment on lines
+1561
to
+1564
| auto outapp = std::make_unique<EQApplicationPacket>( | ||
| OP_BazaarSearch, | ||
| static_cast<uint32>(sizeof(BazaarWelcome_Struct)) | ||
| ); |
Akkadius
reviewed
Apr 10, 2025
zone/zoning.cpp
Outdated
|
|
||
| // Added to ensure that if a player is moved (ported, gmmove, etc) and they are an active trader or buyer, they will | ||
| // be removed from future transactions. | ||
| if(IsTrader()) { |
Contributor
There was a problem hiding this comment.
if(IsTrader()) { vs if (IsTrader()) {
Akkadius
reviewed
Apr 10, 2025
zone/zoning.cpp
Outdated
| TraderEndTrader(); | ||
| } | ||
|
|
||
| if(IsBuyer()) { |
Contributor
There was a problem hiding this comment.
if(IsBuyer()) { vs if (IsBuyer()) {
Akkadius
reviewed
Apr 10, 2025
Akkadius
reviewed
Apr 10, 2025
Akkadius
reviewed
Apr 10, 2025
Akkadius
reviewed
Apr 10, 2025
Akkadius
reviewed
Apr 10, 2025
Akkadius
reviewed
Apr 10, 2025
Contributor
Author
|
Thanks for the comments Akk. My formatting was clearly lost. Updated and fixed up my auto formatting. |
Akkadius
approved these changes
May 15, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cleanup several compiler warnings
Description
There have been some reports of trader/buyer tables with erroneous entries when a bazaar instance crashes, or an active trader
is ported. In reviewing, several updates have been added to protect from various scenarios.
Add trader/buyer db cleanup for
Also made a few compiler warning updates.
Type of change
Testing
Tested with various combos of db entires and zone idle, crash, client crash, etc
Clients tested:
RoF2
Checklist