feat: take_powerup VFX, rank fix, admin chat management

- Wire take_powerup AnimatedSprite3D on powerup pickup via add_powerup_from_item()
- Make take_powerup animation one-shot (loop: false)
- Fix rank Position label hidden at game start (visible = false, only shows when score > 0)
- Competition ranking for tied scores in main.gd
- Lobby Chat admin tab: system prefix, max messages, wipe, purge old, save config
- Chat Storage admin tab: list/browse/delete individual channel messages
- Backend RPCs: admin_get_chat_config, admin_set_chat_config, admin_purge_old_messages,
  admin_list_channel_messages, admin_delete_channel_message
- Chat config applied on lobby join (max_messages, prefix injection)
This commit is contained in:
2026-06-19 17:13:24 +08:00
parent cd584f5599
commit 15043b5655
12 changed files with 818 additions and 7 deletions
+25
View File
@@ -556,3 +556,28 @@ func _apply_loadout_character() -> void:
if idx != -1:
LobbyManager.local_character_index = idx
print("[Lobby] Loadout character applied: ", saved_char)
# =============================================================================
# Admin Chat Actions (called from Admin Panel)
# =============================================================================
func admin_wipe_chat() -> void:
"""Wipe the entire global lobby chat. Called by admin panel."""
if not chat or not chat._chat_channel:
push_warning("[Lobby] admin_wipe_chat: chat not connected.")
return
var payload = JSON.stringify({"channel_id": chat._chat_channel.id})
var result = await BackendService.admin_clear_global_chat(payload)
if result.get("success", false):
chat._chat_messages.clear()
chat._refresh_chat_display()
chat._inject_local_message("[SYSTEM] : Global chat cleared by admin.")
else:
push_warning("[Lobby] admin_wipe_chat failed: " + str(result.get("message", "")))
func admin_purge_chat(max_age_days: int) -> int:
"""Purge messages older than max_age_days. Returns count deleted. Called by admin panel."""
if not chat or not chat._chat_channel:
push_warning("[Lobby] admin_purge_chat: chat not connected.")
return 0
var result = await BackendService.admin_purge_old_messages(chat._chat_channel.id, max_age_days)
return result.get("deleted", 0)