implemented SetPlayerLastGames db function

This commit is contained in:
Kai Philipp
2019-09-11 04:36:54 +02:00
parent ecf5996135
commit afcec9d39a
7 changed files with 50 additions and 17 deletions
+26
View File
@@ -230,6 +230,32 @@ ServerDBThread::SetGamePlayerPlace(unsigned requestId, DB_id playerId, unsigned
m_semaphore.post();
}
void
ServerDBThread::SetPlayerLastGames(unsigned requestId, DB_id playerId, std::vector lastGames)
{
// The game id param is added later (during init of the async op), because it may be unknown.
string lastGamesFieldValue = "1,2,3";
list<string> params;
ostringstream paramStream;
paramStream << playerId;
params.push_back(paramStream.str());
paramStream.str("");
paramStream << lastGamesFieldValue;
params.push_back(paramStream.str());
// boost::shared_ptr<AsyncDBQuery> asyncQuery(
// new AsyncDBGamePlace(
// requestId,
// QUERY_PLAYER_LASTGAMES_PREPARE,
// params));
// {
// boost::mutex::scoped_lock lock(m_asyncQueueMutex);
// m_asyncQueue.push(asyncQuery);
// }
LOG_ERROR("reached ServerDBThread::SetPlayerLastGames() post query ");
m_semaphore.post();
}
void
ServerDBThread::EndGame(unsigned requestId)
{