H-uru / korman

Blender plugin for creating ages for Cyan Worlds' proprietary Plasma engine and its open source variant, CyanWorlds.com Engine.
GNU General Public License v3.0
34 stars 17 forks source link

Re-fix the TPotS launching race condition. #355

Closed Hoikas closed 1 year ago

Hoikas commented 1 year ago

Recap: There is a bug in Windows where file IO with the C apis can race if the operations occur in separate processes. This means that sometimes the TPotS auto-linking feature would link you to the wrong Age due to reading an old/cached copy of the vault file.

This was fixed in H-uru/libhsplasma#242 originally, but Win32 APIs seem to have terrible performance without user mode buffering, which negatively impacted PRP loading in other tools, such as PRP Shop. Therefore, the fix was reverted in H-uru/libhsplasma#246. This fixes the race condition closer to the point of impact using the Win32 stream introduced by H-uru/libhsplasma#264.

This is a draft until H-uru/libhsplasma#264 is accepted.