Skip to content

feat(server/storage): emit characterDeleted when a character is deleted - #778

Closed
mur4i wants to merge 1 commit into
Qbox-project:mainfrom
mri-Qbox-Brasil:feat/character-deleted-event
Closed

mur4i wants to merge 1 commit into
Qbox-project:mainfrom
mri-Qbox-Brasil:feat/character-deleted-event

Conversation

@mur4i

@mur4i mur4i commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fires qbx_core:server:characterDeleted with the citizenid from storage.deletePlayer when the deletion succeeds.

Emitting it from storage covers every deletion path: the built-in character menu, the DeleteCharacter export, and external character resources that call the storage module directly.

This lets a resource clean up its own per-character data instead of adding its tables to characterDataTables. That also covers data the table list cannot express, such as rows keyed by phone number or app accounts, and avoids first-boot Table 'x' does not exist in database warnings for resources that create their tables on start.

AddEventHandler('qbx_core:server:characterDeleted', function(citizenid)
end)

It is a server-only TriggerEvent. characterDataTables is unchanged, so this is purely additive.

Related Issues

Relates to #398 and #478.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change

Testing

On a local Qbox server, with a listener in a phone resource that wipes the character's phone data:

  • Built-in character menu: event received, phone data removed.
  • External character resource calling storage.deletePlayer: event received, phone data removed.
  • exports.qbx_core:DeleteCharacter: event received, 7 rows across 7 tables removed.

Checklist

Fires qbx_core:server:characterDeleted with the citizenid from
storage.deletePlayer once the transaction succeeds, so every deletion
path emits it: the built-in character menu, the DeleteCharacter export
and external character resources that call the storage module directly.
Lets resources clean up their own per-character data instead of listing
their tables in characterDataTables.
@mur4i
mur4i force-pushed the feat/character-deleted-event branch from bd97674 to 56e79a9 Compare September 28, 2026 22:55
@mur4i mur4i changed the title feat(server/player): emit characterDeleted after a character is deleted feat(server/storage): emit characterDeleted when a character is deleted Sep 28, 2026
@mur4i mur4i closed this Sep 29, 2026
@mur4i
mur4i deleted the feat/character-deleted-event branch September 29, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant