fix: cannot reset room
This commit is contained in:
parent
79c6848e17
commit
da60653963
@ -156,12 +156,15 @@ public class Room {
|
||||
|
||||
public void requestRestart(Session session) {
|
||||
String sessionId = session.getId();
|
||||
if (sessionId.equals(whiteSession.getId())) {
|
||||
if (whiteSession == null || sessionId.equals(whiteSession.getId())) {
|
||||
isWhiteAcceptRestart = true;
|
||||
}
|
||||
if (sessionId.equals(blackSession.getId())) {
|
||||
if (blackSession == null || sessionId.equals(blackSession.getId())) {
|
||||
isBlackAcceptRestart = true;
|
||||
}
|
||||
if (isBlackAcceptRestart && isWhiteAcceptRestart) {
|
||||
this.resetPieces();
|
||||
}
|
||||
}
|
||||
|
||||
public void replace(String existsUser, Session session) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user