David Wu 8 years ago
commit c750b806e0

@ -57,9 +57,10 @@ public class NetworkInterface {
public void run() { public void run() {
List<HostGame> games = new ArrayList<>(); List<HostGame> games = new ArrayList<>();
for(ClientAddress address: clientsAddresses) { for(Map.Entry<ClientAddress, HostGame> tableEntry: matchTable.getMatchTable().entrySet()) {
HostGame game = matchTable.getMatchTable().get(address); HostGame game = tableEntry.getValue();
if(game != null) { if(game != null) {
System.out.println(game.getIp());
games.add(game); games.add(game);
} }
} }

@ -47,7 +47,7 @@ public class MatchBrowserLobbyInterface extends Observable {
try { try {
HostGamesRequest message = (HostGamesRequest) hostedGamesRequestDecoder.decode(data); HostGamesRequest message = (HostGamesRequest) hostedGamesRequestDecoder.decode(data);
games = message.getKnownGames(); games = message.getKnownGames();
System.out.println(games); System.out.println(games.get(0).getIp());
setChanged(); setChanged();
notifyObservers(); notifyObservers();
} catch (InvalidMessageException e) { } catch (InvalidMessageException e) {

Loading…
Cancel
Save