refactor: re-formated LobbyConnection
This commit is contained in:
parent
07ce02b937
commit
80ad60a658
@ -113,7 +113,9 @@ public class LobbyConnection implements Runnable {
|
|||||||
return player2;
|
return player2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashSet<Participant> getSpectators() {return spectators;}
|
public HashSet<Participant> getSpectators() {
|
||||||
|
return spectators;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hasPlayer1() {
|
public boolean hasPlayer1() {
|
||||||
return player1 != null;
|
return player1 != null;
|
||||||
@ -127,8 +129,7 @@ public class LobbyConnection implements Runnable {
|
|||||||
public void handleMessage(Participant participant, Request[] requests) {
|
public void handleMessage(Participant participant, Request[] requests) {
|
||||||
try {
|
try {
|
||||||
this.requestQueue.put(Tuple.of(participant, requests));
|
this.requestQueue.put(Tuple.of(participant, requests));
|
||||||
}catch (InterruptedException e) {
|
} catch (InterruptedException ignored) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +232,8 @@ public class LobbyConnection implements Runnable {
|
|||||||
Tuple<Participant, Request[]> current = null;
|
Tuple<Participant, Request[]> current = null;
|
||||||
try {
|
try {
|
||||||
current = requestQueue.poll(1000, TimeUnit.MILLISECONDS);
|
current = requestQueue.poll(1000, TimeUnit.MILLISECONDS);
|
||||||
} catch (InterruptedException ignored) {}
|
} catch (InterruptedException ignored) {
|
||||||
|
}
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user