aboutsummaryrefslogtreecommitdiff
path: root/assets/blender/mbb/signal(2)_hoch.blend
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-08-12 16:58:47 +0200
committerorwell96 <orwell@bleipb.de>2018-08-12 16:58:47 +0200
commita92ecbc26a14a193f103fe6a626eae000fe9b949 (patch)
tree7a88ed25c10d77eebf73d0f4d9f804b640070993 /assets/blender/mbb/signal(2)_hoch.blend
parent0ec89364c01eceb5c47f9cc3503d3561064b7fdb (diff)
downloadadvtrains-a92ecbc26a14a193f103fe6a626eae000fe9b949.tar.gz
advtrains-a92ecbc26a14a193f103fe6a626eae000fe9b949.tar.bz2
advtrains-a92ecbc26a14a193f103fe6a626eae000fe9b949.zip
Automatic working (re-set certain route on train pass)
Diffstat (limited to 'assets/blender/mbb/signal(2)_hoch.blend')
0 files changed, 0 insertions, 0 deletions
"database-leveldb.h" #include "log.h" #include "filesys.h" #include "exceptions.h" #include "util/string.h" #include "leveldb/db.h" #define ENSURE_STATUS_OK(s) \ if (!(s).ok()) { \ throw DatabaseException(std::string("LevelDB error: ") + \ (s).ToString()); \ } Database_LevelDB::Database_LevelDB(const std::string &savedir) { leveldb::Options options; options.create_if_missing = true; leveldb::Status status = leveldb::DB::Open(options, savedir + DIR_DELIM + "map.db", &m_database); ENSURE_STATUS_OK(status); } Database_LevelDB::~Database_LevelDB() { delete m_database; } bool Database_LevelDB::saveBlock(const v3s16 &pos, const std::string &data) { leveldb::Status status = m_database->Put(leveldb::WriteOptions(), i64tos(getBlockAsInteger(pos)), data); if (!status.ok()) { warningstream << "saveBlock: LevelDB error saving block " << PP(pos) << ": " << status.ToString() << std::endl; return false; } return true; } void Database_LevelDB::loadBlock(const v3s16 &pos, std::string *block) { std::string datastr; leveldb::Status status = m_database->Get(leveldb::ReadOptions(), i64tos(getBlockAsInteger(pos)), &datastr); *block = (status.ok()) ? datastr : ""; } bool Database_LevelDB::deleteBlock(const v3s16 &pos) { leveldb::Status status = m_database->Delete(leveldb::WriteOptions(), i64tos(getBlockAsInteger(pos))); if (!status.ok()) {