瀏覽代碼

proceeding while awaiting thread response with simulated lag

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

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

@@ -17,13 +17,14 @@ public class MessageSender implements Runnable{
17 17
         for (int i = 2; i < list.size(); i++) {
18 18
             sentence += list.get(i) + " ";
19 19
         }
20
+
20 21
         sentence = sentence.substring(0, sentence.length()-1);
21 22
         if (list.get(1).equalsIgnoreCase("group")){
22 23
             message = new Message(user.getGithub(), "", sentence);
23 24
         } else {
24 25
             message = new Message(user.getGithub(), list.get(1), sentence);
25 26
         }
26
-        
27
+
27 28
         String results = webber.send_message(message);
28 29
         try {
29 30
             Thread.sleep(10000);

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

@@ -128,7 +128,7 @@ public class SimpleShell {
128 128
                 if (list.contains("send")) {
129 129
                     MessageSender sender = new MessageSender(list, user, webber);
130 130
                     Thread thread = new Thread(sender);
131
-                    thread.run();
131
+                    thread.start();
132 132
                     continue;
133 133
                 }
134 134