mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-05 04:13:44 +00:00
feat: contraband list with flagging and optional removal
Staff list contraband items on a new dashboard page (item search, reason, flag or flag and remove; contraband_manage to edit, reports_view to see). World servers check every inventory when a character loads and every item a player receives: each find is an economy flag of the new kind Contraband, shown with the other flags and in the character's related data. Items marked for removal are taken away, with a character snapshot kept first so they can be given back, an audit entry and a mail or chat message telling the player why. Staff are skipped unless contraband_ignore_staff is off. Worlds reload the list when it changes (RELOAD_CONTRABAND, added at the end of ePlayerAction). Fixes #1563 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "InventoryComponent.h"
|
||||
#include "Contraband.h"
|
||||
#include "EconomyLedger.h"
|
||||
|
||||
#include <sstream>
|
||||
@@ -204,6 +205,8 @@ void InventoryComponent::AddItem(
|
||||
inventoryType = Inventory::FindInventoryTypeForLot(lot);
|
||||
}
|
||||
|
||||
Contraband::OnItemAdded(m_Parent, lot, count, lootSourceType, inventorySourceType);
|
||||
|
||||
auto* missions = static_cast<MissionComponent*>(this->m_Parent->GetComponent(eReplicaComponentType::MISSION));
|
||||
|
||||
auto* inventory = GetInventory(inventoryType);
|
||||
@@ -336,6 +339,7 @@ ReceivedItem InventoryComponent::ReceiveItem(const LWOOBJID id, const LOT lot, c
|
||||
addItem.showFlyingLoot = options.showFlyingLoot && !options.equip;
|
||||
addItem.SendToClient(m_Parent->GetSystemAddress());
|
||||
EconomyLedger::RecordItems(m_Parent, lot, count, static_cast<uint32_t>(lootSourceType));
|
||||
Contraband::OnItemAdded(m_Parent, lot, count, lootSourceType, options.sourceInventory);
|
||||
if (options.equip) {
|
||||
item->Equip();
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
|
||||
Reference in New Issue
Block a user