From c307b74f57362095390c77c8a36f260e28b121d9 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 19 May 2019 00:35:57 +0300 Subject: [PATCH] (01fa60350) Hacky fix to private servers showing up in the server list: use an invalid pchVersionString ("-1"), which causes the server to be rejected from the server list. Closes #1455 --- Libraries/Facepunch.Steamworks/Server.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/Facepunch.Steamworks/Server.cs b/Libraries/Facepunch.Steamworks/Server.cs index 8e49cb739..13a01c804 100644 --- a/Libraries/Facepunch.Steamworks/Server.cs +++ b/Libraries/Facepunch.Steamworks/Server.cs @@ -43,12 +43,12 @@ namespace Facepunch.Steamworks // //kind of a hack: - //use an outdated version number to hide private servers from the server list. + //use an invalid version number to hide private servers from the server list. //couldn't find a way to do it otherwise - using 1 as the eServerMode doesn't //seem to work, the server info is still returned by the API calls - string versionString = isPublic ? init.VersionString : "0.0.0.0"; - if ( !native.InitServer( this, ipaddress, init.SteamPort, init.GamePort, init.QueryPort, init.Secure ? 3 : 2, - isPublic ? init.VersionString : "0.0.0.0" ) ) + string versionString = isPublic ? init.VersionString : "-1"; + if ( !native.InitServer( this, ipaddress, init.SteamPort, init.GamePort, init.QueryPort, isPublic ? (init.Secure ? 3 : 2) : 1, + versionString) ) { native.Dispose(); native = null;