Include metadata fields in schema#1
Merged
Conversation
Collaborator
|
Looks good, since you took the list from source2gen you need to comply with their apache license, please add their license to the NOTICE file and that will do. |
xPaw
reviewed
May 17, 2025
| FNV32("MPropertyDescription"), | ||
| FNV32("MPropertyExtendedEditor"), | ||
| FNV32("MPropertyFriendlyName"), | ||
| FNV32("MPropertyFriendlyName"), |
Poggicek
reviewed
May 17, 2025
| // These are used to determine if we can include the corresponding metadata entry value in the dump. | ||
| // Original list sourced from Source2Gen project. | ||
|
|
||
| constinit std::array string_metadata_entries = { |
Collaborator
There was a problem hiding this comment.
I believe this is way too overengineered, we do not care about few ms of performance, but do care about the code readibility. I am for using std map with std strings that will get hashed in std lib itself and map it to an enum of the different type values. Then resolve those enums in a switch case to the proper string value.
Collaborator
|
I will do the changes and merge it in, no need to resolve these |
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.
This change includes metadata names and values in dumps for classes, enums, and fields. They can also contain interesting information to compare against in game updates. Metadata can have different value types, I only handle the primitive ones, as there could be more - such as ones that use custom data structures which could also change between engine revisions (e.g Pulse system bindings). These fields get put in comment format above the corresponding definition.
Metadata names that include some value are defined in a separate file as array of values that gets looked up when dumping. This list might not be exhaustive, and it also might change between engine revisions, but probably not that commonly.
Sample output:
Note 1: I used compile time string hash (FNV1a) for efficient comparison when looking up metadata entries.
Note 2: Some more printable fields could be added (e.g for MNetworkVarNames that uses a compound value with a name and value) I think this could differ a bit between engines, so I didn't touch it yet, but we could still do a commit for that.