mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
Wrap Handle_OP_MoveItem in a transaction, taking 200+ queries from 200ms+ to 5-20ms
This commit is contained in:
parent
25b143b326
commit
08cae1d63b
@ -10752,6 +10752,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
BenchTimer bench;
|
||||
|
||||
MoveItem_Struct* mi = (MoveItem_Struct*) app->pBuffer;
|
||||
if (spellend_timer.Enabled() && casting_spell_id && !IsBardSong(casting_spell_id)) {
|
||||
if (mi->from_slot != mi->to_slot && (mi->from_slot <= EQ::invslot::GENERAL_END || mi->from_slot > 39) &&
|
||||
@ -10772,6 +10774,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
||||
}
|
||||
}
|
||||
|
||||
database.TransactionBegin();
|
||||
|
||||
if (!SwapItem(mi) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot)) {
|
||||
SwapItemResync(mi);
|
||||
|
||||
@ -10788,6 +10792,10 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
||||
CharacterEvolvingItemsRepository::UpdateOne(database, item->GetEvolvingDetails());
|
||||
}
|
||||
}
|
||||
|
||||
database.TransactionCommit();
|
||||
|
||||
LogInventory("OP_MoveItem took [{}] ms", bench.elapsedMilliseconds());
|
||||
}
|
||||
|
||||
void Client::Handle_OP_MoveMultipleItems(const EQApplicationPacket *app)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user