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:
parent
0717719073
commit
c1d7dbfc38
5 changed files with 15 additions and 5 deletions
|
@ -105,7 +105,8 @@ void PlayerDatabaseFiles::savePlayer(RemotePlayer *player)
|
|||
if (!fs::safeWriteToFile(path, ss.str())) {
|
||||
infostream << "Failed to write " << path << std::endl;
|
||||
}
|
||||
player->setModified(false);
|
||||
|
||||
player->on_successful_save();
|
||||
}
|
||||
|
||||
bool PlayerDatabaseFiles::removePlayer(const std::string &name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue