branchrust_reboot/main/mt_snapshot_savingcancel
160 Commits over 0 Days - Infinitycph!
Bugfix: bypass marker spawning when unit testing
Unrelated blocker to MT saving test
Tests: Ran TestMTSave(NexusIsland), now passes
Optim: avoid struct copy in ExtractTransformAccess, just reinterpet the pointer
shrinks asm to 8 instructions from 40+
Tests: ran TransformEx unit tests
Update: ensure BaseEntities with networkEntityScale can be saved in MT
- added GetLocalScaleMT + unit tests
- increased TestMTSave(BaseEntity) coverage
Tests: ran unit tests - 219 pass/425 fail
Bugfix(tests): rewrite test proto comparison to use serialized buffers
Was naive to hope NUnit would fall back to reflection-based Equals for objects.
Tests: ran TestMTSave(BaseEntity) - it passes (though there's 1 branch that's not covered, gotta fix)
Update: add GetNetworkTime(ThreadSafeTime) overload
Going to use it to gradually convert entity saving code (instead of modifying all 40 callsites from the get go)
Tests: ran unit test for BaseEntity - no longer complains about scripting API, but thinks outputs differ
Update: Convert BaseNetworkable.GetNetworkPosition/Rot to use GetLocalPosMT/RotMT
- every BaseEntity now caches it's TransformHandle on spawn
Only active when UsePlayerJobs >= 4
Tests: ran unit tests (now fails further). spawned a boat on craggy and sailed for a bit - no replication issues.
Update: Implement GetLocalPosMT and GetLocalRotMT that can bypass unity scripting restrictions
- added unit tests
These are dangerous and can only be used if it's known that there's no other overlap with transform hierarchy changes. WIll be slower than TransformHandle read in editor/staging, but should be similarly fast in release
Tests: ran unit tests
Update: cache Time values into ThreadSafeTime so we can avoid unity api calls
- replaced Time.frameCount read in BaseNetworkable
BaseNetworkable can now save, now the rest of BaseEntity
Tests: ran TestMTSave(BaseEntity) - still fails, but now further
New(tests): BaseNetworkableTests.TestMTSave - saves each subclass of BaseNetworkable twice on thread pool, compares results
Tests: ran all 644 cases, all fail, picks up scripting API asserts as hoped