forked from IF-LK-2020/wordle
Befehle
This commit is contained in:
@@ -23,6 +23,8 @@ public class Game {
|
|||||||
|
|
||||||
public void processMessage(String msg) {
|
public void processMessage(String msg) {
|
||||||
|
|
||||||
|
msg = msg.toLowerCase().trim();
|
||||||
|
|
||||||
if (msg.equals("quit")) {
|
if (msg.equals("quit")) {
|
||||||
send("+OK bye");
|
send("+OK bye");
|
||||||
wordleServer.closeConnection(ip, port);
|
wordleServer.closeConnection(ip, port);
|
||||||
@@ -42,15 +44,33 @@ public class Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loginPhase(String msg) {
|
private void loginPhase(String msg) {
|
||||||
|
if (msg.startsWith("user")) {
|
||||||
|
|
||||||
|
} else if (msg.startsWith("pass")) {
|
||||||
|
|
||||||
|
} else if (msg.startsWith("wotd")) {
|
||||||
|
|
||||||
|
} else if (msg.startsWith("play")) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gamePhase(String msg) {
|
private void gamePhase(String msg) {
|
||||||
|
if (msg.startsWith("send")) {
|
||||||
|
|
||||||
|
} else if (msg.startsWith("info")) {
|
||||||
|
|
||||||
|
} else if (msg.startsWith("exit")) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void endPhase(String msg) {
|
private void endPhase(String msg) {
|
||||||
|
if (msg.startsWith("stat")) {
|
||||||
|
|
||||||
|
} else if (msg.startsWith("play")) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void send(String msg) {
|
private void send(String msg) {
|
||||||
|
|||||||
Reference in New Issue
Block a user