1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix various player save issues (performance penalty on sql backends + bugs)

* PostgreSQL & SQLite3 doesn't setModified(false) on RemotePlayer, then player is saved on each server save call. This results in heavy useless writes.
* PostgreSQL & SQLite3 ack engine meta write whereas db commit hasn't been performed. If commit failed write has failed. We mustn't notify engine write is done.
* serializing player meta must not setModified(false) because it didn't ensure write has been done
* add RemotePlayer::on_successfull_save callback to do the flag update on a successful save
This commit is contained in:
Loïc Blot 2019-01-04 10:20:04 +01:00
parent 0717719073
commit c1d7dbfc38
5 changed files with 15 additions and 5 deletions

View file

@ -528,9 +528,10 @@ 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();
player->on_successful_save();
}
bool PlayerDatabaseSQLite3::loadPlayer(RemotePlayer *player, PlayerSAO *sao)