瀏覽代碼

add dmgetter

Patrick Glavin 6 年之前
父節點
當前提交
ee8a40c78d
共有 2 個檔案被更改,包括 16 行新增2 行删除
  1. 14
    0
      Client/src/main/java/DMGetter.java
  2. 2
    2
      Client/src/main/java/SimpleShell.java

+ 14
- 0
Client/src/main/java/DMGetter.java 查看文件

@@ -0,0 +1,14 @@
1
+public class DMGetter implements Runnable{
2
+    private User user;
3
+    private YouAreEll webber;
4
+
5
+    public DMGetter(User user, YouAreEll webber) {
6
+        this.user = user;
7
+        this.webber = webber;
8
+    }
9
+
10
+    public void run() {
11
+        String results = webber.get_DMs(user);
12
+        SimpleShell.prettyPrintMessages(results);
13
+    }
14
+}

+ 2
- 2
Client/src/main/java/SimpleShell.java 查看文件

@@ -120,8 +120,8 @@ public class SimpleShell {
120 120
                 // you need to add a bunch more.
121 121
 
122 122
                 if (list.contains("dms")) {
123
-                    String results = webber.get_DMs(user);
124
-                    SimpleShell.prettyPrintMessages(results);
123
+                    Thread thread = new Thread(new DMGetter(user, webber));
124
+                    thread.start();
125 125
                     continue;
126 126
                 }
127 127