Skip to content

Commit

Permalink
Ver 1.2
Browse files Browse the repository at this point in the history
新增了聊天记录保存功能,可以将本地聊天记录保存在Core的SQL中
注:密码保存在系统本地变量中
  • Loading branch information
Core-65536 committed Jun 9, 2024
1 parent 29f347b commit 8920ced
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/top/c0r3/talk/client/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -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" -> {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/top/c0r3/talk/server/server.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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()));
// 创建一个线程读取客户端消息并打印到控制台
Expand Down

0 comments on commit 8920ced

Please sign in to comment.