mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* python script to generate cpp file with BareDistro content poltool cmd to generate the files * updated baredistro, fixed compilation * fix warning, ignore autogenerated file in stylechecker * test for pol? uoconvert got a new argument outdir for the cfg file output single thread decay has now a upper limit of sleeptime fixed that the exit_code can only get worse basic files for core testing in testsuite added a not really nice way to set it up via ctest integrated in CI with upload of log output * testenv * update poltool filegeneration to c++17 * first real tests * first npc test * equip a backpack and test a bit aos props * fixed early returns
44 lines
998 B
C++
44 lines
998 B
C++
#include "baredistro.h"
|
|
|
|
#include "../clib/logfacility.h"
|
|
|
|
#include <fstream>
|
|
#include <utility>
|
|
|
|
namespace Pol
|
|
{
|
|
namespace PolTool
|
|
{
|
|
BareDistro::BareDistro( fs::path basedir, bool hsa, int maxtiles, int width, int height )
|
|
: _basedir( std::move( basedir ) ),
|
|
_hsa( hsa ),
|
|
_maxtiles( maxtiles ),
|
|
_width( width ),
|
|
_height( height )
|
|
{
|
|
}
|
|
void BareDistro::generate()
|
|
{
|
|
INFO_PRINT << "Generating minimal distro files\n";
|
|
std::map<fs::path, std::vector<std::string>> distro;
|
|
distro_files( distro );
|
|
|
|
for ( const auto& file : distro )
|
|
{
|
|
fs::path relpath = _basedir / file.first;
|
|
fs::path basedir = relpath;
|
|
if ( basedir.has_filename() )
|
|
basedir.remove_filename();
|
|
if ( !fs::exists( basedir ) )
|
|
fs::create_directories( basedir );
|
|
std::ofstream ofile( relpath, std::ofstream::out );
|
|
for ( const auto& line : file.second )
|
|
{
|
|
ofile << line << "\n";
|
|
}
|
|
ofile.close();
|
|
}
|
|
}
|
|
|
|
} // namespace PolTool
|
|
} // namespace Pol
|