Add character teleport, delete, and account kick/delete to admin panel
Traced how login placement actually works: CPlayer login placement (Src/World Server/worldpackets.cpp:27, pakPlayer) calls GetRespawnByID(Position->respawn), and Position->respawn is loaded straight from characters.respawnid (playerdata.cpp:110). So setting respawnid to a Src/World Server list_respawnzones.id is a real, live lever over where a character logs in next -- not a vestigial column (unlike characters.townid, which turned out to be dead: the only other code path that reads it is commented-out dead code in pakUserDied, superseded by CPlayer::RespawnPlayer which uses an in-memory Position->saved instead). Added to the character edit page: a teleport dropdown grouped by map, populated from list_respawnzones, wired straight to respawnid (takes effect on the character's next login same as other stat edits) and a delete-character action. Added to the account edit page: delete account (characters are kept) and a "reset online flag" action for accounts stuck thinking they're still logged in after a crash. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9829688a85
commit
315f64cf95
3 files changed
+103
-4
No files matched your search
@@ -4,7 +4,19 @@
|
||||
<div class="card" style="max-width:600px;">
|
||||
<h2 style="margin-top:0;">Charakter: {{ char.char_name }} <span class="badge ok">Account: {{ char.account_name }}</span></h2>
|
||||
<form method="post">
|
||||
<div class="grid">
|
||||
<label>Standort (wirkt beim nächsten Login)</label>
|
||||
<select name="respawnid">
|
||||
<option value="{{ char.respawnid }}">-- aktuell: Zone #{{ char.respawnid }} --</option>
|
||||
{% for map, zones in zones_by_map.items() %}
|
||||
<optgroup label="Map {{ map }}">
|
||||
{% for z in zones %}
|
||||
<option value="{{ z.id }}">Map {{ z.map }} - Zone #{{ z.id }} ({{ '%.0f' % z.x }}, {{ '%.0f' % z.y }})</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<div class="grid" style="margin-top:12px;">
|
||||
{% for field in stat_fields %}
|
||||
<div>
|
||||
<label>{{ field.lstrip('_') }}</label>
|
||||
@@ -20,4 +32,11 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card" style="max-width:600px;border-color:#5a2530;">
|
||||
<h3 style="margin-top:0;color:var(--danger);">Gefahrenzone</h3>
|
||||
<form method="post" action="{{ url_for('delete_character', char_id=char.id) }}"
|
||||
onsubmit="return confirm('Charakter {{ char.char_name }} wirklich unwiderruflich löschen?');">
|
||||
<button type="submit" style="background:var(--danger);">Charakter löschen</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user