summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVittorio Romeo <vittorio.romeo@outlook.com>2021-11-04 21:59:09 +0000
committerVittorio Romeo <vittorio.romeo@outlook.com>2021-11-04 21:59:09 +0000
commit9f09869375efc037ee2469d0b55900f6afe3864e (patch)
tree35ad69e8deaeaf69d28a768409341197d4cab156
parent4b236df5b1aa23ac9d24d1386f2deadbaa8dddec (diff)
Shorten replay filenames even further
-rw-r--r--src/SSVOpenHexagon/Core/HexagonGame.cpp2
-rw-r--r--src/SSVOpenHexagon/Core/Replay.cpp9
-rw-r--r--src/SSVOpenHexagon/Core/main.cpp2
3 files changed, 5 insertions, 8 deletions
diff --git a/src/SSVOpenHexagon/Core/HexagonGame.cpp b/src/SSVOpenHexagon/Core/HexagonGame.cpp
index 9899c6ae..d70f3a11 100644
--- a/src/SSVOpenHexagon/Core/HexagonGame.cpp
+++ b/src/SSVOpenHexagon/Core/HexagonGame.cpp
@@ -989,7 +989,7 @@ void HexagonGame::death_sendAndSaveReplay(const replay_file& rf)
// ------------------------------------------------------------------------
// Save compressed replay locally.
- if(const std::string filename = Utils::concat(rf.create_filename(), ".gz");
+ if(const std::string filename = Utils::concat(rf.create_filename(), ".z");
!death_saveReplay(filename, crf))
{
ssvu::lo("Replay") << "Failure saving replay\n";
diff --git a/src/SSVOpenHexagon/Core/Replay.cpp b/src/SSVOpenHexagon/Core/Replay.cpp
index 64b06630..b9b57fb3 100644
--- a/src/SSVOpenHexagon/Core/Replay.cpp
+++ b/src/SSVOpenHexagon/Core/Replay.cpp
@@ -418,13 +418,10 @@ static constexpr std::size_t buf_size{2097152}; // 2MB
[[nodiscard]] std::string replay_file::create_filename() const
{
const Utils::TimePoint tp = Utils::toTimepoint(Utils::nowTimestamp());
+ const std::string tp_str = Utils::formatTimepoint(tp, "%Y%m%d_%H%M%S");
- const std::string timestampStr =
- Utils::formatTimepoint(tp, "%Y-%m-%d_%H-%M-%S");
-
- return Utils::concat(_version, '_', timestampStr, '_', _player_name, '_',
- _level_id, '_', _difficulty_mult, "x_", _played_score / 60.0,
- "s.ohreplay");
+ return Utils::concat(_version, '_', tp_str, '_', _player_name, '_',
+ _level_id, '_', _difficulty_mult, "x_", _played_score / 60.0, "s.ohr");
}
[[nodiscard]] bool compressed_replay_file::serialize_to_file(
diff --git a/src/SSVOpenHexagon/Core/main.cpp b/src/SSVOpenHexagon/Core/main.cpp
index fbcc6a86..297193a1 100644
--- a/src/SSVOpenHexagon/Core/main.cpp
+++ b/src/SSVOpenHexagon/Core/main.cpp
@@ -145,7 +145,7 @@ getFirstCompressedReplayFilenameFromArgs(const std::vector<std::string>& args)
{
for(const std::string& arg : args)
{
- if(arg.find(".ohreplay.gz") != std::string::npos)
+ if(arg.find(".ohr.z") != std::string::npos)
{
return arg;
}