This commit is contained in:
Tim Tersch
2022-02-14 09:27:40 +01:00
parent e3e899908f
commit e7a785f968

View File

@@ -10,6 +10,7 @@ public class Game {
private String wordle; private String wordle;
private String[] words; private String[] words;
private int count; private int count;
private int phase;
public Game(WordleServer wordleServer, String pClientIP, int pClientPort) { public Game(WordleServer wordleServer, String pClientIP, int pClientPort) {
@@ -18,10 +19,32 @@ public class Game {
this.port = pClientPort; this.port = pClientPort;
user = new User(); user = new User();
send("+OK Hello there");
} }
public void processMessage(String msg) { public void processMessage(String msg) {
System.out.println(msg);
if (msg.equals("quit")) {
send("+OK bye");
wordleServer.closeConnection(ip, port);
}
switch (phase) {
case 0:
break;
case 1:
break;
case 2:
break;
}
}
private void send(String msg) {
wordleServer.send(ip, port, msg);
} }
public String getIp() { public String getIp() {