488 Commits over 1,433 Days - 0.01cph!
Lower snapshot cluster size and use smaller types for their ids
Improve delta snapshot system by dynamically increasing and reducing stored sent snapshot cluster size to ensure we give ample time for an ack - these could get lost of we send a lot of clusters per second. Another improvement is to predict last receive snapshot data and assume they will go through, optimizing by not sending the same value 50 times a second - if not ACK'd in time, we'll clear the prediction and send again. I'm seeing good results on TTT where the host goes from sending 1mb/s to ~18-30kb/s with one connected client in some cases.
Add SteamEnums.RecvMaxMessageSize and SteamEnums.RecvBufferMessages. Set these values in bootstrap to higher values.
Network options on a GameObject where the GameObject is a prefab instance will only be serialized if the values differ from the prefabs. When loading a prefab instance as a GameObject from a Hammer scene, find the correct network mode. This fixes an issue where if a prefab is added via Hammer, but later the prefab's network mode or something changes, the new default wouldn't be used when loading the map. It'll still use the one the map was serialized with.
Make use of the return type of Scene.Load and return false if SceneLoadOptions has no valid scene set
Fixed issue with calling RPCs from within RPCs when using HostOnly / permissions and Caller not being set correctly. Fixes Facepunch/sbox-issues#7452
Fixed previous Show Hitbox Debug displaying BBox hitboxes in the wrong place
Added Show Hitbox Debug option in Debugging Menu in the editor. debug_hitbox ConVar. Can debug hitboxes in the editor or in-game similar to Show Interpolation Debug. Fixes Facepunch/sbox-issues#7505
Fixed Show Interpolation Debug not being able to be toggled in the UI. If a ConVar value is a boolean, use its integer form. Fixes Facepunch/sbox-issues#7503
Added Object property to WrappedMethod<T> (Fixes Facepunch/sbox-issues#7497)
Fixed network info being incorrect / unset in OnNetworkSpawn callbacks because _net is not set yet. Fixes (Facepunch/sbox-issues#6447)
SyncFlags.Interpolate (#1789)
Double max string table snapshot entry size from 4mb to 8mb (Fixes Facepunch/sbox-issues#7250)
Fixed an issue where performing a network refresh might not synchronize the tags with the owner's version of the object. Fixes Facepunch/sbox-issues#7301
Fixed an instance where an editor lobby could be public even when it's set to private in the editor. This could have happened if CreateLobby was called with Privacy = LobbyPrivacy.Public - now the editor option will dictate the privacy of all editor lobbies.
Add Simulate Packet Loss alongside Simulate Lag in editor network options - it's working for simulating outgoing lost packets from the host right now
Some tidy up - data table ReadFilter instead of other method, reset delta snapshot cache on owner change and after network refresh is received
Added net_fakepacketloss ConVar for testing (0-100%). Fixed an issue where if a delta snapshot was received before an object was created on the client-side, it would remember the state wrongly. Fixed an issue with Network Refresh messages where, if arriving late, could overwrite Sync Vars with the wrong values
Improvements to how delta snapshots are stored. Make sure we apply all snapshots so long as the last processed value for an entry has an older snapshot id.
Fixed an issue where FromHost sync vars could get stomped. Optimized delta snapshot updates - we no longer need to even try to process networked objects we don't own. Fixes Facepunch/sbox-issues#7261
Fixed a bug where calling GameObject.GetPrefab could network spawn game objects. Never network spawn game objects if its scene is a PrefabScene.
Merge branch 'master' of sbox
Don't try to auto-switch hosts if LobbyConfig.DestroyWhenHostLeaves is true. If that's true, we should only ever have the same host..
Automatically hotload user permissions if users.json is edited while the server is running - can change or add permissions without restarting the server
User perms config
Allow Json comments
Add default users.json file and change structure of config
Don't ignore game/config/users.json because we want to keep the default with comments
Return true in Connection.HasPermission if the connection is the host. We'll check user permissions from the config file for connections to a dedicated server.
Remove some test logs and make HasPermission available
LobbyConfig.HideInServerList would let you hide a lobby from appearing in any server lists in s&box but still queryable with QueryLobbies
Fix IsHidden support
Filter in the query
HideInServerList -> Hidden
Do the same when setting var
Additional cmd line fix and extra test
Improve CommandLine parser. Added CommandLineTest.
Delta snapshot improvements. Fixed a bug where it was possible for a snapshot ack to be ignored - should fix a rare and difficult to reproduce bug where sync vars can become stuck
When running commands from command line, enclose args in quotes so they aren't split again by spaces internally (Fixes Facepunch/sbox-issues#7388)
No need to log that we can't find sound event if we're headless - we won't be playing any sounds anyway
Keep dedicated server alive when reloading a game. Allow managed to decide if a connection should be accepted. Improve auto-retry.
Added net_dump_objects command to print all networked object names to console
Hide a dedicated server from the server list when disconnecting - re-enable it when a lobby is created again
SendLog on a local connection should just log the message - no need to send a network message
SendLog on a local connection should just log the message - no need to send a network message
Fix error with NetworkMode read in MapInstance. If network mode is Object then we want to NetworkSpawn the object here - this fixes networked objects from maps not appearing for clients
Server Commands / Admin Commands (#1772)
* ConVarFlags.Server and ConVarFlags.Admin and the implementation of both. When the method has a Connection type as the first parameter, that parameter will be the source. Add Connection.SendLog( LogLevel, string )
* Safety
* Add summaries
Don't send networked objects twice when the host switches scenes
Fixed a bug with the [Change] attribute not using the correct type in some cases - make sure we always use the type that the property belongs to
Start the networking thread
Move process of parsing command line switches on boot and setting ConVars and ConCmds from them from native to managed. Control when they are set / run ourselves, we'll do it in Bootstrap.Init.
Improve networked scene changing by simplifying it and no longer reusing the handshake process
Always prefer explicitly set hostname for server name when running a dedicated server
Host Stats / Local Network Stats in Console (#1758)
Increase reasonable Steam connection time for dedicated server - ensure it shuts down properly if it doesn't connect in that time frame