Fixed Steam public lobby hosting / Misc Steam bugfixes

This commit is contained in:
Anuken
2023-03-25 12:42:29 -04:00
parent 0daafc5ff3
commit e4bef567b5
6 changed files with 41 additions and 44 deletions

View File

@@ -187,14 +187,14 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
@Override
public void hostServer(int port) throws IOException{
provider.hostServer(port);
smat.createLobby(Core.settings.getBool("publichost") ? LobbyType.Public : LobbyType.FriendsOnly, Core.settings.getInt("playerlimit"));
smat.createLobby(Core.settings.getBool("steampublichost") ? LobbyType.Public : LobbyType.FriendsOnly, Core.settings.getInt("playerlimit"));
Core.app.post(() -> Core.app.post(() -> Core.app.post(() -> Log.info("Server: @\nClient: @\nActive: @", net.server(), net.client(), net.active()))));
}
public void updateLobby(){
if(currentLobby != null && net.server()){
smat.setLobbyType(currentLobby, Core.settings.getBool("publichost") ? LobbyType.Public : LobbyType.FriendsOnly);
smat.setLobbyType(currentLobby, Core.settings.getBool("steampublichost") ? LobbyType.Public : LobbyType.FriendsOnly);
smat.setLobbyMemberLimit(currentLobby, Core.settings.getInt("playerlimit"));
}
}