Skip to content

Commit

Permalink
refactor: 移除代码中的控制台打印语句
Browse files Browse the repository at this point in the history
  • Loading branch information
shulng committed Aug 10, 2024
1 parent 82f3f48 commit 5da12b0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ public void onPlayerQuit(String playerName) {
// 记录玩家退出时间
long exitTime = System.currentTimeMillis();
playerExitTimes.put(playerName, exitTime);
System.out.println("玩家 " + playerName + " 退出,时间: " + exitTime);
// System.out.println("玩家 " + playerName + " 退出,时间: " + exitTime);
System.out.println("当前退出时间记录: " + playerExitTimes);
}

public boolean onPlayerJoin(String playerName) {
long currentTime = System.currentTimeMillis();
Long exitTime = playerExitTimes.get(playerName);
System.out.println("玩家 " + playerName + " 加入,时间: " + currentTime);
System.out.println("玩家 " + playerName + " 退出时间: " + exitTime);
// System.out.println("玩家 " + playerName + " 加入,时间: " + currentTime);
// System.out.println("玩家 " + playerName + " 退出时间: " + exitTime);
System.out.println("当前退出时间记录: " + playerExitTimes);

return (boolean) (exitTime != null && currentTime - exitTime <= timeoutDuration ? playerExitTimes.remove(playerName) : false);
Expand Down

0 comments on commit 5da12b0

Please sign in to comment.