Añadida la opción para pasar por parametro el servidor y puerto online

This commit is contained in:
2022-11-16 13:58:09 +01:00
parent 5380ea6bc5
commit 7b00dc0303
5 changed files with 20 additions and 2 deletions

View File

@@ -454,6 +454,7 @@ bool Director::saveConfigFile()
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";
// Cierra el fichero
@@ -542,6 +543,9 @@ void Director::initOnline()
else
{ // Jailer ID iniciado
// Establece el servidor y el puerto
jscore::init(options->online.server, options->online.port);
// Obtiene la información online
if (jscore::initOnlineScore(options->online.gameID))
{
@@ -680,6 +684,11 @@ bool Director::setOptions(options_t *options, std::string var, std::string value
options->online.server = value;
}
else if (var == "port")
{
options->online.port = std::stoi(value);
}
else if (var == "jailerID")
{
options->online.jailerID = value;