Ya gestiona correctamente los datos online para diferentes usuarios

This commit is contained in:
2023-10-09 22:20:34 +02:00
parent 9b265c6cca
commit c835f943b5
12 changed files with 151 additions and 61 deletions

View File

@@ -6,17 +6,15 @@
#include <sstream>
// Constructor
Stats::Stats(std::string file, std::string buffer, options_t *options)
Stats::Stats(std::string file, std::string buffer, options_t *options, Online *online)
{
this->options = options;
this->online = online;
bufferPath = buffer;
filePath = file;
bufferList.clear();
list.clear();
dictionary.clear();
// Crea objetos
online = new Online(options);
}
// Destructor
@@ -36,9 +34,6 @@ Stats::~Stats()
bufferList.clear();
list.clear();
dictionary.clear();
// Libera memoria
delete options;
}
// Inicializador
@@ -334,10 +329,4 @@ void Stats::updateListFromBuffer()
saveToFile(bufferPath, bufferList);
saveToFile(filePath, list);
}
// Limpia los datos del servidor
void Stats::eraseServerData()
{
jscore::setUserData(options->online.gameID, options->online.jailerID, "");
}