[GEN][ZH] Fix replay header mismatch between builds using 32 bit or 64 bit wide time_t #765
+42
−18
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.
Another day goes by, and another bug is discovered. But this time, it's not a bug in the retail version, but in our build with VS22.
The replay header contains (among other) these elements:
start and endtime are of type time_t. On VC6 this was 32-bit, but on newer compilers it's 64-bit. In order to remain compatible, we need to load and save them as 32-bit. This PR fixes that.
Now you may ask: Wait, why did we not notice until now? Why are replays working?
Well, the replayName syncs everything up. It's serialized with a special character to indicate its end, and since all other header elements very likely don't contain that character, the serialization is automatically fixed there. But all the replay header elements listed above are indeed parsed and written out corrupted. We also didn't notice that, because, as it turns out, all those elements are invisible to the user.
We should still fix it though, so we don't spread the internet with corrupted replays. I'd also like to use the mismatch flag to harvest some non-mismatched replays for automatic testing in the near future...