Eliminat TOT el online i merdes
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#include "jail_engine/jscore.h"
|
||||
#include "jail_engine/utils.h"
|
||||
#include "director.h"
|
||||
#include <errno.h>
|
||||
@@ -63,10 +62,6 @@ Director::Director(int argc, char *argv[])
|
||||
screen->setBorderColor(borderColor);
|
||||
debug = new Debug(renderer, screen, asset);
|
||||
music = JA_LoadMusic(asset->get("title.ogg").c_str());
|
||||
online = new Online(options);
|
||||
|
||||
// Inicializa los servicios online
|
||||
initOnline();
|
||||
}
|
||||
|
||||
Director::~Director()
|
||||
@@ -82,7 +77,6 @@ Director::~Director()
|
||||
delete screen;
|
||||
delete debug;
|
||||
delete resource;
|
||||
delete online;
|
||||
JA_DeleteMusic(music);
|
||||
|
||||
SDL_DestroyRenderer(renderer);
|
||||
@@ -90,29 +84,6 @@ Director::~Director()
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
// Inicializa los servicios online
|
||||
void Director::initOnline()
|
||||
{
|
||||
if (options->online.jailerID == "")
|
||||
{ // Jailer ID no definido
|
||||
options->online.enabled = false;
|
||||
}
|
||||
else
|
||||
{ // Jailer ID iniciado
|
||||
if (options->online.enabled)
|
||||
{ // Establece el servidor y el puerto
|
||||
jscore::init(options->online.server, options->online.port);
|
||||
options->online.sessionEnabled = true;
|
||||
const std::string caption = options->online.jailerID + " IS LOGGED IN";
|
||||
screen->showNotification(caption);
|
||||
if (options->console)
|
||||
{
|
||||
std::cout << caption << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Crea e inicializa las opciones del programa
|
||||
void Director::initOptions()
|
||||
{
|
||||
@@ -156,18 +127,6 @@ void Director::initOptions()
|
||||
options->stats.rooms = 0;
|
||||
options->stats.items = 0;
|
||||
|
||||
// Opciones online
|
||||
options->online.enabled = false;
|
||||
options->online.sessionEnabled = false;
|
||||
options->online.server = "jaildoctor.duckdns.org";
|
||||
options->online.port = 9911;
|
||||
#ifdef DEBUG
|
||||
options->online.gameID = "jaildoctors_dilemma_debug";
|
||||
#else
|
||||
options->online.gameID = "jaildoctors_dilemma";
|
||||
#endif
|
||||
options->online.jailerID = "";
|
||||
|
||||
// Opciones de las notificaciones
|
||||
options->notifications.posV = pos_top;
|
||||
options->notifications.posH = pos_left;
|
||||
@@ -383,12 +342,6 @@ bool Director::saveConfig()
|
||||
file << "borderHeight=" + std::to_string(options->borderHeight) + "\n";
|
||||
file << "palette=" + std::to_string(options->palette) + "\n";
|
||||
|
||||
file << "\n## ONLINE OPTIONS\n";
|
||||
file << "enabled=" + boolToString(options->online.enabled) + "\n";
|
||||
file << "server=" + options->online.server + "\n";
|
||||
file << "port=" + std::to_string(options->online.port) + "\n";
|
||||
file << "jailerID=" + options->online.jailerID + "\n";
|
||||
|
||||
file << "\n## NOTIFICATION OPTIONS\n";
|
||||
file << "## notifications.posV = pos_top | pos_bottom\n";
|
||||
if (options->notifications.posV == pos_top)
|
||||
@@ -1158,30 +1111,6 @@ bool Director::setOptions(options_t *options, std::string var, std::string value
|
||||
}
|
||||
}
|
||||
|
||||
else if (var == "enabled")
|
||||
{
|
||||
options->online.enabled = stringToBool(value);
|
||||
}
|
||||
|
||||
else if (var == "server")
|
||||
{
|
||||
options->online.server = value;
|
||||
}
|
||||
|
||||
else if (var == "port")
|
||||
{
|
||||
if (value == "")
|
||||
{
|
||||
value = "0";
|
||||
}
|
||||
options->online.port = std::stoi(value);
|
||||
}
|
||||
|
||||
else if (var == "jailerID")
|
||||
{
|
||||
options->online.jailerID = value;
|
||||
}
|
||||
|
||||
else if (var == "notifications.posH")
|
||||
{
|
||||
if (value == "pos_left")
|
||||
@@ -1793,7 +1722,7 @@ void Director::runTitle()
|
||||
JA_PlayMusic(music);
|
||||
}
|
||||
loadResources(section);
|
||||
title = new Title(renderer, screen, resource, asset, input, online, options, section);
|
||||
title = new Title(renderer, screen, resource, asset, input, options, section);
|
||||
title->run();
|
||||
delete title;
|
||||
resource->free();
|
||||
@@ -1878,7 +1807,7 @@ void Director::runGame()
|
||||
}
|
||||
JA_StopMusic();
|
||||
loadResources(section);
|
||||
game = new Game(renderer, screen, resource, asset, online, options, input, section, debug);
|
||||
game = new Game(renderer, screen, resource, asset, options, input, section, debug);
|
||||
game->run();
|
||||
delete game;
|
||||
resource->free();
|
||||
|
||||
Reference in New Issue
Block a user