Refactor chat logging

This commit is contained in:
P0nk
2022-01-03 18:35:15 +01:00
parent 7e7c2cb153
commit 6041d56bcd
9 changed files with 51 additions and 62 deletions

View File

@@ -1,11 +1,9 @@
package tools;
import client.Character;
import client.Client;
import server.ItemInformationProvider;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import static java.util.concurrent.TimeUnit.MINUTES;
@@ -32,10 +30,4 @@ public class LogHelper {
String log = player.getName() + " got a " + itemName + "(" + itemid + ") from the " + map + " gachapon. - " + timeStamp;
FilePrinter.print(FilePrinter.LOG_GACHAPON, log);
}
public static void logChat(Client player, String chatType, String text) {
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm");
FilePrinter.print(FilePrinter.LOG_CHAT, "[" + sdf.format(Calendar.getInstance().getTime()) + "] (" + chatType + ") " + player.getPlayer().getName() + ": " + text);
}
}