Configurando el initOnline
This commit is contained in:
@@ -369,8 +369,8 @@ void Director::initOptions()
|
||||
|
||||
// Online
|
||||
options->online.enabled = false;
|
||||
options->online.server = "";
|
||||
options->online.port = 0;
|
||||
options->online.server = "jaildoctor.duckdns.org";
|
||||
options->online.port = 9911;
|
||||
options->online.gameID = "coffee_crisis";
|
||||
options->online.jailerID = "";
|
||||
options->online.score = 0;
|
||||
@@ -647,6 +647,39 @@ void Director::run()
|
||||
// Inicializa los servicios online
|
||||
void Director::initOnline()
|
||||
{
|
||||
if (options->online.sessionEnabled)
|
||||
{ // Si ya ha iniciado la sesión, que no continue
|
||||
return;
|
||||
}
|
||||
|
||||
if (options->online.jailerID == "")
|
||||
{ // Jailer ID no definido
|
||||
|
||||
options->online.enabled = false;
|
||||
}
|
||||
else
|
||||
{ // Jailer ID iniciado
|
||||
|
||||
options->online.enabled = options->online.sessionEnabled = true;
|
||||
jscore::init(options->online.server, options->online.port);
|
||||
|
||||
#ifdef DEBUG
|
||||
const std::string caption = options->online.jailerID + " IS LOGGED IN (DEBUG)";
|
||||
#else
|
||||
const std::string caption = options->online.jailerID + " IS LOGGED IN";
|
||||
#endif
|
||||
screen->showNotification(caption);
|
||||
if (options->console)
|
||||
{
|
||||
std::cout << caption << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// OLD
|
||||
|
||||
if (!options->online.enabled)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -44,7 +44,8 @@ Reescribiendo el código el 27/09/2022
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::cout << "Starting the game..." << std::endl;
|
||||
std::cout << "Starting the game..." << std::endl
|
||||
<< std::endl;
|
||||
|
||||
// Crea el objeto Director
|
||||
Director *director = new Director(argc, argv);
|
||||
|
||||
Reference in New Issue
Block a user