added info <n>

This commit is contained in:
Asecave
2022-03-25 20:43:58 +01:00
parent 84a81bf2b4
commit a78fac1baf

View File

@@ -217,6 +217,23 @@ public class Game {
send(".");
} else if (msg.length() == 6) {
String rawLine = msg.substring(5);
int line = -1;
try {
line = Integer.parseInt(rawLine) - 1;
} catch (NumberFormatException e) {
send("-ERR wrong argument.");
}
if (line >= 0 && line < 5) {
if (words[line] != null) {
send("+OK " + words[line] + " " + generateCode(words[line]));
} else {
send("-ERR game hasn't progressed to this line yet.");
}
} else {
send("-ERR couldn't parse line.");
}
} else {
sendUniversalError();
}