-
Notifications
You must be signed in to change notification settings - Fork 81
[GEN][ZH] Fix replay header mismatch between builds using 32 bit or 64 bit wide time_t #765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GEN][ZH] Fix replay header mismatch between builds using 32 bit or 64 bit wide time_t #765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Needs to be replicated in Generals.
This 64 bit time_t breaks GenTool replay uploads in VS 2022 builds, because it cannot read the replay header. |
I locally replicated this change to Generals but I am unable to push this to the remote branch
|
d1ab2ba
to
c340968
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replicated in Generals. Looks good.
tomsons26
|
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...