diff options
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/database-postgresql.cpp | 6 | ||||
-rw-r--r-- | src/database/database-sqlite3.cpp | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/database/database-postgresql.cpp b/src/database/database-postgresql.cpp index 74651135a..2d9c3b49e 100644 --- a/src/database/database-postgresql.cpp +++ b/src/database/database-postgresql.cpp @@ -518,7 +518,7 @@ void PlayerDatabasePostgreSQL::savePlayer(RemotePlayer *player) } execPrepared("remove_player_metadata", 1, rmvalues); - const PlayerAttributes &attrs = sao->getExtendedAttributes(); + const StringMap &attrs = sao->getMeta().getStrings(); for (const auto &attr : attrs) { const char *meta_values[] = { player->getName(), @@ -527,6 +527,7 @@ void PlayerDatabasePostgreSQL::savePlayer(RemotePlayer *player) }; execPrepared("save_player_metadata", 3, meta_values); } + sao->getMeta().setModified(false); endSave(); } @@ -594,8 +595,9 @@ bool PlayerDatabasePostgreSQL::loadPlayer(RemotePlayer *player, PlayerSAO *sao) int numrows = PQntuples(results); for (int row = 0; row < numrows; row++) { - sao->setExtendedAttribute(PQgetvalue(results, row, 0),PQgetvalue(results, row, 1)); + sao->getMeta().setString(PQgetvalue(results, row, 0), PQgetvalue(results, row, 1)); } + sao->getMeta().setModified(false); PQclear(results); diff --git a/src/database/database-sqlite3.cpp b/src/database/database-sqlite3.cpp index 78c182f86..76935ada4 100644 --- a/src/database/database-sqlite3.cpp +++ b/src/database/database-sqlite3.cpp @@ -520,7 +520,7 @@ void PlayerDatabaseSQLite3::savePlayer(RemotePlayer *player) sqlite3_vrfy(sqlite3_step(m_stmt_player_metadata_remove), SQLITE_DONE); sqlite3_reset(m_stmt_player_metadata_remove); - const PlayerAttributes &attrs = sao->getExtendedAttributes(); + const StringMap &attrs = sao->getMeta().getStrings(); for (const auto &attr : attrs) { str_to_sqlite(m_stmt_player_metadata_add, 1, player->getName()); str_to_sqlite(m_stmt_player_metadata_add, 2, attr.first); @@ -528,6 +528,7 @@ void PlayerDatabaseSQLite3::savePlayer(RemotePlayer *player) sqlite3_vrfy(sqlite3_step(m_stmt_player_metadata_add), SQLITE_DONE); sqlite3_reset(m_stmt_player_metadata_add); } + sao->getMeta().setModified(false); endSave(); } @@ -578,8 +579,9 @@ bool PlayerDatabaseSQLite3::loadPlayer(RemotePlayer *player, PlayerSAO *sao) std::string attr = sqlite_to_string(m_stmt_player_metadata_load, 0); std::string value = sqlite_to_string(m_stmt_player_metadata_load, 1); - sao->setExtendedAttribute(attr, value); + sao->getMeta().setString(attr, value); } + sao->getMeta().setModified(false); sqlite3_reset(m_stmt_player_metadata_load); return true; } |