forked from IF-LK-2020/wordle
quit
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user