aboutsummaryrefslogtreecommitdiff
path: root/src/script
Commit message (Expand)AuthorAge
...
* Fixed potential NULL pointer and leak when setting node metadataMetaDucky2013-11-29
* Fix broken thread stop handlingsapier2013-11-30
* Fix old gcc buildsapier2013-11-29
* Fix modstore/favourites hang by adding asynchronous lua job supportsapier2013-11-29
* Rollback fixes and get_node_actionsShadowNinja2013-11-27
* Fix line_of_sight (AGAIN)sapier2013-11-25
* Fix possible implicit conversion of NULL to std::stringkwolekr2013-11-21
* LuaVoxelManip: Update parameter index of set_lighting()kwolekr2013-11-21
* Fix issue #1009 (minetest.get_connected_players() returns non-existing players)kwolekr2013-11-17
* Decoration: Stop DecoSimple::resolveNodeNames from complaining about no node ...kwolekr2013-11-17
* Fix invalid listname and listsize not handled correctly in set_sizesapier2013-11-16
* fixed array limit check when reading Lua specialtiles tableMetaDucky2013-11-16
* Pass a errfunc to lua_pcall to get a tracebackShadowNinja2013-11-15
* Fix invalid usage of temporary object in mainmenu json conversionsapier2013-11-11
* Add a callback: minetest.register_on_craft(itemstack, player,Novatux2013-11-01
* Add set_name(), set_count(), set_wear() and set_metadata() to Lua ItemStackPilzAdam2013-09-28
* Show git hash in version string at top left corner of windowKahrl2013-09-28
* Re-fix hud_change stat argument retrievalkwolekr2013-09-26
* Fix some warnings and other minor detailskwolekr2013-09-16
* Weather: Clean up getHeat/getHumidity somewhatkwolekr2013-09-16
* Always use builtin JThread librarykwolekr2013-09-15
* Add offset to automatic_face_movement_dirPilzAdam2013-09-10
* Allow non-string arguments for minetest.is_yes()PilzAdam2013-09-10
* Add Settings interface for LuaPilzAdam2013-09-10
* Add minetest.get_gametime() API function, that returns the number of seconds ...Novatux2013-09-08
* Use player:set_hotbar_image() instead of hardcoded hotbar.pngPilzAdam2013-09-05
* Add minetest.parse_json, engine.parse_jsonKahrl2013-09-02
* Fix umlauts/special character issue in lua gettextBlockMen2013-08-19
* Allow SIGINT to kill mainmenu againKahrl2013-08-19
* Add translation for main menusapier2013-08-17
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Add support for entities to automatic face movement directionsapier2013-08-13
* Decoration: Fix schematic probability mess with new MTS file versionkwolekr2013-08-11
* Add support for different drowning damage and allow drowning in other nodetypesBlockMen2013-08-06
* Allow mods to listen to cheat detections using minetest.register_on_cheat()Perttu Ahola2013-08-04
* Add replacements to schematicsPilzAdam2013-08-03
* Allow multiple 'wherein' nodes in oredefPilzAdam2013-08-02
* Add support for setting stepheight for entitiessapier2013-07-30
* Better snow fall, finite liquid transform, leveled nodes apiproller2013-07-28
* Weather supportproller2013-07-27
* Add an option to disable object <-> object collision for Lua entitiesPilzAdam2013-07-20
* Add liquid_range to nodedefPilzAdam2013-07-20
* Make range of tools configureablePilzAdam2013-07-20
* Add set_breath and get_breath to lua API.RealBadAngel2013-07-20
* Change ContentFeatures array to a vectorKahrl2013-07-14
* Leveled nodeboxproller2013-07-13
* LuaVoxelManip: Allow liquid updates in non-mapgen VoxelManip objectskwolekr2013-07-06
* Mapgen V7: Huge rewrite, also tweaks to cavegen et al.kwolekr2013-07-06
* Fix possible 0 pointer accesssapier2013-07-02
* Decoration: Add schematic rotation supportkwolekr2013-07-01
e(s, iCol, val)); } inline std::string sqlite_to_string(sqlite3_stmt *s, int iCol) { const char* text = reinterpret_cast<const char*>(sqlite3_column_text(s, iCol)); return std::string(text ? text : ""); } inline s32 sqlite_to_int(sqlite3_stmt *s, int iCol) { return sqlite3_column_int(s, iCol); } inline u32 sqlite_to_uint(sqlite3_stmt *s, int iCol) { return (u32) sqlite3_column_int(s, iCol); } inline s64 sqlite_to_int64(sqlite3_stmt *s, int iCol) { return (s64) sqlite3_column_int64(s, iCol); } inline u64 sqlite_to_uint64(sqlite3_stmt *s, int iCol) { return (u64) sqlite3_column_int64(s, iCol); } inline float sqlite_to_float(sqlite3_stmt *s, int iCol) { return (float) sqlite3_column_double(s, iCol); } inline const v3f sqlite_to_v3f(sqlite3_stmt *s, int iCol) { return v3f(sqlite_to_float(s, iCol), sqlite_to_float(s, iCol + 1), sqlite_to_float(s, iCol + 2)); } // Query verifiers helpers inline void sqlite3_vrfy(int s, const std::string &m = "", int r = SQLITE_OK) const { if (s != r) throw DatabaseException(m + ": " + sqlite3_errmsg(m_database)); } inline void sqlite3_vrfy(const int s, const int r, const std::string &m = "") const { sqlite3_vrfy(s, m, r); } // Create the database structure virtual void createDatabase() = 0; virtual void initStatements() = 0; sqlite3 *m_database = nullptr; private: // Open the database void openDatabase(); bool m_initialized = false; std::string m_savedir = ""; std::string m_dbname = ""; sqlite3_stmt *m_stmt_begin = nullptr; sqlite3_stmt *m_stmt_end = nullptr; s64 m_busy_handler_data[2]; static int busyHandler(void *data, int count); }; class MapDatabaseSQLite3 : private Database_SQLite3, public MapDatabase { public: MapDatabaseSQLite3(const std::string &savedir); virtual ~MapDatabaseSQLite3(); bool saveBlock(const v3s16 &pos, const std::string &data); void loadBlock(const v3s16 &pos, std::string *block); bool deleteBlock(const v3s16 &pos); void listAllLoadableBlocks(std::vector<v3s16> &dst); void beginSave() { Database_SQLite3::beginSave(); } void endSave() { Database_SQLite3::endSave(); } protected: virtual void createDatabase(); virtual void initStatements(); private: void bindPos(sqlite3_stmt *stmt, const v3s16 &pos, int index = 1); // Map sqlite3_stmt *m_stmt_read = nullptr; sqlite3_stmt *m_stmt_write = nullptr; sqlite3_stmt *m_stmt_list = nullptr; sqlite3_stmt *m_stmt_delete = nullptr; }; class PlayerDatabaseSQLite3 : private Database_SQLite3, public PlayerDatabase { public: PlayerDatabaseSQLite3(const std::string &savedir); virtual ~PlayerDatabaseSQLite3(); void savePlayer(RemotePlayer *player); bool loadPlayer(RemotePlayer *player, PlayerSAO *sao); bool removePlayer(const std::string &name); void listPlayers(std::vector<std::string> &res); protected: virtual void createDatabase(); virtual void initStatements(); private: bool playerDataExists(const std::string &name); // Players sqlite3_stmt *m_stmt_player_load = nullptr; sqlite3_stmt *m_stmt_player_add = nullptr; sqlite3_stmt *m_stmt_player_update = nullptr; sqlite3_stmt *m_stmt_player_remove = nullptr; sqlite3_stmt *m_stmt_player_list = nullptr; sqlite3_stmt *m_stmt_player_load_inventory = nullptr; sqlite3_stmt *m_stmt_player_load_inventory_items = nullptr; sqlite3_stmt *m_stmt_player_add_inventory = nullptr; sqlite3_stmt *m_stmt_player_add_inventory_items = nullptr; sqlite3_stmt *m_stmt_player_remove_inventory = nullptr; sqlite3_stmt *m_stmt_player_remove_inventory_items = nullptr; sqlite3_stmt *m_stmt_player_metadata_load = nullptr; sqlite3_stmt *m_stmt_player_metadata_remove = nullptr; sqlite3_stmt *m_stmt_player_metadata_add = nullptr; }; class AuthDatabaseSQLite3 : private Database_SQLite3, public AuthDatabase { public: AuthDatabaseSQLite3(const std::string &savedir); virtual ~AuthDatabaseSQLite3(); virtual bool getAuth(const std::string &name, AuthEntry &res); virtual bool saveAuth(const AuthEntry &authEntry); virtual bool createAuth(AuthEntry &authEntry); virtual bool deleteAuth(const std::string &name); virtual void listNames(std::vector<std::string> &res); virtual void reload(); protected: virtual void createDatabase(); virtual void initStatements(); private: virtual void writePrivileges(const AuthEntry &authEntry); sqlite3_stmt *m_stmt_read = nullptr; sqlite3_stmt *m_stmt_write = nullptr; sqlite3_stmt *m_stmt_create = nullptr; sqlite3_stmt *m_stmt_delete = nullptr; sqlite3_stmt *m_stmt_list_names = nullptr; sqlite3_stmt *m_stmt_read_privs = nullptr; sqlite3_stmt *m_stmt_write_privs = nullptr; sqlite3_stmt *m_stmt_delete_privs = nullptr; sqlite3_stmt *m_stmt_last_insert_rowid = nullptr; };