1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00
This commit is contained in:
Laserlicht
2024-08-01 21:30:53 +02:00
parent fb171ab3a2
commit 490f1bfee6
7 changed files with 63 additions and 28 deletions

View File

@@ -355,22 +355,6 @@ void ClientCommandManager::handleGetScriptsCommand()
#endif
}
void ClientCommandManager::handleGetStatistic()
{
printCommandMessage("Command accepted.\t");
const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / "statistic";
boost::filesystem::create_directories(outPath);
const boost::filesystem::path filePath = outPath / (vstd::getDateTimeISO8601Basic(std::time(nullptr)) + ".csv");
std::ofstream file(filePath.c_str());
std::string csv = CSH->client->gameState()->statistic.toCsv();
file << csv;
printCommandMessage("Writing statistic done :)\n");
printCommandMessage("Statistic files can be found in " + outPath.string() + " directory\n");
}
void ClientCommandManager::handleGetTextCommand()
{
printCommandMessage("Command accepted.\t");
@@ -613,9 +597,6 @@ void ClientCommandManager::processCommand(const std::string & message, bool call
else if(message=="get scripts")
handleGetScriptsCommand();
else if(message=="get statistic")
handleGetStatistic();
else if(message=="get txt")
handleGetTextCommand();