From 9f17ffdeb34c8f9931baa39cc352b83af7cd96e4 Mon Sep 17 00:00:00 2001 From: Sergio Valor Martinez Date: Mon, 13 Feb 2023 12:19:06 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adido=20limite=20de=20caracteres=20para?= =?UTF-8?q?=20el=20jailerID=20en=20el=20marcador?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/common/utils.cpp | 4 +++- source/director.cpp | 4 ++-- source/game.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/common/utils.cpp b/source/common/utils.cpp index 1b2309f..bbf2a0d 100644 --- a/source/common/utils.cpp +++ b/source/common/utils.cpp @@ -579,7 +579,9 @@ std::string boolToString(bool value) // Convierte una cadena a minusculas std::string toLower(std::string str) { - char *original = str.c_str(); + return str; + + const char *original = str.c_str(); char *lower = (char *)malloc(str.size() + 1); for (int i = 0; i < str.size(); ++i) { diff --git a/source/director.cpp b/source/director.cpp index 87ece6d..27b075a 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -401,7 +401,7 @@ void Director::initOptions() options->online.server = "jaildoctor.duckdns.org"; options->online.port = 9911; #ifdef DEBUG - options->online.gameID = "coffee_crisis_test"; + options->online.gameID = "coffee_crisis_test2"; #else options->online.gameID = "coffee_crisis"; #endif @@ -898,7 +898,7 @@ bool Director::setOptions(options_t *options, std::string var, std::string value else if (var == "jailerID") { - options->online.jailerID = value; + options->online.jailerID = toLower(value); } // Opciones de notificaciones diff --git a/source/game.cpp b/source/game.cpp index 40fc489..588332e 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -1739,7 +1739,7 @@ void Game::renderScoreBoard() { if (jscore::getNumUsers() > 0) { - const std::string txt = jscore::getUserName(0) + " - " + updateScoreText((Uint32)jscore::getPoints(0)); + const std::string txt = jscore::getUserName(0).substr(0,12) + " - " + updateScoreText((Uint32)jscore::getPoints(0)); textScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset4, txt); } else