diff --git a/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java b/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java index 953c7429..7a5d2138 100644 --- a/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java +++ b/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java @@ -37,17 +37,17 @@ public class DiscordHandler { byte[] sendData = ResponseMsg.getBytes("UTF-8"); int deliver_port = 0; switch (port) { - case 48470: - deliver_port = 48479; + case 48474: + deliver_port = 48470; break; - case 48471: - deliver_port = 48482; + case 48475: + deliver_port = 48471; break; - case 48472: - deliver_port = 48476; + case 48476: + deliver_port = 48472; break; - case 48473: - deliver_port = 48481; + case 48477: + deliver_port = 48473; break; } DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, ipAddress, deliver_port); @@ -56,13 +56,9 @@ public class DiscordHandler { public static void handleUDPTraffic(int port, Datahandler datahandler, StanfordCoreNLP stanfordCoreNLP, StanfordCoreNLP stanfordCoreNLPSentiment) { + try (DatagramSocket serverSocket = new DatagramSocket(port)) { - String hostIP = ""; - if (port == 48473 || port == 48471) { - hostIP = "51.15.159.31"; - } else { - hostIP = "195.154.53.196"; - } + String hostIP = "195.154.53.196"; InetAddress ipAddress = InetAddress.getByName(hostIP);//used ip' while (true) { receiveAndSendPacket(serverSocket, ipAddress, port, datahandler, stanfordCoreNLP, stanfordCoreNLPSentiment); @@ -95,7 +91,7 @@ public class DiscordHandler { for (int i = 0; i < autismbotCount; i++) { final int j = i; new Thread(() -> { - List ports = List.of(48470, 48471, 48472, 48473); + List ports = List.of(48475, 48476, 48477, 48478); handleUDPTraffic(ports.get(j), datahandler, stanfordCoreNLP, stanfordCoreNLPSentiment); }).start(); } diff --git a/AutismBotIngame/python/config.json b/AutismBotIngame/python/config.json index 0a2f59d9..b262cb42 100644 --- a/AutismBotIngame/python/config.json +++ b/AutismBotIngame/python/config.json @@ -1,6 +1,6 @@ { - "udp_port": 48482, - "chat_external_port": 48471, + "udp_port": 48470, + "chat_external_port": 48475, "steam_port": 29074, "server_ip_port": "135.125.188.157:27015" }