mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-26 07:27:18 +00:00
5d7efbd174
Adds functionality to delete bad models. Models are batched together and deleted in one commit. More testing is needed to ensure data safety. Positive tests on a live database reveal the broken models were truncated and complete ones were kept around successfully. Tests should be done to ensure larger sd0 models are properly saved and not truncated since this command should be able to be run any time. Valgrind tests need to be run as well to ensure no memory leaks exist.
27 lines
628 B
C++
27 lines
628 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
namespace BrickByBrickFix {
|
|
/**
|
|
* @brief Deletes all broken BrickByBrick models that have invalid XML
|
|
*
|
|
* @return The number of BrickByBrick models that were truncated
|
|
*/
|
|
uint32_t TruncateBrokenBrickByBrickXml();
|
|
|
|
/**
|
|
* @brief Updates all BrickByBrick models in the database to be
|
|
* in the sd0 format as opposed to a zlib compressed format.
|
|
*
|
|
* @return The number of BrickByBrick models that were updated
|
|
*/
|
|
uint32_t UpdateBrickByBrickModelsToSd0();
|
|
|
|
/**
|
|
* @brief Max size of an inflated sd0 zlib chunk
|
|
*
|
|
*/
|
|
constexpr uint32_t MAX_SD0_CHUNK_SIZE = 1024 * 256;
|
|
};
|