branchrust_reboot/main/syncvarscancel
                         
                     
             
         
     
    
        
115 Commits over 120 Days - 0.04cph!
    
    
    
        
        
            
            
            
                
                Issue a warning if sync vars are an unsupported type
                
                
                
                
             
         
        
            
            
            
                
                Remove unused train sync stuff
                
                
                
                
             
         
        
        
            
            
            
                
                Add exact array pool - only returns arrays that are exact sizes. This is needed for serialisation. I cant have anything too big
                
                
                
                
             
         
        
            
            
            
                
                Fix protobuf types being unable to be Autosaved/loaded properly
(Trailing empty bits at the end were causing it to be rejected, so im required to use a byte array of exact size)
Removed array pool logic, just cache it per class. Should stay similarly sized and only allocate once per object so overall impact should hopefully be low
                
                
                
                
             
         
        
            
            
            
                
                Return old Protobuf SyncVar instances to the pool
                
                
                
                
             
         
        
            
            
            
                
                Swap to partial event hooks. Works with intelisense better than the frankenstein event with matching method
                
                
                
                
             
         
        
            
            
            
                
                Prevent unecessary weaving fires
Try without generating the event keyword
                
                
                
                
             
         
        
        
            
            
            
                
                Totally remove hash set used for queue and just encode the whole queue into a single uint. We can just send this as the header(since the current queue perfectly reflects the encoded data)
Send DemoTransientEntity once per queue instead of for each item in the queue
Move is server check to the queueing rather than sending method (more clear)
                
                
                
                
             
         
        
            
            
            
                
                Update SourceGenerator DLL - better error messages
                
                
                
                
             
         
        
        
            
            
            
                
                Optimised SyncAttribute searching on patching step
                
                
                
                
             
         
        
            
            
            
                
                Fix train engine packing options
                
                
                
                
             
         
        
            
            
            
                
                Handle syncvar equality checking in BaseNetworkable: having the method available there makes it easier to use intelisense
                
                
                
                
             
         
        
            
            
            
                
                Remove excess protos on train engine
                
                
                
                
             
         
        
            
            
            
                
                SyncVars (by default) will require a value to be changed before syncing over the network. Turning this off will sync everytime its changed, not every unique change.
                
                
                
                
             
         
        
            
            
            
                
                Fix some logic errors in train sync vars
                
                
                
                
             
         
        
        
            
            
            
                
                Try to ensure editor weaving process isn't running on build
                
                
                
                
             
         
        
            
            
            
                
                Try and skip setter injection on the client by checking the subtarget
                
                
                
                
             
         
        
        
            
            
            
                
                Ensure build looks in the correct path
                
                
                
                
             
         
        
            
            
            
                
                Call patch assembly anytime scripts reload
                
                
                
                
             
         
        
        
            
            
            
                
                Only generate symbols if pdb exists
Wrap inside of setter in if server block
                
                
                
                
             
         
        
            
            
            
                
                Ensure SyncVars run first in the build process.
Don't create a lock on Rust.Global.dll
                
                
                
                
             
         
        
            
            
            
                
                Ensure injector errors when it cant find sync method (dont bother throwing)
                
                
                
                
             
         
        
            
            
            
                
                Safeguards for client weaving process (dont try to hook setter at at all)
                
                
                
                
             
         
        
            
            
            
                
                Fixed autosave/autoload not using preprocessor directives
                
                
                
                
             
         
        
            
            
            
                
                Fixed Changed event being ran on autoload
                
                
                
                
             
         
        
            
            
            
                
                Convert train line up to unload and train num connected cars to syncvars
                
                
                
                
             
         
        
            
            
            
                
                Set GenerateEvent default to true
                
                
                
                
             
         
        
            
            
            
                
                Use a wrapper method instead of emitting equality comparitor in IL - it was ugly at best
                
                
                
                
             
         
        
            
            
            
                
                Add support for RequireChanged flag - this runs the old and new values through an equality comparison before pushing sync.
                
                
                
                
             
         
        
            
            
            
                
                Swapped train engine fuel amount over to use SyncVars instead of protobufs.
First set of testing.
                
                
                
                
             
         
        
            
            
            
                
                Use an autosave buffer as an intermediary when writing to syncvar bytes
Prevents byte allocations every autosave
                
                
                
                
             
         
        
            
            
            
                
                Add Autosave system. SyncVars marked as Autosave will automatically be injected into Save/Load methods so no need to write protobufs.
                
                
                
                
             
         
        
            
            
            
                
                Updated source generator to support event generation.
Ensured our attribute matches this
More tests in the legacy shelter
                
                
                
                
             
         
        
            
            
            
                
                Better weaver symbol logic (to prepare for being built)
Downgraded code analysis to 3.8 so it doesnt explode hot reload
                
                
                
                
             
         
        
            
            
            
                
                Safer SyncVar Implementation:
Rosyln Source Generator creates: Weaver ID table (managed to make it free), read, write methods and backing fields.
Run Weaving step based on the result of source generator, only bother hooking setter IL to run code created during the source generator phase
Add source generator dependencies
                
                
                
                
             
         
        
        
        
        
            
            
            
                
                Fix strings not parsing correctly in the receive code. Net read strings take an argument (needs to be supported on our end)
                
                
                
                
             
         
        
            
            
            
                
                Properly handle error messages
Display more information when something goes wrong
Show postive/negative error logs as green and red
                
                
                
                
             
         
        
            
            
            
                
                First set of code cleanup on the new weaving solution
Split everything off into smaller areas
Injection simplification
Seperate build/editor dependency logic
                
                
                
                
             
         
        
            
            
            
                
                SyncVars fully working with weaving.
Fixed incorrect stack for WriteSyncVar.
                
                
                
                
             
         
        
            
            
            
                
                Fix malformed WriteSyncVar
Setter plumbed up to the correct entry logic for queueing/sending SyncVars