346 Commits over 1,218 Days - 0.01cph!
Prefab instances must be updated to have at least the tags specified in their prefab (Fixes Facepunch/sbox-issues#5729)
Fixed not being able to edit these advanced networking settings in prefab editor - working around NetworkAccessor ref struct
Let's remove these exceptions - let us try to call RPCs on components that don't have a networked object root, as long as a GO and Component exists on the other end with those ids, we should allow it
Initial commit
Call flush here
Don't set to connected until Activate
Undo that
Flush for source here too
Only queue messages after Snapshot (otherwise ignore) and send when Connected. Add new docs to broadcast
By default queuedUntilState is null
Remove debug logs
Use new ByteStream( data ) instead of create w/ length then write
Optimization to remove queues when no longer required (cheers Ziks)
Remove BytePack.ISerializer from Connection for now - need to solve something first
BytePack.ISerializer implementation for Connection. Also make sure we clear Connection._mockConnections on ResetEnvironment because I think this dictionary would never clear otherwise. Remove long-time unused net_lerptime ConVar.
Byte Pack Convert - Networked GameObject, Component, GameResource References (#1618)
* Add add IBytePackConvert to a class to specify how it should be serialized/deserialized with BytePack (similar to IJsonConvert). Implement for GameObject.
* Add IBytePackConvert support to Component and GameResource
* We should be able to null these out
* Some comments on ConverterPacker to describe its use
* Let's move it out of Sandbox and call it BytePack.ISerializer - it won't be exposed to public API (for now?)
* Makes sense to rename to SerializerPacker so it matches ISerializer
* Explicit implementations of BytePackRead and BytePackWrite means we can have these non-public
* Add test for BytePack.ISerializer with MySerializedClass
* Some minor doc change
* Tidy
Only serialize NetworkMode, NetworkInterpolation, NetworkOrphaned and OwnerTransfer in GameObject.Serialize if they are not their default values
Fixed static Authority RPC checking permissions against the wrong attribute and messages should be sent to the host and not broadcast
Check index is >= 0 or <= Count when using ObservableCollection<T>.Insert in NetList - otherwise use Add instead
Inspector Advanced Network Settings (#1617)
* Start adding support to edit Network Orphaned and Owner Transfer options in Inspector (visible when Network Mode is set to Object) https://files.facepunch.com/conna/1b0311b1/sbox-dev_I7Fk7tfs6K.png
* Make sure NetworkOrphaned and OwnerTransfer modes get serialized / deserialized
* Move over to setting NetworkOrphaned/OwnerTransfer on the GameObject directly (with multi-select)
* Move out to its own widget - this is gonna be a button that drops down for advanced network settings
* Adv network settings button next to Network Mode in inspector - opens drop down menu to set net orphaned mode / owner transfer mode
* Store current val outside scope
* Modify style
* Add RadioSelect widget for use with advanced network settings as it makes sense ( https://files.facepunch.com/conna/1b0911b1/sbox-dev_Ej9Kk8WU3y.mp4 )
* Disable the option to open the menu if NetworkMode is not Object - no point allowing to change these settings for objects that arent networked
Ensure we properly network ownership changes during network orphaned actions
Keep project loading stuff together and make sure we load initial collision rules after project settings file system is mounted (Fixes Facepunch/sbox-issues#5739)
Closes Facepunch/sbox-issues#5566
Throw exception when sending RPC on non-networked Game Objects (Closes Facepunch/sbox-issues#5504)
Fixed potential NRE in AudioListener component when scene camera isn't valid (yet)
Fix overlapping Reset to Default on ControlSheet with Reset Transform context menu. Add individual reset Position/Scale/Rotation on Transform context menu (Fixes Facepunch/sbox-issues#4867)
Fix issue with new local instance on "local" package to do with small network files
Remove from interpolation system on GameObject destroy
Call TransformChanged() once again in InterpolateFixedUpdate
Clear pending updates in SceneNetworkUpdate too
Make sure we use TargetLocal in any transform changed callbacks called from within interpolation phase to fix physics bodies using wrong values. Add internal InterpolationWorld getter in GameTransform and use that in ModelRenderer OnTransformChanged for updating scene object position (fixes broken interp.)
PhysicsWorld.CollisionRules Refactor - Project Settings Small Network Files Support (#1604)
* Add PhysicsWorld.CollisionRules getter. Delete ServerConfig. Update collision rules json on world if hash changes before physics step. Project Settings (.config) are networked via Small Network Files - can react to changes
* Do GetHashCode this way
* Initialize CollisionRules
* Handle small network files from different file systems this way?
* Fix
* Fix documentation
* Reset config files
* Kind of genericize SmallNetworkFiles - push / add / remove files from it externally - mount its MemoryFileSystem externally as well to desired file system
* Fix - but obviously it can't be done this way it's absolutely awful
* Add all files from network when mounting on client side
* Method name update
* Remove some duplication
* Cleanup
* Fix inverted condition
* Unnecessary arg
* ToHashCode
* ReadWithFallback will return new T() if package is null too
* Store CollisionRules from Project Settings in ProjectSettings static class - update it when project settings change. Physics worlds using this reference should update automatically
* Call ProjectSettings.Reset in ResetEnvironment
* Clean up
* Swap these
When deserializing a GameObject create components in a try/catch and log an error if it fails. If no component could be created, add a missing component. Fixes not being able to open a prefab if there's an error in the constructor of a component. Closes Facepunch/sbox-issues#4397
Add Package.FileSize (MB) ( Closes Facepunch/sbox-issues#4908 )
Ignore packets from non-host until we're fully connected ( Fixes Facepunch/sbox-issues#1595 )
When calling NetworkSpawn we break from prefabs in all of our ancestors ( Fixes Facepunch/sbox-issues#5046 )
Add Priority to CodeGeneratorAttribute - allows you to specify priority. Higher priority means the target method/property is wrapped first.
Check valid scene in SceneNetworkSystem message handlers
Don't interpolate when setting local transform within fixed update if the GameObject isn't enabled. Fixes trying to interpolate to initial position when cloning GameObjects in fixed update, but really we need a way to say "was the game object created this frame" and if it was then don't interpolate.
Clear interpolation properly and don't apply new interpolation if transform update received over network with clear interpolation flag
Another minor fix
Flush network updates before send RPCs (#1594)
* Flush network updates before send RPCs
* Keep track of potential pending network updates to flush for RPCs
* Make sure to unregister for update after sending
* Add some documentation
Simplify InterpolationBuffer a little bit (internal API)
Disable interpolation during certain initialization callbacks for components
Fix transform update delay when Skinned Model Renderer is attached to bone of another Skinned Model Renderer (#1578)
* Fix lag/wobbly update when Skinned Model Renderer is attached to bone of another Skinned Model Renderer
* Use Channel to contain changed transforms, write to that in threads for animation updates, then call transform changed on main thread for them after
Query game package MaxPlayers when creating a lobby
Initiailize target local with Transform.Zero. SceneUtility.GetPrefabScene never actually saves the cached scene to the var. ( Fixes Facepunch/sbox-issues#5511 )
Independently Interpolated Transform Parts + Other Fixes (#1577)
Silently term any new children created from children's OnDestroy when clearing scene. Fixes Facepunch/sbox-issues#4855
Wrapped method resume will get async keyword when wrapped method has it
Fixes to restore some old and intended behavior, additional documentation
This shiz is confusing - try this
When copying and pasting GameObjects in the editor - use the world transform instead of the local transform ( Fixes Facepunch/sbox-issues#4514 )
Shapshot -> Snapshot in loading screen ( Fixes Facepunch/sbox-issues#5439 ) 😂
Some clearer documentation
Interpolation v2 (#1516)
* Test
* Clean up - use TransformInterpolate class
* Can't modify transform if we're a network object root and a proxy - we must stay true to network transform target
* Hook up Interpolation enable/disable from Inspector. When Owner calls ClearInterpolation, set a bit on the update msg to have other clients do so as well. Hook up Network.Interpolation and Enable/DisableInterpolation() on the accessor.
* Fix to allow interp property to be set by GameObjectHeader
* Serialize the interpolation bool with GameObject
* Combination of fixed update interpolator and networked interpolation buffer. Working nicely
* Some cleanup
* Some extra docs + let's call it Query to match the other class
* Use Time.Now
* Restore backward compat LerpTo
* Cull after, ensure move direct to last tx if query out of time but entries remaining
* Fix formatting
* Tiny tidyup
* Add InterpolationSystem (GameObjectSystem) - update GameTransform to Add/Remove GameObjects from this system as appropriate
* Actually enable it
* Add new Interpolation stage - the updates need to happen at the right point. Clear interpolation if interpolation isn't enabled and we receive a transform update
RPC Filter (#1549)
* Update documentation
* Add recipient filter struct, type, and Rpc.FilterOnly and Rpc.AllExcept methods
* Update documentation
* Change filtertype options
* Move to Connection.Filter. Can pass optional filter to Broadcast. Use this for Rpcs with current filter.
* More docs
* Same logic for static Rpcs
* Add single Connection overloads
* this can be made private
* Fix ambigious docs
* Inverse logic (doh!)
* Use hasvalue etc
* Some fixes
* Remove duplicate docs
* Better docs
* RPC in log for consistency
* Add overloads for filtering RPC recipients based on a predicate
* FilterOnly -> FilterInclude. AllExcept -> FilterExclude. Only one RPC filter can be active at any time
* Add Rpc.Resume. This handles disabling and restoring filter if the Rpc.Caller is us before and after resuming. Use this everywhere.
* Restore the old filter here even if e.Resume() throws
* Early out / cut nesting
* Tidy up