mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-03 03:50:40 +00:00
[Fix] Add trader/buyer cleanup actions (#4843)
* Add trader/buyer cleanup actions 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 * Formatting Updates
This commit is contained in:
+23
-1
@@ -505,6 +505,9 @@ void EntityList::MobProcess()
|
||||
zone->GetSecondsBeforeIdle(),
|
||||
zone->GetSecondsBeforeIdle() != 1 ? "s" : ""
|
||||
);
|
||||
|
||||
CheckToClearTraderAndBuyerTables();
|
||||
|
||||
mob_settle_timer->Disable();
|
||||
}
|
||||
|
||||
@@ -2335,7 +2338,7 @@ void EntityList::QueueClientsGuild(const EQApplicationPacket *app, uint32 guild_
|
||||
void EntityList::QueueClientsGuildBankItemUpdate(GuildBankItemUpdate_Struct *gbius, uint32 guild_id)
|
||||
{
|
||||
auto outapp = std::make_unique<EQApplicationPacket>(OP_GuildBank, sizeof(GuildBankItemUpdate_Struct));
|
||||
auto data = reinterpret_cast<GuildBankItemUpdate_Struct *>(outapp->pBuffer);
|
||||
auto data = reinterpret_cast<GuildBankItemUpdate_Struct *>(outapp->pBuffer);
|
||||
|
||||
memcpy(data, gbius, sizeof(GuildBankItemUpdate_Struct));
|
||||
|
||||
@@ -6009,3 +6012,22 @@ void EntityList::RestoreCorpse(NPC *npc, uint32_t decay_time)
|
||||
c->SetDecayTimer(decay_time);
|
||||
}
|
||||
}
|
||||
|
||||
void EntityList::CheckToClearTraderAndBuyerTables()
|
||||
{
|
||||
if (zone->GetZoneID() == Zones::BAZAAR) {
|
||||
TraderRepository::DeleteWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"`char_zone_id` = {} AND `char_zone_instance_id` = {}", zone->GetZoneID(), zone->GetInstanceID()
|
||||
)
|
||||
);
|
||||
BuyerRepository::DeleteBuyers(database, zone->GetZoneID(), zone->GetInstanceID());
|
||||
|
||||
LogTradingDetail(
|
||||
"Removed trader and buyer entries for Zone ID [{}] and Instance ID [{}]",
|
||||
zone->GetZoneID(),
|
||||
zone->GetInstanceID()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user