Fixed lobby joining
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user