2 ms·
This isn’t the most important thing I’ve done, but it’s certainly one of the coolest. And it was important to millions of Starcraft players. There was a time w
by neurocline 8y ago
This isn’t the most important thing I’ve done, but it’s certainly one of the coolest. And it was important to millions of Starcraft players.
There was a time when we broke patching for Starcraft. I point no fingers because, of the top 4 engineers that worked on Battle.net from the beginning until the point of this incident, 3 of them (myself included) broke patching (Diablo, Warcraft II BNE (my bad), and now Starcraft). This is a tragedy, because we always took the mechanics of it very seriously, and still would get it wrong.
A patch went out that broke the patching mechanism. Starcraft worked fine, but if you had to download another patch, the game would crash. We were looking at a scenario where everyone would have to reinstall the game, and that sucks. Worse, this was back in the early 2000s, so we had no way to message everyone easily.
I spent two days non-stop trying to find a way out. And then I had a crazy brilliant idea, based on the original bug. See, the crash bug was a stack overwrite, causing the version detection code to crash inside the game when returning from the version check. I figured out a way to cause another stack overwrite to fix the first one; use the downloadable version DLL we used at the time to leave a trampoline on the stack that would be right at the stack overflow caused by the bug, and cause the game to jump straight to the download-next-patch section of the code. It took a little while to get everything to work properly, but it was glorious. We made a small patch to fix the bug, and used my stack-overwrite hack to get the game to download it. And then I went and got some sleep.
After this, we (Blizzard) overhauled how we did patch testing, and stopped breaking patching.