FIX: No se estaba haciendo jscore::init, pero todo funcionaba correctamente

This commit is contained in:
2023-10-09 23:11:25 +02:00
parent c34b4d8944
commit f602b5ff7a

View File

@@ -64,6 +64,9 @@ Director::Director(int argc, char *argv[])
debug = new Debug(renderer, screen, asset); debug = new Debug(renderer, screen, asset);
music = JA_LoadMusic(asset->get("title.ogg").c_str()); music = JA_LoadMusic(asset->get("title.ogg").c_str());
online = new Online(options); online = new Online(options);
// Inicializa los servicios online
initOnline();
} }
Director::~Director() Director::~Director()
@@ -92,16 +95,14 @@ void Director::initOnline()
{ {
if (options->online.jailerID == "") if (options->online.jailerID == "")
{ // Jailer ID no definido { // Jailer ID no definido
options->online.enabled = false; options->online.enabled = false;
} }
else else
{ // Jailer ID iniciado { // Jailer ID iniciado
if (options->online.enabled) if (options->online.enabled)
{ // Establece el servidor y el puerto { // Establece el servidor y el puerto
jscore::init(options->online.server, options->online.port); jscore::init(options->online.server, options->online.port);
options->online.sessionEnabled = true;
const std::string caption = options->online.jailerID + " IS LOGGED IN"; const std::string caption = options->online.jailerID + " IS LOGGED IN";
screen->showNotification(caption); screen->showNotification(caption);
if (options->console) if (options->console)
@@ -1330,13 +1331,13 @@ bool Director::initSDL()
else else
{ {
// Crea un renderizador para la ventana. El vsync se activa en funcion de las opciones // Crea un renderizador para la ventana. El vsync se activa en funcion de las opciones
//Uint32 flags = SDL_RENDERER_SOFTWARE; // Uint32 flags = SDL_RENDERER_SOFTWARE;
//Uint32 flags = SDL_RENDERER_ACCELERATED; // Uint32 flags = SDL_RENDERER_ACCELERATED;
Uint32 flags = 0; Uint32 flags = 0;
if (options->vSync) if (options->vSync)
{ {
flags = flags | SDL_RENDERER_PRESENTVSYNC; flags = flags | SDL_RENDERER_PRESENTVSYNC;
} }
renderer = SDL_CreateRenderer(window, -1, flags); renderer = SDL_CreateRenderer(window, -1, flags);
if (renderer == nullptr) if (renderer == nullptr)