mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-28 07:27:14 +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:
42
dDashboardServer/templates/contraband.jinja2
Normal file
42
dDashboardServer/templates/contraband.jinja2
Normal file
@@ -0,0 +1,42 @@
|
||||
{% extends "base.jinja2" %}
|
||||
|
||||
{% block title %}Contraband - DarkflameServer{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="contrabandPage">
|
||||
<div class="mb-3">
|
||||
<h2 class="mb-1">Contraband</h2>
|
||||
<p class="text-body-secondary mb-0">Items players shouldn't have. World servers check every inventory (vault included) when a character loads,
|
||||
and every item a player receives. <strong>Flag</strong> adds an economy flag for staff to review; <strong>Remove</strong> flags it and takes the
|
||||
item away (a snapshot of the character is kept first, so it can be given back from the character page). Staff accounts aren't checked unless
|
||||
<code>contraband_ignore_staff</code> is off. Running worlds pick up changes straight away.
|
||||
Flags found: <a href="/reports#flags">Economy & Map, Flags</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3 d-none" id="addCard">
|
||||
<div class="card-body">
|
||||
<form class="row g-2 align-items-end" id="addForm">
|
||||
<div class="col-md-4"><label class="form-label small mb-1" for="lotInput">Item</label>
|
||||
<input class="form-control form-control-sm" id="lotInput" list="lotSuggestions" required autocomplete="off" placeholder="Name or LOT">
|
||||
<datalist id="lotSuggestions"></datalist></div>
|
||||
<div class="col-md-4"><label class="form-label small mb-1" for="reasonInput">Reason</label>
|
||||
<input class="form-control form-control-sm" id="reasonInput" maxlength="300" placeholder="Shown to staff, and to the player if it's removed"></div>
|
||||
<div class="col-md-2"><label class="form-label small mb-1" for="actionInput">When found</label>
|
||||
<select class="form-select form-select-sm" id="actionInput"><option value="flag">Flag</option><option value="remove">Flag and remove</option></select></div>
|
||||
<div class="col-md-2"><button type="submit" class="btn btn-sm btn-primary w-100">Save</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<table class="table table-sm align-middle mb-0 table-stack">
|
||||
<thead><tr><th>Item</th><th>Reason</th><th>When found</th><th>Added</th><th></th></tr></thead>
|
||||
<tbody id="rows"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="/js/contraband.js"></script>
|
||||
{% endblock %}
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set worldPages = ["world3d", "reports"] %}
|
||||
{% set worldPages = ["world3d", "reports", "contraband"] %}
|
||||
{% if can.players_view or can.reports_view %}
|
||||
<div class="nav-group">
|
||||
<button class="nav-group-toggle" type="button" data-bs-toggle="collapse" data-bs-target="#nav-world" aria-expanded="{% if current_page in worldPages %}true{% else %}false{% endif %}" aria-controls="nav-world">
|
||||
@@ -58,6 +58,7 @@
|
||||
<div class="list-group list-group-flush">
|
||||
{% if can.players_view %}<a href="/world3d" class="list-group-item list-group-item-action{% if current_page == "world3d" %} active{% endif %}">World 3D</a>{% endif %}
|
||||
{% if can.reports_view %}<a href="/reports" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center{% if current_page == "reports" %} active{% endif %}">Economy & Map <span class="badge rounded-pill text-bg-danger d-none" data-badge="reports" title="Open economy flags"></span></a>{% endif %}
|
||||
{% if can.reports_view %}<a href="/contraband" class="list-group-item list-group-item-action{% if current_page == "contraband" %} active{% endif %}">Contraband</a>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user