mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-19 21:10:12 +02:00
Track last login time for accounts
This commit is contained in:
parent
8cd6832297
commit
77f177adc7
@ -149,6 +149,12 @@ void LobbyDatabase::prepareStatements()
|
||||
WHERE roomID = ?
|
||||
)";
|
||||
|
||||
static const std::string updateAccountLoginTimeText = R"(
|
||||
UPDATE accounts
|
||||
SET lastLoginTime = CURRENT_TIMESTAMP
|
||||
WHERE accountID = ?
|
||||
)";
|
||||
|
||||
// SELECT FROM
|
||||
|
||||
static const std::string getRecentMessageHistoryText = R"(
|
||||
@ -263,6 +269,7 @@ void LobbyDatabase::prepareStatements()
|
||||
|
||||
setAccountOnlineStatement = database->prepare(setAccountOnlineText);
|
||||
setGameRoomStatusStatement = database->prepare(setGameRoomStatusText);
|
||||
updateAccountLoginTimeStatement = database->prepare(updateAccountLoginTimeText);
|
||||
|
||||
getRecentMessageHistoryStatement = database->prepare(getRecentMessageHistoryText);
|
||||
getIdleGameRoomStatement = database->prepare(getIdleGameRoomText);
|
||||
@ -382,7 +389,7 @@ void LobbyDatabase::insertAccessCookie(const std::string & accountID, const std:
|
||||
|
||||
void LobbyDatabase::updateAccountLoginTime(const std::string & accountID)
|
||||
{
|
||||
assert(0);
|
||||
updateAccountLoginTimeStatement->executeOnce(accountID);
|
||||
}
|
||||
|
||||
std::string LobbyDatabase::getAccountDisplayName(const std::string & accountID)
|
||||
|
@ -33,7 +33,7 @@ class LobbyDatabase
|
||||
|
||||
SQLiteStatementPtr setAccountOnlineStatement;
|
||||
SQLiteStatementPtr setGameRoomStatusStatement;
|
||||
SQLiteStatementPtr setGameRoomPlayerLimitStatement;
|
||||
SQLiteStatementPtr updateAccountLoginTimeStatement;
|
||||
|
||||
SQLiteStatementPtr getRecentMessageHistoryStatement;
|
||||
SQLiteStatementPtr getIdleGameRoomStatement;
|
||||
|
Loading…
x
Reference in New Issue
Block a user