[Phoenix] Adds Economy Tracking Modules - #189
Open
Frankie-hz wants to merge 2 commits into
Open
Conversation
Frankie-hz
force-pushed
the
economytraack
branch
5 times, most recently
from
August 28, 2026 22:55
bb71e55 to
5f752ee
Compare
Frankie-hz
force-pushed
the
economytraack
branch
from
August 29, 2026 00:44
98ee4a4 to
e2cdf5b
Compare
Frankie-hz
force-pushed
the
economytraack
branch
from
August 29, 2026 00:46
e2cdf5b to
6f0ea92
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I affirm:
What does this pull request do?
I will be very honest in this PR, as usual. Core concept was ran through with AI over almost a combined 15 hours. Each function was hand audited and checked for clarity. Comments were kept short and concise as possible without going into paragraphs explaining things.
Each and every single gill audit was tested by hand, by myself.
Example sql:

Adds a gil economy ledger module for Phoenix. Every gil balance change on every character is written to a new
audit_giltable with who moved it, why, with whom, and for what item. This gives us a full record of gil entering and leaving the economy, per character and per source, without editing any core file.How it works
modules/phoenix/cpp/gil_audit.cpp) observes theITEM_NUMpacket the server already pushes for every gil quantity change, so no gil movement can be missed. Incoming packets (shop, guild, bazaar, trade, AH, delivery box) publish short-lived "reasons" that label the next movement; a Lua module (gil_audit_sources.lua) does the same for scripted gil (quest rewards, GM commands, mob drops, Mug, chocobo rental, starting gil) by wrapping the central helpers and calling through unchanged.onEventFinishis matched to the character's open trade transaction, and delivery box movements to the open send or receive box.sourceas a readable name (VendorBuy,Script,GmCommand, ...),source_detail(the helper or packet),counterparty(the player, NPC, or mob on the other side),itemidwhere one applies, zone, and date.txn_id, unique across map processes and restarts, so bazaar tax is visible as the difference between legs.map.AUDIT_GILandmap.AUDIT_GIL_MOBSdefault to on with no settings file changes; an operator can force either off insettings/map.lua.tools/gil_reconcile.pycross-checks the ledger against livechar_inventorybalances and reports per-source mint/burn totals.Steps to test these changes
Full test plan with the exact expected row for every scenario (31 tests plus reconciliation checks): Gil Ledge Test Plan