Skip to content

Commit

Permalink
replay attack handled
Browse files Browse the repository at this point in the history
  • Loading branch information
smmhatami committed Jul 24, 2020
1 parent b9f6d45 commit 21e69ff
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,14 @@ public void addMassageForSupporter(String massageText, String buyerUsername) {
throwable.printStackTrace();
}
}

public ArrayList<String> getMessages() {
try {
return (ArrayList<String>) MethodStringer.sampleMethod(getClass(),
"getMessages");
} catch (Throwable throwable) {
throwable.printStackTrace();
return null;
}
}
}
8 changes: 4 additions & 4 deletions src/main/java/client/network/ClientSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
public class ClientSocket extends Thread {

// server info
public static final int PORT = 13092;
public static final String IP = "0.tcp.ngrok.io";
// public static final int PORT = 13092;
// public static final String IP = "0.tcp.ngrok.io";

// in pc
// public static final int PORT = 6666;
// public static final String IP = "127.0.0.1";
public static final int PORT = 6666;
public static final String IP = "127.0.0.1";
private int messageCounter;

private final P2PSocket p2pSocket = new P2PSocket();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;

import java.util.ArrayList;

public class ChatWhitSupporterMenu {
private final SupporterController supporterController = SupporterController.getInstance();
public VBox onlineSupporterListBox;
Expand Down Expand Up @@ -48,4 +50,8 @@ public void sendNewMassage() {
private void addMassageToChat(String massage) {
allMassagesBox.getChildren().add(new Text(massage));
}

private void updateChat() {
ArrayList<String> messages = SupporterController.getInstance().getMessages();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public void addMassageForSupporter(String massageText, String buyerUsername) {
//TODO: update Buyer
}

public ArrayList<String> getMessages() {
return ((Buyer) UserController.getActiveUser()).getActiveChat().getAllMassagesText();
}

@Override
public Object getItemById(String Id) {
return null;
Expand Down

0 comments on commit 21e69ff

Please sign in to comment.