Conversation
Just added the missing platform/region strings for clarity
|
I dont like how github throws up all commits to a branch into the PR |
|
I reworked the build config parser slightly. It now supports lookup for iterated keys (i.e. Lookup now uses a generic function. Lookup now has an "enforced" key lookup (keys which are mandatory): |
| @out = null; | ||
| return; | ||
|
|
||
| private bool TryGetRecord<T>(string key, [NotNullWhen(true)] out T? @out) where T : IBuildConfigRecord<T> { |
There was a problem hiding this comment.
Don't add ? in out T?, and use MaybeNullWhen(false) to sort the nullability out.
There was a problem hiding this comment.
without out T? it can't properly resolve IBuildConfigRecord. there are warnings for every usage of TryGetRecord because its trying to get IBuildConfigRecord<T?>. The other things I can implement but with this, removing nullable on it would just lead to warnings everywhere.
There was a problem hiding this comment.
MaybeNullWhen(false) inverts the nullability based on the return condition. It automatically makes the type nullable based on the return value; https://dotnetfiddle.net/5M4KFi
NotNullWhen(true) does not have this behavior: https://dotnetfiddle.net/8rKNcn
There was a problem hiding this comment.
(Notably this also doesn't box primitive values into Nullable<T>)
|
I do wonder if this is one of the reasons why Diablo 4 Steam isn't correctly loading whilst Battle.net is (needing to actually use the ckey and stuff probably.) Ideally we properly parse the full CFileEntry |
I'm in the process of working on some broader changes to VFS parsing, and subsequently CKey lookup. Currently it's all bound to the encoding manifest, which feels iffy because CKeys originate from more locations and not all builds have an encoding file. I'm thinking of moving CKey mapping into the ClientHandler directly. I don't have D4 steam but if you have it installed once I get it finished it'd be great to test it. |
|
Please rebase this onto the https://github.com/overtools/TACTLib/tree/encodingless-vfs-behavior branch VFS files technically can operate entirely without an encoding table (as seen in Diablo 4) There's still some work left to be done in that branch as Diablo 4 Steam has an entirely different way of handling it's product files which is fun but it has some conflicts with this PR already. |
VFS now correctly captures encoded size from cftFileTable.
Not presently being used, but my goal is to migrate over hacky changes from my XSX branch into more finalized impls. If you'd prefer I can wait until everything is more finalized. But I wanted to try and push individual features where i can instead of 1 giga commit.
https://wowdev.wiki/TVFS