519 Commits over 1,461 Days - 0.01cph!
Protocol++, remove logs I left in accidentally
RPCs and Sync Var Support for GameObjectSystems
Fix hostname changing back to default after map change
Some refactoring, use SnapshotState to store last received snapshot - only updating from the ack if snapshot id is newer than the last one
Batch network spawn messages when cloning / network spawning an object so that references to/from child networked objects are kept intact when spawning on the receiving end
Added VoiceComponent.ShouldHearVoice( Connection ) - to change whether a voice can be heard on the receiving end
Fixed a bug where the parent network object could be destroyed when doing a network refresh if there were children to prune (Fixes Facepunch/sbox-issues#7812)
Game.Close will no longer NRE when called from Dedicated Server - will exit the whole application instead (Fixes Facepunch/sbox-issues#7781)
Use target local for delta snapshot transform and when reconstructing on the other side
Update messages sent and messages received on connection for dedicated server as well
Pass recipient SteamId from native to managed OnSessionFailed. Update debug log to show that connection if we can find it, or just log the steam id if we can't
Get MessagesReceived working for Connections so it displays in status properly - to help debug an issue
Connection.Ping is in milliseconds
Log instead of disconnect on invalid session for now for debugging
Separate slots for Pos,Rot,Scale
Make sure when sending snapshot before owner change that its a full one not a partial one
Add channel / connection state to status ConCmd output
Fixed a rare scenario where it was possible to store a last received snapshot that may never have been actually received
Ensure we only process snapshot clusters if the sending connection has control / owns the object. Update refresh message snapshot id check to use latest logic.
Update SnapshotState check for newer incoming snapshot packet to properly handle wraparound on snapshot id
Server/Lobby Data, Hostname / ServerName Changes, etc (#1827)
Exposes:
* Networking.ServerName
* Networking.MapName
* Networking.SetData
* Networking.GetData
Log a warning instead of throwing an exception when trying to send an RPC without being connected to a network session - it's harmless anyway and could happen with async tasks even after disconnecting
Track object messages and RPC stats and display the top 10 in the top left when net_debug is enabled
Connection.GetUserData will now work for any client - not just the host. ConVars marked with ConVarFlags.UserInfo will update for all clients when changed. Updated ConnectionInfo string table to store values individually so when one changes it doesn't send the whole lot again.
We can now include ping in the string table so that Connection.Ping should be correct even if you aren't the host
Show progress (#/#) when downloading files in loading screen
Shut down properly before reconnecting - ensure we've destroyed the scene etc
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