From 8920ced329964d2ccd788b2ab2210911e37e26db Mon Sep 17 00:00:00 2001 From: Core-65536 Date: Sun, 9 Jun 2024 22:31:47 +0800 Subject: [PATCH] =?UTF-8?q?Ver=201.2=20=E6=96=B0=E5=A2=9E=E4=BA=86?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E8=AE=B0=E5=BD=95=E4=BF=9D=E5=AD=98=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=B0=86=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E8=AE=B0=E5=BD=95=E4=BF=9D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?Core=E7=9A=84SQL=E4=B8=AD=20=E6=B3=A8=EF=BC=9A=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E4=BF=9D=E5=AD=98=E5=9C=A8=E7=B3=BB=E7=BB=9F=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E5=8F=98=E9=87=8F=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/top/c0r3/talk/client/Command.java | 1 - src/main/java/top/c0r3/talk/server/server.java | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/top/c0r3/talk/client/Command.java b/src/main/java/top/c0r3/talk/client/Command.java index e12b6a4..e847786 100644 --- a/src/main/java/top/c0r3/talk/client/Command.java +++ b/src/main/java/top/c0r3/talk/client/Command.java @@ -19,7 +19,6 @@ public static void Process(String command) { System.out.println("/help: Show this message"); System.out.println("/clear: Clear the screen"); System.out.println("/connect: Connect to another person"); - System.out.println("/accept: Accept the connection"); System.out.println("/record: Record the chat history"); } case "/clear" -> { diff --git a/src/main/java/top/c0r3/talk/server/server.java b/src/main/java/top/c0r3/talk/server/server.java index fa8912f..aaf48c0 100644 --- a/src/main/java/top/c0r3/talk/server/server.java +++ b/src/main/java/top/c0r3/talk/server/server.java @@ -23,6 +23,7 @@ public static ServerInfo getConnectServerInfo() { public void Init(){ try{ + @SuppressWarnings("resource") ServerSocket ss = new ServerSocket(SelfServerInfo.ServerPort); System.out.println("Server is running on "+InetAddress.getLocalHost()+":"+SelfServerInfo.ServerPort); SelfServerInfo.ServerIP = InetAddress.getLocalHost().toString().substring( @@ -35,7 +36,8 @@ public void Init(){ ConnectServerInfo = (ServerInfo) ois.readObject(); if(!Objects.equals(ConnectServerInfo.ServerIP, "0")){ System.out.println("Connecting with "+ConnectServerInfo.ServerName+ - " ,input /reject to reject the connection"); + " ,input /reject to reject the connection," + + " input /accept to accept the connection"); } BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream())); // 创建一个线程读取客户端消息并打印到控制台