#include <database-files.h>
◆ PlayerDatabaseFiles()
PlayerDatabaseFiles::PlayerDatabaseFiles |
( |
const std::string & | savedir | ) |
|
◆ ~PlayerDatabaseFiles()
virtual PlayerDatabaseFiles::~PlayerDatabaseFiles |
( |
| ) |
|
|
virtualdefault |
◆ deSerialize()
void PlayerDatabaseFiles::deSerialize |
( |
RemotePlayer * | p, |
|
|
std::istream & | is, |
|
|
const std::string & | playername, |
|
|
PlayerSAO * | sao ) |
|
private |
References errorstream, Settings::exists(), Settings::get(), Settings::getBool(), Settings::getFloat(), PlayerSAO::getMeta(), Settings::getU16(), Settings::getV3F(), p(), Settings::parseConfigLines(), PLAYER_MAX_HP_DEFAULT, PlayerSAO::setBasePosition(), PlayerSAO::setBreath(), PlayerSAO::setHPRaw(), PlayerSAO::setLookPitch(), SimpleMetadata::setModified(), PlayerSAO::setPlayerYaw(), SimpleMetadata::setString(), and BaseException::what().
Referenced by listPlayers(), loadPlayer(), removePlayer(), and savePlayer().
◆ listPlayers()
void PlayerDatabaseFiles::listPlayers |
( |
std::vector< std::string > & | res | ) |
|
|
virtual |
◆ loadPlayer()
◆ removePlayer()
bool PlayerDatabaseFiles::removePlayer |
( |
const std::string & | name | ) |
|
|
virtual |
◆ savePlayer()
void PlayerDatabaseFiles::savePlayer |
( |
RemotePlayer * | player | ) |
|
|
virtual |
Implements PlayerDatabase.
References fs::CreateDir(), deSerialize(), DIR_DELIM, errorstream, Player::getName(), infostream, itos(), m_savedir, RemotePlayer::onSuccessfulSave(), open_ifstream(), fs::PathExists(), PLAYER_FILE_ALTERNATE_TRIES, fs::safeWriteToFile(), and serialize().
◆ serialize()
void PlayerDatabaseFiles::serialize |
( |
RemotePlayer * | p, |
|
|
std::ostream & | os ) |
|
private |
References fastWriteJson(), ServerActiveObject::getBasePosition(), PlayerSAO::getBreath(), UnitSAO::getHP(), PlayerSAO::getLookPitch(), PlayerSAO::getMeta(), UnitSAO::getRotation(), SimpleMetadata::getStrings(), p(), sanity_check, Settings::set(), Settings::setFloat(), Settings::setS32(), Settings::setU16(), Settings::setV3F(), and Settings::writeLines().
Referenced by savePlayer().
◆ m_savedir
std::string PlayerDatabaseFiles::m_savedir |
|
private |
The documentation for this class was generated from the following files: