mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-29 08:38:20 +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:
@@ -50,6 +50,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/repositories/guild_tributes_repository.h"
|
||||
#include "../common/skill_caps.h"
|
||||
#include "../common/server_reload_types.h"
|
||||
#include "../common/repositories/trader_repository.h"
|
||||
#include "../common/repositories/buyer_repository.h"
|
||||
|
||||
extern ClientList client_list;
|
||||
extern GroupLFPList LFPGroupList;
|
||||
@@ -1860,3 +1862,19 @@ void ZoneServer::IncomingClient(Client* client) {
|
||||
SendPacket(pack);
|
||||
delete pack;
|
||||
}
|
||||
|
||||
void ZoneServer::CheckToClearTraderAndBuyerTables()
|
||||
{
|
||||
if (GetZoneID() == Zones::BAZAAR) {
|
||||
TraderRepository::DeleteWhere(
|
||||
database,
|
||||
fmt::format("`char_zone_id` = {} AND `char_zone_instance_id` = {}", GetZoneID(), GetInstanceID()
|
||||
)
|
||||
);
|
||||
BuyerRepository::DeleteBuyers(database, GetZoneID(), GetInstanceID());
|
||||
|
||||
LogTradingDetail(
|
||||
"Removed trader and buyer entries for Zone ID [{}] and Instance ID [{}]", GetZoneID(), GetInstanceID()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user