|
|
|
|
@ -67,6 +67,7 @@ public class NetworkInterface {
|
|
|
|
|
HostedGamesRequestEncoder encoder = new HostedGamesRequestEncoder();
|
|
|
|
|
try {
|
|
|
|
|
byte[] message = encoder.encode(new HostGamesRequest(games));
|
|
|
|
|
System.out.println(LocalDateTime.now() + ": Sending " + games.size() + " game/s");
|
|
|
|
|
for(ClientAddress address: clientsAddresses) {
|
|
|
|
|
serverSocket.send(new DatagramPacket(message, message.length, InetAddress.getByName(address.getIp()), 4941));
|
|
|
|
|
}
|
|
|
|
|
@ -85,6 +86,7 @@ public class NetworkInterface {
|
|
|
|
|
scheduler.scheduleAtFixedRate(new TimerTask() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
System.out.println("flush");
|
|
|
|
|
matchTable.getMatchTable().clear();
|
|
|
|
|
}
|
|
|
|
|
}, period, period);
|
|
|
|
|
|