Fixed lobby joining

This commit is contained in:
Anuken
2019-09-15 14:01:27 -04:00
parent f72f2bdf5d
commit d3876b6376
3 changed files with 11 additions and 3 deletions

View File

@@ -159,7 +159,7 @@ 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, 32);
smat.createLobby(Core.settings.getBool("publichost") ? LobbyType.Public : LobbyType.FriendsOnly, 16);
}
public void updateLobby(){
@@ -218,6 +218,13 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
@Override
public void onLobbyEnter(SteamID steamIDLobby, int chatPermissions, boolean blocked, ChatRoomEnterResponse response){
Log.info("enter lobby {0} {1}", steamIDLobby.getAccountID(), response);
if(response != ChatRoomEnterResponse.Success){
ui.loadfrag.hide();
ui.showErrorMessage(Core.bundle.format("cantconnect", response.toString()));
return;
}
currentLobby = steamIDLobby;
currentServer = smat.getLobbyOwner(steamIDLobby);
@@ -275,7 +282,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
SteamID lobby = smat.getLobbyByIndex(i);
Host out = new Host(
smat.getLobbyData(lobby, "name"),
"steam:" + lobby.getAccountID(),
"steam:" + SteamNativeHandle.getNativeHandle(lobby),
smat.getLobbyData(lobby, "mapname"),
Strings.parseInt(smat.getLobbyData(lobby, "wave"), -1),
smat.getNumLobbyMembers(lobby),