mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-01 14:38:50 +00:00
0.10.0
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user