4,710 Commits over 1,341 Days - 0.15cph!
AcceptConnection and Kick Support (#1698)
* Added INetworkListener.AcceptConnection( Connection, ref string reason ) and Connection.Kick( string reason )
* Added the kick command (can only be used by the host.)
Added the kick command (can only be used by the host.)
Added INetworkListener.AcceptConnection( Connection, ref string reason ) and Connection.Kick( string reason )
Lobby Config / Friends Only Lobbies (#1696)
* Can optionally pass LobbyConfig to CreateLobby. Right now only contains LobbyPrivacy. Add LobbyPrivacy.FriendsOnly.
* Separate overload as not to mess with any existing game packages
* Make old CreateLobby method obsolete. Add LobbyConfig.MaxPlayers (defaults to package config.) Add LobbyConfig.Name (defaults to hostname for Dedicated Servers, or the owner's Steam Name for P2P)
* Fix lobby config max players
On Dedicated Server you can pass a path to a .sbproj with +game to load a local project. Hotloading works as usual for connected clients.
Fix lobby config max players
Can optionally pass LobbyConfig to CreateLobby. Right now only contains LobbyPrivacy. Add LobbyPrivacy.FriendsOnly.
Separate overload as not to mess with any existing game packages
Make old CreateLobby method obsolete. Add LobbyConfig.MaxPlayers (defaults to package config.) Add LobbyConfig.Name (defaults to hostname for Dedicated Servers, or the owner's Steam Name for P2P)
Keep the accumulator. Fix the issue properly.
Revert to old fixed update logic. It appears the root issue was synchronized server time causing more fixed updates than it should due to Time.Now changing. This resolves the issue I was trying to solve initially, and also fixes Facepunch/sbox-issues#6906
Make old CreateLobby method obsolete. Add LobbyConfig.MaxPlayers (defaults to package config.) Add LobbyConfig.Name (defaults to hostname for Dedicated Servers, or the owner's Steam Name for P2P)
Separate overload as not to mess with any existing game packages
Can optionally pass LobbyConfig to CreateLobby. Right now only contains LobbyPrivacy. Add LobbyPrivacy.FriendsOnly.
Resolve Fixed Update Issues
Resolves issue where Fixed Update would be called more times than it should be. Fixes issues such as in Marble Racer where if you had 500fps you'd move much faster than other players.
Add a comment r.e. timedelta and timescaling so we dont get confused later
Use this to avoid confusion
Some docs, clamp accumulator to maxSteps, use time.delta
Use RealTime.Delta its clamped
Add unit test to test FixedUpdate class
Update documentation for methods in INetworkListener to indicate that they're only called for the host.
Add net_fakelag ConVar. It's working for both Steam Networking Sockets and TCP / local instance. Can also be changed in the editor like this https://files.facepunch.com/conna/1b1211b1/sbox-dev_jpOfxVrwEr.mp4
Also commit this important file
Some changes to time sync. Seems to fix Facepunch/sbox-issues#6865 locally. Needs re-test.
Use AppIsDedicatedServer() to determine if should print warning log in texturebase. Don't run Panel.TickInternal if we're a dedicated server - makes no sense for Panels to even exist.
Make dedicated server console window title s&box Dedicated Server
We can omit this warning too if we're a dedicated server
Add +hostname support for dedicated servers. For now, just so we have a way of seeing them, bundle dedicated servers in with other lobbies when querying lobbies so they show in the lobby list for a game.
Dedicated Server Querying and Session Authentication (#1690)
* Authentication and encryption can now be enabled (by default)
* Session authentication is added for authentication tickets - this is what makes the player count go up on a server or down when they leave
* Dedicated servers use a Fake IP and can be connected to either by their Fake IP or by their associated Steam Id
* Dedicated servers can be queried from the master server using the GameSocketShare mode and so can now be fetched in-game for displaying in some UI later (Steam Server Browser does not display them due to using Fake IP)
* Added Rich Presence support for players who are connected to a dedicated server (and other players can join the game)
* Fixed some issues with headless mode such as when things were attempting to use ISteamFriends or some texture methods
* Stale connections are properly disposed of and cleaned up within a network system where in some cases before they were not
* Ensure that we disconnect from the network system when closing the game/app, this makes sure that the Steam Game Server is properly shut down
* Fixed / implemented Steam Game Server callbacks
* Moved Steam Network Sockets configuration to C# and set them in the right place now
* Ensure that we disallow a player to connect to a dedicated server if there are no player slots remaining
Fix another issue with steam friends not being installed
Some extra fixes for that
TextRendering.GetOrCreateTexture, if we're headless, return Texture.Invalid
Steam Rich Present Join Game support for dedicated server by fake IP or steam id depending on connection type
Update servers list, fix NREs from things tryna access ISteamFriends when they're a dedicated server and that interface isnt loaded
Clean up all the logs, better reason code for invalid ticket closure
Properly leave closing remote connection, such as when they dont have a valid auth ticket
Make sure reason code is clamped properly - only call socket disconnect if previously connected
Cleanup
Added internal c# methods for steam auth ticket authentication with game server - add some log output for test
Set some defaults now stuff is working. Set authentication=true, fakeip=true, and sharedqueryport=true. Servers can be queried in-game, and hide the real IP of the dedi, can be connected to via fake ip or steamid. Oddly though, the Steam Server Browser does not list the server, unless fake ip is off - can look into resolving that later as I don't know who really uses that
More configuration for debugging purposes
Fix compile error, remove debug log
Fix IP Address byte order retrieved from server list
Add steamnetworkingfakeip to steam headers vpc ..
Make sure we disconnect from the network when exiting the game (especially for dedicated servers, we need to clean up properly)
Request and use Fake Ip when starting a dedicated server (test)
Only pass the result, its all we need anyway
Move net config bootstrap stuff to c# so we can set it there, now can be set after steamgameserver init too for custom opts
Stun list test, fix game server callbacks for real, implement in dedi server
Revert "Fake Ip p2p socket test"
This reverts commit f3bece1dc379452f19b89fad20a1676149deb71a.
Extra debug convars
Reset auth back to false, at least we can toggle it internally now without rebuilding native
Add a way to get authentication status so I can debug it