userConnacancel
branchsbox/mastercancel

438 Commits over 1,371 Days - 0.01cph!

9 Months Ago
Fix failing test, use float.PositiveInfinity not -1
9 Months Ago
NetList implements IList, IList<T> NetDictionary implements IDictionary, IDictionary<TKey,TValue>
9 Months Ago
Avoid collection modified error in NetworkPrune (Fixes Facepunch/sbox-issues#5280)
9 Months Ago
Temp comment out this line to fix tests
9 Months Ago
Object Snapshot Refresh (#1500) * Initial commit * Component id + prune those for refresh as well * Serialize id properly * OnRefresh * Fix refresh for bones * Revert comp ids on this branch * Use Id not __id as that is what was settled with for Component Ids * When a component is added to a GameObject after it has been network spawned, and it has Sync vars we should register them with the network table * Don't do on the root though save that for the multi-comp PR * Include latest table snapshot with full refresh. Update to support __guid * Undo this bit * Added Connection.CanRefreshObjects permission (def: true) * Add checks for CanRefreshObjects to Network.Refresh() and when OnObjectRefresh is called * Register properties recursively when sending network refresh or receiving one * Test to re-register Sync props after Network.Refresh * Make docs clearer * If a Component isn't valid then just set the property anyway for a Sync var * By default, clients (except host) can NOT refresh network objects. Host can change this with Connection.CanRefreshObjects * Some additional validation checks * Better logic * Fix issue with nested types not having correct identity hash for wrapped property codegen
9 Months Ago
Multi-Component Sync Vars + Sync Vars in Children (#1503) * Support for multiple components of the same type on a Network Object to have sync vars. Adding support for children of a network object that aren't themselves network objects to have components with Sync vars too * Register and unregister Sync properties for child gos/comps appropriately * It goes here * Also unregister/register sync properties accordingly when GameObject id changes * NetworkMode can't be changed from NetworkMode.Object if we are actually a networked object (_net is valid) * Simplify a bunch - allow setting property if slot not registered * Remove unused UnregisterProperties methods * Add a test to make sure child sync vars are added to network table * Suppress these warnings for now - there are legitimate reasons why we might not find these GOs * Suppress unknown slot
9 Months Ago
Authority RPC now correctly uses invoke permissions from the AuthorityAttribute. When calling Authority RPC, if there's no owner, the target would be the host connection
9 Months Ago
Authority check for network destroy - can never arbitrarily destroy unnetworked objects
9 Months Ago
In the PrefabFile upgrader, upgrade Id to __guid as well if possible, fixes corrupt prefabs from before when it was called Id
9 Months Ago
Fixes unable to parse guid error when trying to load properties called "id" but the type is not a guid (Fixes Facepunch/sbox-issues#5181)
9 Months Ago
When a component is added to a GameObject after it has been network spawned, and it has Sync vars we should register them with the network table Don't do on the root though save that for the multi-comp PR
9 Months Ago
Update SceneEditorMenus to use MakeIdGuidsUnique instead of MakeGameObjectsUnique
9 Months Ago
Unforseen but when we link component reference from a prefab to property on something else in scene, we should still store component reference like we used to. We'll try to find the component in the scene directory by id if we can, but revert to old behavior if not
9 Months Ago
Put in guards against people having a property name of "id" (case-insensitive) on a component. Warn them if they do, don't serialize that property or try to deserialize it. Catch exception if trying to deserialize Id as a Guid but it isn't one.
9 Months Ago
Component Ids (#1501) * Component id + prune those for refresh as well * Serialize id properly * Add unit tests for component id serialization / deserialization - make sure references to Components with Property are properly restored to the correct components by id * Update GameObjectInspector to use Component.Id to determine already seen components. This makes it rebuild properly for multiple components of the same type * Serialize as Id not __id so also picked up by MakeGameObjectsUnique * Scene unique component ids - update serialization test accordingly * Phase out storing GO guid and component type * MakeGameObjectsUnique -> MakeIdGuidsUnique (make old method Obsolete and redirect to MakeIdGuidsUnique) * Unit test for clone with references * When adding component or game object to Directory - check is there a component or game object with that id already, if so, force change it to a new one and spit a warning out. No component or game object should ever be able to share the same guid anyway but this makes sure * Add test for loading old reference model type from prefab / json * Test both old and new formats * Let's not make this elseif - always check both
9 Months Ago
Allow both Sync and HostSync on a property. It means that both the Owner and the Host can control the value. Fixes Facepunch/sbox-issues#5153
10 Months Ago
OnDestroyInternal should be internal
10 Months Ago
Game Object Network Mode Selection https://files.facepunch.com/conna/1b0711b1/sbox-dev_G97N4pdA3q.png (#1495)
10 Months Ago
Fixes local interpolation jitter
10 Months Ago
Fixed a boo boo
10 Months Ago
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
10 Months Ago
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.
10 Months Ago
Interpolation Fixes w/ Ownership Change (#1494) 🤞
10 Months Ago
Finally fixes Facepunch/sbox-issues#4716 - reloading Map Instance when recompiled in Hammer
10 Months Ago
Add support for expression bodied methods for CodeGen. Fixes Facepunch/sbox-issues#5025 Add test for expression bodied CodeGen method
10 Months Ago
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
10 Months Ago
Host can always drop ownership of a networked object Host can always network destroy a networked object
10 Months Ago
Fixed [Sync] vars on private properties in base classes not being registered. What a strange one! Fixes Facepunch/sbox-issues#4916
10 Months Ago
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
10 Months Ago
Fixed Sync vars on derived component types not working
10 Months Ago
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
10 Months Ago
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
10 Months Ago
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
10 Months Ago
Clear watcher var after dispose
10 Months Ago
Fix tests
10 Months Ago
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.
10 Months Ago
Change mount logic in OnPostCompileFinished, call SceneMap.OnMapUpdated regardless. Make async and add short delays
10 Months Ago
Fixed FileSystem.NormalizeFilename changing \ to // in paths instead of to /. This fixes hotloading of .scss files in regular razor Panel (PanelComponent was fine)
11 Months Ago
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
11 Months Ago
Use EverythingInSelfAndDescendants when finding INetworkSpawn components
11 Months Ago
Update pull.yml
11 Months Ago
Do the same for 2D skybox
11 Months Ago
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
11 Months Ago
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
11 Months Ago
Be able to get object from CodeGen wrapped prop/method
11 Months Ago
Add GameObject.NetworkSpawn, obsolete Network.Spawn (redirect)
11 Months Ago
Fix issues with loading compiled resource json in editor space
11 Months Ago
Fix documentation
11 Months Ago
Load/reload prefabs with SmallNetworkFiles. Read compiled json with c# fs instead of using native (#1440)
11 Months Ago
Add IsValidType and use that for now instead of IsValueType on the property. Support using `string` for Sync