522 Commits over 1,461 Days - 0.01cph!
OnDestroyInternal should be internal
Game Object Network Mode Selection https://files.facepunch.com/conna/1b0711b1/sbox-dev_G97N4pdA3q.png (#1495)
Fixes local interpolation jitter
ComponentFlags.NotNetworked. When a component has this flag, it won't be serialized in the scene snapshot or with a networked object when sent to other clients
Don't EditLog if we're not in the Editor. EditLog separate from BreakFromPrefab because we don't wanna do that just because we're spawning a networked object in a running scene.
Interpolation Fixes w/ Ownership Change (#1494)
🤞
Finally fixes Facepunch/sbox-issues#4716 - reloading Map Instance when recompiled in Hammer
Add support for expression bodied methods for CodeGen. Fixes Facepunch/sbox-issues#5025
Add test for expression bodied CodeGen method
When joing via new instance, Project.Current is null - this can break <style> because it can't get relative path of current file. Fix that by just using absolute path in that case.
Remove unnecessary assert
Host can always drop ownership of a networked object
Host can always network destroy a networked object
Fixed [Sync] vars on private properties in base classes not being registered. What a strange one! Fixes Facepunch/sbox-issues#4916
Determine fate of network objects when owner disconnects (#1463)
* Can specify what happens to a network object when owner disconnects - don't love the naming
* Unused usings
* Some cleanup
* DisconnectAction -> NetworkOrphaned. Same terms everywhere else. Add NetworkOrphaned.Random - randomly assign owner when owner disconnects - route this through the host though
Fixed Sync vars on derived component types not working
Host Sync Vars (#1462)
* NetworkTable.Entry.HasControl test. Separate sending network table changes from main update. Host or Owner can send table changes (only send entries they _control_)
* When using WriteAll always write all regardless of control. Make it so unless YOU control a Sync property you can't physically change its value
* Revert that for now - let people change Sync var value locally as it was before, we can try to find a better way to prevent this later. Complication comes from INetworkCustom
* Remove redundant call
* Let''s have each entry define if it has changes now that each one can be potentially controlled by different clients. Make sure we clear changed flag on entry when reading it. NetworkTable.HasChanges will now return true if any entry we have control over is dirty
* Clarify comment
* Let's call it HostSync
* Prevent actual setting of Sync property, modification of NetList, or NetDictionary if you don't have control over it. Non-owner, non-host can't change the values locally, they _must_ be what the synchronized value is
* We can always set the property if network not initialized
* Default HasControl to true for NetList/NetDictionary in-case not set
Network Authority / Permissions (#1457)
* Can a connection create objects?
* Send network destroy even if DestroyImmediate is called
* Ownership authority flags
* Let GameObject have [Sync] too (test)
* Reorder enum, add [Expose]
* Change up logic for can create objects - only check if we have a source
* Default CanCreateObjects to true for now (this is current behavior)
* Initial implementatior for ownership authority
* Use NetworkAccessor for changing ownership authority. (Temp? Depending on review) don't use TL for set prop for Sync Vars
* Initial implementation of Rpc authority
* Remove a test log
* CodeGen static array for attributes on a CodeGenerator method/prop now marked as [SkipHotload] and readonly, so they do update when changed
* Make it CanSpawnObjects
* CanSpawnObjects settable only by the host
* Some renaming. Set OwnerTransfer direct on GameObject instead of method on NetworkAccessor
* Make sure CanSpawnObjects is synchronized to clients when set from host via ConnectionInfo
* Default CanSpawnObjects to true for now
* When OwnerTransfer is Request, make actual requests to the host for Drop/Assign/Take ownership and if host approves, then host will send the messages to everyone to take that action. Each message will then validate if was received from host
* Remove this for now, sus is later
* CanSpawnObjects is always true for the host. Early out in NetworkSpawn if local connection can't spawn objects - why bother trying at all?
* NetworkAccessor.SetOwnerTransfer method
* Documentation fixes
* Rename Rpc.HasAuthority to Rpc.HasPermission for consistency
* Owner can always drop ownership
* Allow owner transfer changing from current owner
Copy tags from GameObject for Legacy Particle System -> SceneObject
In ParticleSpriteRenderer make sure we copy over tags from the GameObject to the SceneObject
Internal ReadOnlyTagSet
Parse kv tags into ObjectEntry.Tags and use them in SceneMapLoader to set any created sceneobject tags
Copy tags from SceneObjects to MapObjectComponent GameObject
Add some default tag from Hammer, light, text, particles
Fix NRE
Set some default tags for Particle and Light and Skybox components
Better light tags
Clear watcher var after dispose
Fixes Facepunch/sbox-issues#4725 - Fixes a bunch of issues with SCSS hotloading. Style sheets weren't actually being removed when deleted or changed. Clear previously loaded style sheets properly on hotload. Properly update when stylesheet is added after it had tried to be loaded before.
Change mount logic in OnPostCompileFinished, call SceneMap.OnMapUpdated regardless. Make async and add short delays
Fixed FileSystem.NormalizeFilename changing \ to // in paths instead of to /. This fixes hotloading of .scss files in regular razor Panel (PanelComponent was fine)
NetList, NetDictionary (#1447)
* Initial commit
* Make NetworkTableContainer into an internal interface INetworkTableContainer. Use explicit interface implemention to keep members from being exposed to public API.
* Add some exception handling
* Let the INetworkTableContainer handle writing/reading whether it's only changes or a full update
* Backwards compatibility for IList and IDictionary but it isn't ideal so throw a warning to use NetList and NetDictionary
* Fix some documentation. Add ExchangeNetList test. When new instance of NetDictionary or NetList is created, add Reset change immediately. We want clients to know it's completely changed.
* Add appropriate unit tests
* Fix for hashcode
* INetworkCustom. Add tests for NetList, NetDictionary.
* Add example usage
* Better formatting
Use EverythingInSelfAndDescendants when finding INetworkSpawn components
Do the same for 2D skybox
Add Skybox support to Render Tags - good for View Model Camera where we don't wanna render the skybox, or usually anything but things with a viewmodel tag
In ByteStream.Read/WriteValueArray, use Enum.GetUnderlyingType when using Marshal.SizeOf if the type is an Enum type. This is because Marshal.SizeOf will error when used with Enum types directly. Fixes Facepunch/sbox-issues#4579
Be able to get object from CodeGen wrapped prop/method
Add GameObject.NetworkSpawn, obsolete Network.Spawn (redirect)
Fix issues with loading compiled resource json in editor space
Load/reload prefabs with SmallNetworkFiles. Read compiled json with c# fs instead of using native (#1440)
Add IsValidType and use that for now instead of IsValueType on the property. Support using `string` for Sync
StyleSheet String Table (#1437)
* Initial commit
* Make it better
* Clear entries in StringTable.Reset
* Remove unused method
* Remove unused using statement
* .scss and .prefab both valid small network files
* Send .prefab_c instead of .prefab
Remove CreateWrappedMethod bs. Have VoiceComponent use [Broadcast] now. Remove manual RPC stuff from GameObject.Network.
Can mark these internal RPC methods as [Expose] now and make them private, remove old comments saying why they needed to be protected
Trace.RunAll Support (#1434)
* Initial commit
* Returns IEnumerable, order by Fraction
* Fixed return type on public method
WrappedPropertySet/Get also have Attributes defined. Two methods with the same name but different signatures will now have unique static attribute list. Fixed attribute constructor issues for backing static attributes.
Added Networked Properties
https://docs.facepunch.com/s/sbox-dev/doc/sync-properties-jKFHwTGVgR
When a map is re-compiled from Hammer reload any MapInstance components to reflect the changes
Fix TakeOwnership RPC not working
In OnTargetedMessage if the TargetId is Guid.Empty, assume it's for us (this may happen if we're using OwnerId as the Target, but the "owner" is the host)
Fix NRE when calling [Authority] RPC but authority is the host
OnTagsChannged -> OnTagsChanged
Fix [Broadcast] requiring `using System;` statement in file
Squashed commit of the following:
commit 04050373a0633a5122791133885299c358f4b0eb
Merge: 577fcd3fec 2fd2d4d278
Author: kurozael <kurozael@gmail.com>
Date: Wed Dec 6 13:32:00 2023 +0000
Merge branch 'master' into codegen-struct-arg
commit 577fcd3fec861bb7f6cbde51621bbcd1558f2ff3
Author: kurozael <kurozael@gmail.com>
Date: Wed Dec 6 07:39:32 2023 +0000
Update CodeGenerator unit tests for new stuff
commit 64f62b40059c7d3ba16a373a1420401f6d79e2a6
Author: kurozael <kurozael@gmail.com>
Date: Tue Dec 5 15:57:11 2023 +0000
Readonly ref for Wrapped structs. Store Identity on MemberDescription. virtual method for generating identity hash, override it for MethodDescription... store global lookup for member idents. Add TypeLibrary.GetMemberByIdent. Clear members for types when assembly removed
commit 6c14f5b5784fb490e2a73c49a987df8087c8f4e6
Author: kurozael <kurozael@gmail.com>
Date: Tue Dec 5 15:24:45 2023 +0000
Added typeparam docs for T in WrappedPropertySet/Get and WrappedMethod
commit b9dbf0592cee5b4ae091670b592ace183722fb5b
Author: kurozael <kurozael@gmail.com>
Date: Tue Dec 5 15:21:17 2023 +0000
Typo
commit 52253bee1e373d09adc7be59b3e8669f93cb1caf
Author: kurozael <kurozael@gmail.com>
Date: Tue Dec 5 15:20:26 2023 +0000
Unused params
commit 0ff3451a31caa63537c9559e0bc59243352f8c3e
Author: kurozael <kurozael@gmail.com>
Date: Tue Dec 5 15:09:40 2023 +0000
Add TypeDescription.GetMethodByIdent, fix array param types not matching from codegen + methoddescription hash
commit e251f3fc500252431683c9a36de704cdfe8cc298
Author: kurozael <kurozael@gmail.com>
Date: Tue Dec 5 10:38:36 2023 +0000
Add support for codegen to pass methodidentity in struct, and split typename from methodname and add IsStatic as well to help differentiate properly
commit 55c6710de87bb61c1eb7e141a4bc8961b67cfcc1
Author: kurozael <kurozael@gmail.com>
Date: Tue Dec 5 10:37:43 2023 +0000
MethodDescription.Identity built from return type, name, params but not fully qualified rn as hard to correlate with results from ITypeSymbol in codegen
commit 7b0d25a70a0f8ee7afac0252c6dcf0338582e0db
Author: kurozael <kurozael@gmail.com>
Date: Mon Dec 4 13:30:18 2023 +0000
Initial commit / struct names not finalized
Update rpc and MakeDirtyAttribute callbacks to use new codegen structs. Authority rpcs and static rpc support
Assets for createwrappedmethod
These methods will need to be protected (comment with why)
Disable 2 more tests that will be broken right now
Disable tests testing against package.facepunch.platformer.dll and package.facepunch.sandbox.dll for now
Disable test for package.facepunch.sandbox.dll Should_Pass