handlers: report inventory, unit, town and campaign state from UserInfo - #40
Open
Seltraeh wants to merge 1 commit into
Open
handlers: report inventory, unit, town and campaign state from UserInfo#40Seltraeh wants to merge 1 commit into
Seltraeh wants to merge 1 commit into
Conversation
Expands the UserInfo response to report the state the preceding handlers persist. Every block reads from a table created in the schema PR, so this is additive and returns empty arrays on a fresh account. Owned items populate warehouse_info, equip_info, item_dictionary_info and item_favorite from user_items, replacing the hardcoded potion and its TODO. Zero-quantity stacks are filtered off the wire but still feed the dictionary, so a species stays in the encyclopedia once seen. Cleared-mission history (UT1SVg59) comes from user_campaign_missions. This is the progression driver: the client evaluates feature unlocks against this list, so anything gated on "mission N cleared" stays locked without it. Favorited units (3kcmQy7B) are reported back so UnitFavorite locks survive a reload. Town state emits the three arrays together. Every entry in town_location_info requires a matching town_location_detail entry, because the client dereferences the detail for each location and an empty detail array crashes the town scene loader. Collected here rather than spread across the item, unit, town and campaign PRs so that only one pull request touches this file.
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.
handlers: report inventory, unit, town and campaign state from UserInfo
Branch:
split/11-userinfo-stateBase:
devMerge position: 11 of 13
Collects every
UserInforesponse change into a single PR, so only one pull request in the series touches this file.What's included
Each block reads a table created in PR 03 and returns an empty array when that table is empty, so this is additive and inert on a fresh account.
warehouse_info,equip_info,item_dictionary_infoanditem_favoritefromuser_items, replacing the hardcoded potion and its TODO. Zero-quantity stacks are filtered off the wire but still feed the dictionary, so a species stays in the encyclopedia once seen.UT1SVg59) fromuser_campaign_missions. This is the progression driver: the client evaluates feature unlocks against this list, so anything gated on "mission N cleared" stays locked without it.3kcmQy7B) soUnitFavoritelocks survive a reload.town_location_infoneeds a matchingtown_location_detailentry, because the client dereferences the detail for each location and an empty detail array crashes the town scene loader.Why it's separate
Items, Units, Town and Campaign each needed their own block here. Spread across four PRs they collide on every merge; collected into one they don't. The functional cost is that PRs 04-06 and 10 persist state they don't yet report — merge this and it all lights up at once.
Verification
Fresh account: every array empty, no client complaint. After the tutorial: potion in warehouse. After a town upgrade and a cleared mission: both survive a relaunch.