forked from IF-LK-2020/wordle
Kleine Bugs gefixt die mich getriggert haben
This commit is contained in:
@@ -70,7 +70,7 @@ public class WordleServer extends Server {
|
||||
} else if (m.equalsIgnoreCase("PASS") && !u.loggedIn()) {
|
||||
m = pMessage.substring(5, pMessage.length());
|
||||
u.setPassword(m);
|
||||
if (u.getPassword() != null && u.getUsername() != null) {
|
||||
if (u.loggedIn()) {
|
||||
if (query.checkLogin(u.getUsername(), u.getPassword())) {
|
||||
send(pClientIP, pClientPort, "+OK welcome");
|
||||
query.pullStats(u);
|
||||
@@ -79,6 +79,10 @@ public class WordleServer extends Server {
|
||||
u.setUsername("");
|
||||
send(pClientIP, pClientPort, "-ERR login not valid");
|
||||
}
|
||||
} else {
|
||||
u.setPassword("");
|
||||
u.setUsername("");
|
||||
send(pClientIP, pClientPort, "-ERR login not valid");
|
||||
}
|
||||
} else if (m.equalsIgnoreCase("WOTD")) {
|
||||
if (!isToday(u.getLastDayWOTDPlayed())) {
|
||||
@@ -94,6 +98,7 @@ public class WordleServer extends Server {
|
||||
send(pClientIP, pClientPort, "-ERR game finished");
|
||||
}
|
||||
} else if (m.equalsIgnoreCase("PLAY")) {
|
||||
if (u.loggedIn()) {
|
||||
if (isToday(u.getLastDayWOTDPlayed())) {
|
||||
if (u.getGame().getGameStatus() != 1) {
|
||||
u.getGame().startGame(query.getWord(), 0);
|
||||
@@ -106,6 +111,9 @@ public class WordleServer extends Server {
|
||||
} else {
|
||||
send(pClientIP, pClientPort, "-ERR wotd not finished");
|
||||
}
|
||||
} else {
|
||||
send(pClientIP, pClientPort, "-ERR Not logged in");
|
||||
}
|
||||
} else {
|
||||
send(pClientIP, pClientPort, "-ERR Command not valid in this state");
|
||||
}
|
||||
@@ -193,6 +201,7 @@ public class WordleServer extends Server {
|
||||
send(pClientIP, pClientPort, "won in 5 turn: " + u.getWonInTurnIndex(4));
|
||||
send(pClientIP, pClientPort, "won in 6 turn: " + u.getWonInTurnIndex(5));
|
||||
} else if (m.equalsIgnoreCase("PLAY")) {
|
||||
if (u.loggedIn()) {
|
||||
if (isToday(u.getLastDayWOTDPlayed())) {
|
||||
if (u.getGame().getGameStatus() != 1) {
|
||||
u.getGame().startGame(query.getWord(), 0);
|
||||
@@ -205,6 +214,9 @@ public class WordleServer extends Server {
|
||||
} else {
|
||||
send(pClientIP, pClientPort, "-ERR wotd not finished");
|
||||
}
|
||||
} else {
|
||||
send(pClientIP, pClientPort, "-ERR not logged in");
|
||||
}
|
||||
} else {
|
||||
send(pClientIP, pClientPort, "-ERR Command not valid in this state");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user