This commit is contained in:
Moulberry committed 2024-09-30 20:00:24 +08:00
1 parent be99313e81
commit 63535e6b3d
79 files changed
+2007 -529

No files matched your search

@@ -1,9 +1,11 @@
package com.moulberry.flashback;
import com.moulberry.flashback.playback.ReplayServer;
import it.unimi.dsi.fastutil.objects.Object2FloatFunction;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Field;
import java.time.LocalDateTime;
import java.util.Random;
public class Utils {
@@ -158,4 +160,24 @@ public class Utils {
}
}
public static int exportSequenceCount = 1;
public static String resolveFilenameTemplate(String template) {
LocalDateTime dateTime = LocalDateTime.now();
dateTime = dateTime.withNano(0);
String date = dateTime.toLocalDate().toString();
String time = dateTime.toLocalTime().toString();
String replay = "unknown";
ReplayServer replayServer = Flashback.getReplayServer();
if (replayServer != null) {
replay = replayServer.getMetadata().name;
}
return template
.replace("%date%", date)
.replace("%time%", time)
.replace("%replay%", replay)
.replace("%seq%", ""+exportSequenceCount);
}
}