send out to every client fix
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<java version="1.8.0_144" class="java.beans.XMLDecoder">
|
<java version="1.8.0_111" class="java.beans.XMLDecoder">
|
||||||
<object class="java.util.HashMap">
|
<object class="java.util.HashMap">
|
||||||
<void method="put">
|
<void method="put">
|
||||||
<string>SPACE</string>
|
<string>SPACE</string>
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
<object class="visualiser.gameController.Keys.SailsToggleKey"/>
|
<object class="visualiser.gameController.Keys.SailsToggleKey"/>
|
||||||
</void>
|
</void>
|
||||||
<void method="put">
|
<void method="put">
|
||||||
<string>LEFT</string>
|
<string>DOWN</string>
|
||||||
<object class="visualiser.gameController.Keys.UpWindKey"/>
|
<object class="visualiser.gameController.Keys.DownWindKey"/>
|
||||||
</void>
|
</void>
|
||||||
<void method="put">
|
<void method="put">
|
||||||
<string>X</string>
|
<string>X</string>
|
||||||
@@ -21,13 +21,13 @@
|
|||||||
<string>ENTER</string>
|
<string>ENTER</string>
|
||||||
<object class="visualiser.gameController.Keys.TackGybeKey"/>
|
<object class="visualiser.gameController.Keys.TackGybeKey"/>
|
||||||
</void>
|
</void>
|
||||||
<void method="put">
|
|
||||||
<string>RIGHT</string>
|
|
||||||
<object class="visualiser.gameController.Keys.DownWindKey"/>
|
|
||||||
</void>
|
|
||||||
<void method="put">
|
<void method="put">
|
||||||
<string>Z</string>
|
<string>Z</string>
|
||||||
<object class="visualiser.gameController.Keys.ZoomInKey"/>
|
<object class="visualiser.gameController.Keys.ZoomInKey"/>
|
||||||
</void>
|
</void>
|
||||||
|
<void method="put">
|
||||||
|
<string>UP</string>
|
||||||
|
<object class="visualiser.gameController.Keys.UpWindKey"/>
|
||||||
|
</void>
|
||||||
</object>
|
</object>
|
||||||
</java>
|
</java>
|
||||||
|
|||||||
Reference in New Issue
Block a user