/**
 * \file server.cpp
 * \brief Univerxel server
 * \author Maelys Bois
 * \version 0.0.1
 *
 * Univerxel standalone server program.
 */

#define STANDALONE 1
#include "server/Server.hpp"
#include "core/standalone_config.hpp"
#include "core/utils/tracy.hpp"
#include "version.h"

/// Entry point
int main(int argc, char *argv[]){
    LOG("Univerxel server " << UNIVERXEL_VERSION);

#if TRACY_ENABLE
    LOG("Profiling !");
#endif

    auto options = config::standalone_options<config::server::options>(argc > 1 ? argv[1] : config::DEFAULT_FILE);
    options.save();

#if TRACY_ENABLE
    tracy::SetThreadName("Main");
#endif

    auto server = Server(options.get());
    server.run();

    options.save();

    return 0;
}