Allow hiding of steam servers (#5618)

* Allow hiding of steam servers

Theres no way to hide them while keeping them public in the steam api so instead this jank is needed. This wont do anything on a vanilla install but will allow people hosting headless steam servers to hide them if they only use the server to verify if players are on steam or not.

* Hide only when hidden = true
This commit is contained in:
buthed010203
2021-07-19 20:57:36 -04:00
committed by GitHub
parent fde23ceea0
commit b58f202e9e

View File

@ -312,6 +312,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
for(int i = 0; i < matches; i++){
try{
SteamID lobby = smat.getLobbyByIndex(i);
if(smat.getLobbyData(lobby, "hidden").equals("true")) continue;
String mode = smat.getLobbyData(lobby, "gamemode");
//make sure versions are equal, don't list incompatible lobbies
if(mode == null || mode.isEmpty() || (Version.build != -1 && Strings.parseInt(smat.getLobbyData(lobby, "version"), -1) != Version.build)) continue;