TMPE icon indicating copy to clipboard operation
TMPE copied to clipboard

Hotreload save

Open kianzarrin opened this issue 2 years ago • 5 comments

hot reloading saved data can fail because binary serializer tries to get data types from the wrong TMPE assembly. This PR applies a patch that forces all data types to use latest TMPE assembly. Also if LOM is active asset data is hotreloaded.

First commit: introduce Preload Patch phase Second commit: hot reload

kianzarrin avatar Aug 18 '22 10:08 kianzarrin

This feature shouldn't be available on public/release version

krzychu124 avatar Aug 27 '22 23:08 krzychu124

This feature shouldn't be available on public/release version

@krzychu124 its only available when hot-reloading. otherwise the code is not executed.

kianzarrin avatar Sep 05 '22 22:09 kianzarrin

This feature shouldn't be available on public/release version

@krzychu124 its only available when hot-reloading. otherwise the code is not executed.

I understand, but I don't think normal users should be able to use hot-reloading feature. We have features like ExtCitizen data holding ParkingAI state which will desync and cause flying citizens all over the map. It's very minor issue if you develop or test things but very annoying when you actually play normally.

One more thing, I see that asset data reload will work only if LOM is available, right?

krzychu124 avatar Sep 15 '22 23:09 krzychu124

I don't think normal users should be able to use hot-reloading

OK I make it DEBUG only. CS should probably turn off file observers too. but that can be done with LOM patch as well.

I see that asset data reload will work only if LOM is available, right?

Yes. LOM holds the data that needs to be transferred.

kianzarrin avatar Sep 15 '22 23:09 kianzarrin

Q: What will happen if I hot-reload different mod after hot-reloading TM:PE (patch is still active)?

krzychu124 avatar Sep 21 '22 22:09 krzychu124