Tried to get lobby working #story[1188]
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -20,6 +20,7 @@ public class MatchBrowserClientRunnable implements RunnableWithFramePeriod {
|
||||
long previousFrameTime = System.currentTimeMillis();
|
||||
|
||||
while (!Thread.interrupted()) {
|
||||
System.out.println("Receiving");
|
||||
try{
|
||||
matchBrowserLobbyInterface.receiveGameInfo(socket);
|
||||
}catch (IOException e){
|
||||
|
||||
@@ -26,7 +26,7 @@ public class MatchBrowserInterface {
|
||||
|
||||
public MatchBrowserInterface() {
|
||||
try {//132.181.16.13 is the ip of the CI as of 13/9/17
|
||||
this.IPAddress = InetAddress.getByName("132.181.16.13"); //InetAddress.getLocalHost();
|
||||
this.IPAddress = InetAddress.getByName("umbrasheep.com"); //InetAddress.getLocalHost();
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ public class MatchBrowserLobbyInterface extends Observable {
|
||||
byte[] data = new byte[64];
|
||||
DatagramPacket receivedPacket = new DatagramPacket(data, 64);
|
||||
socket.receive(receivedPacket);
|
||||
System.out.println(receivedPacket);
|
||||
|
||||
HostedGamesRequestDecoder hostedGamesRequestDecoder = new HostedGamesRequestDecoder();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user