mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
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>
41 lines
1.0 KiB
C++
41 lines
1.0 KiB
C++
#ifndef __ICONTRABAND__H__
|
|
#define __ICONTRABAND__H__
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "dCommonVars.h"
|
|
|
|
/**
|
|
* Contraband: items staff don't want players to have (issue #1563), edited on the dashboard. World servers check a
|
|
* character's items against the list when it loads and when items are added, and flag (an economy flag of kind
|
|
* CONTRABAND) or also remove them.
|
|
*/
|
|
class IContraband {
|
|
public:
|
|
enum class eContrabandAction : uint8_t {
|
|
FLAG = 0, // only flag the character
|
|
REMOVE = 1 // flag the character and remove the item
|
|
};
|
|
|
|
struct ContrabandItem {
|
|
LOT lot{};
|
|
std::string reason;
|
|
eContrabandAction action{};
|
|
std::string addedBy;
|
|
int64_t addedAt{};
|
|
};
|
|
|
|
// Every listed item, by LOT
|
|
virtual std::vector<ContrabandItem> GetContrabandItems() = 0;
|
|
|
|
// Insert or replace the row of item.lot
|
|
virtual void SetContrabandItem(const ContrabandItem& item) = 0;
|
|
|
|
// Whether there was a row to delete
|
|
virtual bool DeleteContrabandItem(LOT lot) = 0;
|
|
};
|
|
|
|
#endif //!__ICONTRABAND__H__
|