From 289adcd743aa84ffbfa5b7e1b094d23d7bfe95b7 Mon Sep 17 00:00:00 2001 From: Kai Philipp Date: Sat, 14 Sep 2019 21:50:14 +0200 Subject: [PATCH] bugfix --- src/net/common/servergame.cpp | 1 + src/net/common/serverlobbythread.cpp | 3 --- src/playerdata.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/net/common/servergame.cpp b/src/net/common/servergame.cpp index 37dd2c39..3f696141 100644 --- a/src/net/common/servergame.cpp +++ b/src/net/common/servergame.cpp @@ -299,6 +299,7 @@ ServerGame::InternalStartGame() if (playerData.size() >= 2) { // Set DB Backend. + // @TODO: check for wec or bbc game with bbcbot as creator //if (GetGameData().gameType == GAME_TYPE_RANKING) if (true) m_database = GetLobbyThread().GetDatabase(); diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 8aa1783c..a97a5fe6 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -1812,12 +1812,10 @@ ServerLobbyThread::UserValid(unsigned playerId, const DBPlayerData &dbPlayerData if (tmpSession && tmpSession->GetPlayerData()) { tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id); tmpSession->GetPlayerData()->SetCountry(dbPlayerData.country); - if(dbPlayerData.last_games.length() > 0){ LOG_ERROR("last_games from db = " << dbPlayerData.last_games); vector last_games; boost::split(last_games, dbPlayerData.last_games, boost::is_any_of(",")); - for (int i = 0; i < last_games.size(); i++){ if(last_games[i].length() > 0) tmpSession->GetPlayerData()->AddPlayerLastGame(stol(last_games[i])); @@ -1826,7 +1824,6 @@ ServerLobbyThread::UserValid(unsigned playerId, const DBPlayerData &dbPlayerData }else{ LOG_ERROR("no lastGames from db"); } - this->AuthChallenge(tmpSession, dbPlayerData.secret); } } diff --git a/src/playerdata.cpp b/src/playerdata.cpp index 007cd6e3..de9d849f 100644 --- a/src/playerdata.cpp +++ b/src/playerdata.cpp @@ -291,7 +291,7 @@ LOG_ERROR("checking IsPlayerAllowedToJoinCreateLimitRank() "); count++; }else{ LOG_ERROR("erasing overdued timestamp " << *timeStamp); - timeStamp = m_last_games.erase(m_last_games.begin() + i); // erase overdued entries + timeStamp = m_last_games.erase(i); // erase overdued entries } i++; }